Skip to content

hw/arm/virt: Fix compats

Eric Auger requested to merge eauger1/centos-qemu-kvm:8.2.0-1.el9-efi-virtio into c9s

JIRA: RHEL-17168 Upstream: RHEL-only Brew: http://brewweb.engineering.redhat.com/brew/taskinfo?taskID=57852990

arm_rhel_compat is not added for virt-rhel9.4.0 machine causing the efi-virtio.rom to be looked for when instantiating a virtio-net-pci device and it won't be found since not shipped on ARM. This is a regression compared to 9.2.

Actually we do not need any rom file for any virtio-net-pci variant because edk2 already brings the functionality. So for 9.4 onwards, we want to set romfiles to "" for all of them.

However at the moment we apply arm_rhel_compat from the latest rhel*_virt_options(). This is not aligned with the generic compat usage which sets compats for a given machine type to accomodate for changes that occured after its advent. Here we are somehow abusing the compat infra to set general driver options that should apply for all machines. On top of that this is really error prone and we have forgotten to add arm_rhel_compat several times in the past.

So let's introduce set_arm_rhel_compat() being called before any *virt_options in the non abstract machine class. That way the setting will apply to any machine type without any need to add it in any future machine types.

For < 9.4 machines we don't really care keeping non void romfiles for transitional and non transitional devices because anyway this was not working. So let's keep things simple and apply the new defaults for all RHEL9 machine types.

Finally, to follow the generic pattern we should set hw_compat_rhel_9_0 in 9.0 machine as it is done on x86 or ccw. This has no consequence on aarch64 because it only contains x86 stuff but that helps understanding the consistency.

Signed-off-by: Eric Auger eric.auger@redhat.com

Edited by Eric Auger

Merge request reports