[PATCH 00/18] Grab bag of fixes and improvements

This started out as a way to make the upcoming loongarch64 support slightly nicer to implement, but ended up including a bunch of tangentially related changes. Since trying to unentangle them would just result in a bunch of smaller series that still have dependencies on each other, I'm just sending everything at once. Andrea Bolognani (18): tests: Add devices to pseries-phb-simple tests: Add pseries-phb-user-alias qemu: Fix handling of user aliases for default PHB tests: Drop aarch64-virtio-pci-default tests: Add {aarch64,riscv64}-virt-headless-mmio tests: Drop various redundant tests tests: Simplify balloon-mmio-deflate tests: Request virtio-mmio for balloon-mmio-deflate qemu: Stop checking QEMU_CAPS_OBJECT_GPEX qemu: Retire QEMU_CAPS_OBJECT_GPEX qemu: Improve qemuDomainSupportsPCI() qemu: Move qemuDomainSupportsPCIMultibus() qemu: Improve qemuDomainSupportsPCIMultibus() tests: Add *-default-net qemu: Improve qemuDomainDefaultNetModel() tests: Add *-default-devices qemu: Don't add memballoon by default on RISC-V qemu: Default to no USB and no memballoon for new architectures src/qemu/qemu_alias.c | 2 +- src/qemu/qemu_capabilities.c | 31 +----- src/qemu/qemu_capabilities.h | 4 +- src/qemu/qemu_command.c | 25 ++++- src/qemu/qemu_domain.c | 94 ++++++++++++------- src/qemu/qemu_domain.h | 4 +- src/qemu/qemu_domain_address.c | 2 +- .../caps_4.2.0_aarch64.xml | 1 - .../caps_5.0.0_aarch64.xml | 1 - .../caps_5.0.0_riscv64.xml | 1 - .../caps_5.2.0_aarch64.xml | 1 - .../caps_5.2.0_riscv64.xml | 1 - .../caps_5.2.0_x86_64.xml | 1 - .../caps_6.0.0_aarch64.xml | 1 - .../caps_6.0.0_x86_64.xml | 1 - .../caps_6.1.0_x86_64.xml | 1 - .../caps_6.2.0_aarch64.xml | 1 - .../caps_6.2.0_x86_64.xml | 1 - .../caps_7.0.0_aarch64+hvf.xml | 1 - .../caps_7.0.0_aarch64.xml | 1 - .../caps_7.0.0_x86_64.xml | 1 - .../caps_7.1.0_x86_64.xml | 1 - .../caps_7.2.0_x86_64+hvf.xml | 1 - .../caps_7.2.0_x86_64.xml | 1 - .../caps_8.0.0_riscv64.xml | 1 - .../caps_8.0.0_x86_64.xml | 1 - .../caps_8.1.0_x86_64.xml | 1 - .../caps_8.2.0_aarch64.xml | 1 - .../caps_8.2.0_x86_64.xml | 1 - .../caps_9.0.0_x86_64.xml | 1 - ...ch64-aavmf-virtio-mmio.aarch64-latest.args | 46 --------- .../aarch64-aavmf-virtio-mmio.xml | 49 ---------- ...arch64-default-devices.aarch64-latest.args | 31 ++++++ .../aarch64-default-devices.xml | 12 +++ .../aarch64-default-net.aarch64-latest.args | 35 +++++++ .../qemuxml2argvdata/aarch64-default-net.xml | 17 ++++ ...h64-virt-headless-mmio.aarch64-latest.args | 48 ++++++++++ .../aarch64-virt-headless-mmio.xml | 48 ++++++++++ ...ch64-virtio-pci-default.aarch64-4.2.0.args | 54 ----------- ...h64-virtio-pci-default.aarch64-latest.args | 54 ----------- .../aarch64-virtio-pci-default.xml | 44 --------- .../arm-virt-virtio.aarch64-latest.args | 54 ----------- tests/qemuxml2argvdata/arm-virt-virtio.xml | 45 --------- .../balloon-mmio-deflate.aarch64-latest.args | 4 - .../qemuxml2argvdata/balloon-mmio-deflate.xml | 17 +--- ...> ppc64-default-devices.ppc64-latest.args} | 22 ++--- .../ppc64-default-devices.xml | 12 +++ ...gs => ppc64-default-net.ppc64-latest.args} | 22 ++--- ...s-phb-simple.xml => ppc64-default-net.xml} | 12 +-- .../pseries-phb-simple.ppc64-latest.args | 5 +- tests/qemuxml2argvdata/pseries-phb-simple.xml | 11 ++- ... pseries-phb-user-alias.ppc64-latest.args} | 7 +- .../pseries-phb-user-alias.xml | 30 ++++++ ...iscv64-default-devices.riscv64-latest.args | 30 ++++++ .../riscv64-default-devices.xml | 12 +++ .../riscv64-default-net.riscv64-latest.args | 34 +++++++ .../qemuxml2argvdata/riscv64-default-net.xml | 17 ++++ ...64-virt-headless-mmio.riscv64-latest.args} | 39 ++++---- .../riscv64-virt-headless-mmio.xml | 43 +++++++++ .../riscv64-virt-pci.riscv64-latest.args | 35 ------- tests/qemuxml2argvdata/riscv64-virt-pci.xml | 24 ----- .../riscv64-virt.riscv64-latest.args | 38 -------- tests/qemuxml2argvdata/riscv64-virt.xml | 19 ---- .../s390x-default-devices.s390x-latest.args | 32 +++++++ .../s390x-default-devices.xml | 12 +++ .../s390x-default-net.s390x-latest.args | 33 +++++++ tests/qemuxml2argvdata/s390x-default-net.xml | 17 ++++ .../x86_64-default-devices.x86_64-latest.args | 33 +++++++ .../x86_64-default-devices.xml | 12 +++ .../x86_64-default-net.x86_64-latest.args | 33 +++++++ tests/qemuxml2argvdata/x86_64-default-net.xml | 17 ++++ tests/qemuxml2argvtest.c | 47 ++++------ ...rch64-aavmf-virtio-mmio.aarch64-latest.xml | 56 ----------- ...aarch64-default-devices.aarch64-latest.xml | 26 +++++ .../aarch64-default-net.aarch64-latest.xml | 43 +++++++++ ...ch64-virt-headless-mmio.aarch64-latest.xml | 71 ++++++++++++++ ...ch64-virtio-pci-default.aarch64-latest.xml | 94 ------------------- ...=> ppc64-default-devices.ppc64-latest.xml} | 24 ++--- ...xml => ppc64-default-net.ppc64-latest.xml} | 23 ++--- .../pseries-phb-simple.ppc64-latest.xml | 14 ++- ...> pseries-phb-user-alias.ppc64-latest.xml} | 18 +++- ...riscv64-default-devices.riscv64-latest.xml | 20 ++++ .../riscv64-default-net.riscv64-latest.xml | 37 ++++++++ ...cv64-virt-headless-mmio.riscv64-latest.xml | 58 ++++++++++++ .../s390x-default-devices.s390x-latest.xml | 27 ++++++ .../s390x-default-net.s390x-latest.xml | 31 ++++++ .../x86_64-default-devices.x86_64-latest.xml | 31 ++++++ .../x86_64-default-net.x86_64-latest.xml | 32 +++++++ tests/qemuxml2xmltest.c | 21 ++++- 89 files changed, 1162 insertions(+), 855 deletions(-) delete mode 100644 tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.aarch64-latest.args delete mode 100644 tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.xml create mode 100644 tests/qemuxml2argvdata/aarch64-default-devices.aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/aarch64-default-devices.xml create mode 100644 tests/qemuxml2argvdata/aarch64-default-net.aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/aarch64-default-net.xml create mode 100644 tests/qemuxml2argvdata/aarch64-virt-headless-mmio.aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/aarch64-virt-headless-mmio.xml delete mode 100644 tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-4.2.0.args delete mode 100644 tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-latest.args delete mode 100644 tests/qemuxml2argvdata/aarch64-virtio-pci-default.xml delete mode 100644 tests/qemuxml2argvdata/arm-virt-virtio.aarch64-latest.args delete mode 100644 tests/qemuxml2argvdata/arm-virt-virtio.xml copy tests/qemuxml2argvdata/{pseries-phb-simple.ppc64-latest.args => ppc64-default-devices.ppc64-latest.args} (56%) create mode 100644 tests/qemuxml2argvdata/ppc64-default-devices.xml copy tests/qemuxml2argvdata/{pseries-phb-simple.ppc64-latest.args => ppc64-default-net.ppc64-latest.args} (56%) copy tests/qemuxml2argvdata/{pseries-phb-simple.xml => ppc64-default-net.xml} (55%) copy tests/qemuxml2argvdata/{pseries-phb-simple.ppc64-latest.args => pseries-phb-user-alias.ppc64-latest.args} (75%) create mode 100644 tests/qemuxml2argvdata/pseries-phb-user-alias.xml create mode 100644 tests/qemuxml2argvdata/riscv64-default-devices.riscv64-latest.args create mode 100644 tests/qemuxml2argvdata/riscv64-default-devices.xml create mode 100644 tests/qemuxml2argvdata/riscv64-default-net.riscv64-latest.args create mode 100644 tests/qemuxml2argvdata/riscv64-default-net.xml rename tests/qemuxml2argvdata/{aarch64-virt-virtio-MMIO.aarch64.latest.args => riscv64-virt-headless-mmio.riscv64-latest.args} (50%) create mode 100644 tests/qemuxml2argvdata/riscv64-virt-headless-mmio.xml delete mode 100644 tests/qemuxml2argvdata/riscv64-virt-pci.riscv64-latest.args delete mode 100644 tests/qemuxml2argvdata/riscv64-virt-pci.xml delete mode 100644 tests/qemuxml2argvdata/riscv64-virt.riscv64-latest.args delete mode 100644 tests/qemuxml2argvdata/riscv64-virt.xml create mode 100644 tests/qemuxml2argvdata/s390x-default-devices.s390x-latest.args create mode 100644 tests/qemuxml2argvdata/s390x-default-devices.xml create mode 100644 tests/qemuxml2argvdata/s390x-default-net.s390x-latest.args create mode 100644 tests/qemuxml2argvdata/s390x-default-net.xml create mode 100644 tests/qemuxml2argvdata/x86_64-default-devices.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/x86_64-default-devices.xml create mode 100644 tests/qemuxml2argvdata/x86_64-default-net.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/x86_64-default-net.xml delete mode 100644 tests/qemuxml2xmloutdata/aarch64-aavmf-virtio-mmio.aarch64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/aarch64-default-devices.aarch64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/aarch64-default-net.aarch64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/aarch64-virt-headless-mmio.aarch64-latest.xml delete mode 100644 tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml copy tests/qemuxml2xmloutdata/{pseries-phb-simple.ppc64-latest.xml => ppc64-default-devices.ppc64-latest.xml} (58%) copy tests/qemuxml2xmloutdata/{pseries-phb-simple.ppc64-latest.xml => ppc64-default-net.ppc64-latest.xml} (63%) copy tests/qemuxml2xmloutdata/{pseries-phb-simple.ppc64-latest.xml => pseries-phb-user-alias.ppc64-latest.xml} (69%) create mode 100644 tests/qemuxml2xmloutdata/riscv64-default-devices.riscv64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/riscv64-default-net.riscv64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/riscv64-virt-headless-mmio.riscv64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/s390x-default-devices.s390x-latest.xml create mode 100644 tests/qemuxml2xmloutdata/s390x-default-net.s390x-latest.xml create mode 100644 tests/qemuxml2xmloutdata/x86_64-default-devices.x86_64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/x86_64-default-net.x86_64-latest.xml -- 2.43.0

We want to make sure that not only the controllers themselves are added correctly, but also that devices attached to them get assigned the expected bus value. In order to do that add some devices, one per controller. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../pseries-phb-simple.ppc64-latest.args | 5 ++++- tests/qemuxml2argvdata/pseries-phb-simple.xml | 11 ++++++++++- .../pseries-phb-simple.ppc64-latest.xml | 14 ++++++++++---- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/tests/qemuxml2argvdata/pseries-phb-simple.ppc64-latest.args b/tests/qemuxml2argvdata/pseries-phb-simple.ppc64-latest.args index c2c28bd198..b6c0ecae8e 100644 --- a/tests/qemuxml2argvdata/pseries-phb-simple.ppc64-latest.args +++ b/tests/qemuxml2argvdata/pseries-phb-simple.ppc64-latest.args @@ -27,7 +27,10 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -no-shutdown \ -boot strict=on \ -device '{"driver":"spapr-pci-host-bridge","index":1,"id":"pci.1"}' \ --device '{"driver":"spapr-pci-host-bridge","index":2,"id":"pci.2"}' \ +-netdev user,id=hostnet0 \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:a2:44:92","bus":"pci.0","addr":"0x1"}' \ +-netdev user,id=hostnet1 \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet1","id":"net1","mac":"52:54:00:a2:44:93","bus":"pci.1.0","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/pseries-phb-simple.xml b/tests/qemuxml2argvdata/pseries-phb-simple.xml index b1c6ff3006..ae9e78b95b 100644 --- a/tests/qemuxml2argvdata/pseries-phb-simple.xml +++ b/tests/qemuxml2argvdata/pseries-phb-simple.xml @@ -10,7 +10,16 @@ <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='pci' model='pci-root'/> <controller type='pci' model='pci-root'/> - <controller type='pci' model='pci-root'/> + <interface type='user'> + <mac address='52:54:00:a2:44:92'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </interface> + <interface type='user'> + <mac address='52:54:00:a2:44:93'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/> + </interface> <controller type='usb' model='none'/> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2xmloutdata/pseries-phb-simple.ppc64-latest.xml b/tests/qemuxml2xmloutdata/pseries-phb-simple.ppc64-latest.xml index 80231e3dd7..936db5df2b 100644 --- a/tests/qemuxml2xmloutdata/pseries-phb-simple.ppc64-latest.xml +++ b/tests/qemuxml2xmloutdata/pseries-phb-simple.ppc64-latest.xml @@ -25,11 +25,17 @@ <model name='spapr-pci-host-bridge'/> <target index='1'/> </controller> - <controller type='pci' index='2' model='pci-root'> - <model name='spapr-pci-host-bridge'/> - <target index='2'/> - </controller> <controller type='usb' index='0' model='none'/> + <interface type='user'> + <mac address='52:54:00:a2:44:92'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </interface> + <interface type='user'> + <mac address='52:54:00:a2:44:93'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/> + </interface> <audio id='1' type='none'/> <memballoon model='none'/> <panic model='pseries'/> -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:34 +0100, Andrea Bolognani wrote:
We want to make sure that not only the controllers themselves are added correctly, but also that devices attached to them get assigned the expected bus value. In order to do that add some devices, one per controller.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../pseries-phb-simple.ppc64-latest.args | 5 ++++- tests/qemuxml2argvdata/pseries-phb-simple.xml | 11 ++++++++++- .../pseries-phb-simple.ppc64-latest.xml | 14 ++++++++++---- 3 files changed, 24 insertions(+), 6 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

This is the same as the existing pseries-phb-simple, except that each of the controllers is given a user alias. If we tried to start the resulting guest, we'd get an error: Bus 'ua-phb0' not found This is because, at the QEMU command line level, the default PHB is not represented and so it can't be given a custom alias. We're going to address this issue in a follow-up commit. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../pseries-phb-user-alias.ppc64-latest.args | 36 +++++++++++++++ .../pseries-phb-user-alias.xml | 30 +++++++++++++ tests/qemuxml2argvtest.c | 1 + .../pseries-phb-user-alias.ppc64-latest.xml | 45 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 5 files changed, 113 insertions(+) create mode 100644 tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/pseries-phb-user-alias.xml create mode 100644 tests/qemuxml2xmloutdata/pseries-phb-user-alias.ppc64-latest.xml diff --git a/tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.args b/tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.args new file mode 100644 index 0000000000..e64fc9aa11 --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-ppc64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram \ +-accel tcg \ +-cpu POWER9 \ +-m size=524288k \ +-object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":536870912}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"spapr-pci-host-bridge","index":1,"id":"ua-phb1"}' \ +-netdev user,id=hostnet0 \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:a2:44:92","bus":"ua-phb0","addr":"0x1"}' \ +-netdev user,id=hostnet1 \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet1","id":"net1","mac":"52:54:00:a2:44:93","bus":"ua-phb1.0","addr":"0x1"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/pseries-phb-user-alias.xml b/tests/qemuxml2argvdata/pseries-phb-user-alias.xml new file mode 100644 index 0000000000..1f95e52747 --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-phb-user-alias.xml @@ -0,0 +1,30 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>524288</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='usb' model='none'/> + <controller type='pci' model='pci-root'> + <alias name='ua-phb0'/> + </controller> + <controller type='pci' model='pci-root'> + <alias name='ua-phb1'/> + </controller> + <interface type='user'> + <mac address='52:54:00:a2:44:92'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </interface> + <interface type='user'> + <mac address='52:54:00:a2:44:93'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/> + </interface> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1be138bb0f..354f47bea3 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2038,6 +2038,7 @@ mymain(void) DO_TEST_CAPS_LATEST_PPC64("pseries-phb-simple"); DO_TEST_CAPS_LATEST_PPC64("pseries-phb-default-missing"); DO_TEST_CAPS_LATEST_PPC64("pseries-phb-numa-node"); + DO_TEST_CAPS_LATEST_PPC64("pseries-phb-user-alias"); DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("pseries-default-phb-numa-node", "ppc64"); DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("pseries-phb-invalid-target-index-1", "ppc64"); diff --git a/tests/qemuxml2xmloutdata/pseries-phb-user-alias.ppc64-latest.xml b/tests/qemuxml2xmloutdata/pseries-phb-user-alias.ppc64-latest.xml new file mode 100644 index 0000000000..d6de2037a8 --- /dev/null +++ b/tests/qemuxml2xmloutdata/pseries-phb-user-alias.ppc64-latest.xml @@ -0,0 +1,45 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>524288</memory> + <currentMemory unit='KiB'>524288</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER9</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='usb' index='0' model='none'/> + <controller type='pci' index='0' model='pci-root'> + <model name='spapr-pci-host-bridge'/> + <target index='0'/> + <alias name='ua-phb0'/> + </controller> + <controller type='pci' index='1' model='pci-root'> + <model name='spapr-pci-host-bridge'/> + <target index='1'/> + <alias name='ua-phb1'/> + </controller> + <interface type='user'> + <mac address='52:54:00:a2:44:92'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </interface> + <interface type='user'> + <mac address='52:54:00:a2:44:93'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/> + </interface> + <audio id='1' type='none'/> + <memballoon model='none'/> + <panic model='pseries'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 15cb6bd692..b281d9970f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -541,6 +541,7 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("pseries-phb-simple", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("pseries-phb-default-missing", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("pseries-phb-numa-node", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("pseries-phb-user-alias", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("pseries-many-devices", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("pseries-many-buses-1", "ppc64"); -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:35 +0100, Andrea Bolognani wrote:
This is the same as the existing pseries-phb-simple, except that each of the controllers is given a user alias. If we tried to start the resulting guest, we'd get an error:
Bus 'ua-phb0' not found
This is because, at the QEMU command line level, the default PHB is not represented and so it can't be given a custom alias. We're going to address this issue in a follow-up commit.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

The bus name for the default PHB is always "pci.0". Fixes: 937f319536723fec57ad472b002a159d0f67a77c Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 23 ++++++++++++++++--- .../pseries-phb-user-alias.ppc64-latest.args | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 712feb7b81..f2a4e1088b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -366,9 +366,26 @@ qemuBuildDeviceAddressPCIGetBus(const virDomainDef *domainDef, if (virDomainDeviceAliasIsUserAlias(contAlias)) { /* When domain has builtin pci-root controller we don't put it * onto cmd line. Therefore we can't set its alias. In that - * case, use the default one. */ - if (!qemuDomainIsPSeries(domainDef) && - cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { + * case, use the default one. + * + * Note that we have to check the value of targetIndex here, + * because we need to handle three different cases: + * + * non-pSeries guest (targetIndex == -1) + * => must use default alias + * + * pSeries guest, default PHB (targetIndex == 0) + * => must use default alias + * + * pSeries guest, non-default PHB (targetIndex > 0) + * => can use actual alias + * + * The last one is due to non-default PHBs beind created + * through the spapr-pci-host-bridge device, which supports + * custom device IDs and thus custom bus names. + * */ + if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT && + contTargetIndex <= 0) { if (virQEMUCapsHasPCIMultiBus(domainDef)) contAlias = "pci.0"; else diff --git a/tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.args b/tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.args index e64fc9aa11..8a2be8cf0c 100644 --- a/tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.args +++ b/tests/qemuxml2argvdata/pseries-phb-user-alias.ppc64-latest.args @@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -boot strict=on \ -device '{"driver":"spapr-pci-host-bridge","index":1,"id":"ua-phb1"}' \ -netdev user,id=hostnet0 \ --device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:a2:44:92","bus":"ua-phb0","addr":"0x1"}' \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:a2:44:92","bus":"pci.0","addr":"0x1"}' \ -netdev user,id=hostnet1 \ -device '{"driver":"virtio-net-pci","netdev":"hostnet1","id":"net1","mac":"52:54:00:a2:44:93","bus":"ua-phb1.0","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:36 +0100, Andrea Bolognani wrote:
The bus name for the default PHB is always "pci.0".
Fixes: 937f319536723fec57ad472b002a159d0f67a77c Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_command.c | 23 ++++++++++++++++--- .../pseries-phb-user-alias.ppc64-latest.args | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

After commit 1d8454639f40 (libvirt 3.0.0), the default address type for aarch64/virt guests is PCI. These tests are then pointless, as they are just a subset of other tests, and the comment attached to them inaccurate. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...ch64-virtio-pci-default.aarch64-4.2.0.args | 54 ----------- ...h64-virtio-pci-default.aarch64-latest.args | 54 ----------- .../aarch64-virtio-pci-default.xml | 44 --------- tests/qemuxml2argvtest.c | 6 -- ...ch64-virtio-pci-default.aarch64-latest.xml | 94 ------------------- tests/qemuxml2xmltest.c | 1 - 6 files changed, 253 deletions(-) delete mode 100644 tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-4.2.0.args delete mode 100644 tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-latest.args delete mode 100644 tests/qemuxml2argvdata/aarch64-virtio-pci-default.xml delete mode 100644 tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml diff --git a/tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-4.2.0.args b/tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-4.2.0.args deleted file mode 100644 index 3ee2bcd93b..0000000000 --- a/tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-4.2.0.args +++ /dev/null @@ -1,54 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes \ --machine virt-4.2,usb=off,gic-version=2,dump-guest-core=off \ --accel tcg \ --cpu cortex-a53 \ --m size=1048576k \ --overcommit mem-lock=off \ --smp 1,sockets=1,cores=1,threads=1 \ --uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --no-acpi \ --boot strict=on \ --kernel /aarch64.kernel \ --initrd /aarch64.initrd \ --append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \ --dtb /aarch64.dtb \ --device pcie-root-port,port=8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1 \ --device pcie-root-port,port=9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \ --device pcie-root-port,port=10,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 \ --device pcie-root-port,port=11,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 \ --device pcie-root-port,port=12,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 \ --device pcie-root-port,port=13,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x5 \ --device virtio-serial-pci,id=virtio-serial0,bus=pci.2,addr=0x0 \ --blockdev '{"driver":"file","filename":"/aarch64.raw","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ --blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ --device virtio-blk-pci,scsi=off,bus=pci.3,addr=0x0,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \ --netdev user,id=hostnet0 \ --device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.1,addr=0x0 \ --chardev pty,id=charserial0 \ --serial chardev:charserial0 \ --chardev pty,id=charconsole1 \ --device virtconsole,chardev=charconsole1,id=console1 \ --audiodev '{"id":"audio1","driver":"none"}' \ --device virtio-balloon-pci,id=balloon0,bus=pci.4,addr=0x0 \ --object rng-random,id=objrng0,filename=/dev/random \ --device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.5,addr=0x0 \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-latest.args deleted file mode 100644 index 03dc8172cc..0000000000 --- a/tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-latest.args +++ /dev/null @@ -1,54 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \ --accel tcg \ --cpu cortex-a53 \ --m size=1048576k \ --object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \ --overcommit mem-lock=off \ --smp 1,sockets=1,cores=1,threads=1 \ --uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --boot strict=on \ --kernel /aarch64.kernel \ --initrd /aarch64.initrd \ --append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \ --dtb /aarch64.dtb \ --device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ --device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ --device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x2"}' \ --device '{"driver":"pcie-root-port","port":11,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x3"}' \ --device '{"driver":"pcie-root-port","port":12,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x4"}' \ --device '{"driver":"pcie-root-port","port":13,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x1.0x5"}' \ --device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.2","addr":"0x0"}' \ --blockdev '{"driver":"file","filename":"/aarch64.raw","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ --blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ --device '{"driver":"virtio-blk-pci","bus":"pci.3","addr":"0x0","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \ --netdev '{"type":"user","id":"hostnet0"}' \ --device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ --chardev pty,id=charserial0 \ --serial chardev:charserial0 \ --chardev pty,id=charconsole1 \ --device '{"driver":"virtconsole","chardev":"charconsole1","id":"console1"}' \ --audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.4","addr":"0x0"}' \ --object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/random"}' \ --device '{"driver":"virtio-rng-pci","rng":"objrng0","id":"rng0","bus":"pci.5","addr":"0x0"}' \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxml2argvdata/aarch64-virtio-pci-default.xml b/tests/qemuxml2argvdata/aarch64-virtio-pci-default.xml deleted file mode 100644 index 72bf0c95c3..0000000000 --- a/tests/qemuxml2argvdata/aarch64-virtio-pci-default.xml +++ /dev/null @@ -1,44 +0,0 @@ -<domain type="qemu"> - <name>aarch64test</name> - <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid> - <memory>1048576</memory> - <currentMemory>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch="aarch64" machine="virt">hvm</type> - <kernel>/aarch64.kernel</kernel> - <initrd>/aarch64.initrd</initrd> - <dtb>/aarch64.dtb</dtb> - <cmdline>earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait</cmdline> - </os> - <features> - <apic/> - <pae/> - </features> - <cpu match='exact'> - <model>cortex-a53</model> - </cpu> - <clock offset="utc"/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <disk type='file' device='disk'> - <source file='/aarch64.raw'/> - <target dev='vda' bus='virtio'/> - </disk> - <interface type='user'> - <mac address='52:54:00:09:a4:37'/> - <model type='virtio'/> - </interface> - <console type='pty'/> - <console type='pty'> - <target type='virtio' port='0'/> - </console> - <memballoon model='virtio'/> - <rng model='virtio'> - <backend model='random'>/dev/random</backend> - </rng> - </devices> -</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 354f47bea3..0987f4c78f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2268,12 +2268,6 @@ mymain(void) DO_TEST_CAPS_ARCH_VER("aarch64-virt-virtio", "aarch64", "4.2.0"); DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-virtio", "aarch64"); - /* Demonstrates the virtio-pci default... namely that there isn't any! - q35 style PCI controllers will be added if the binary supports it, - but virtio-mmio is always used unless PCI addresses are manually - specified. */ - DO_TEST_CAPS_ARCH_VER("aarch64-virtio-pci-default", "aarch64", "4.2.0"); - DO_TEST_CAPS_ARCH_LATEST("aarch64-virtio-pci-default", "aarch64"); /* Example of using virtio-pci with no explicit PCI controller but with manual PCI addresses */ DO_TEST_CAPS_ARCH_LATEST("aarch64-virtio-pci-manual-addresses", "aarch64"); diff --git a/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml deleted file mode 100644 index 1ea25a01f5..0000000000 --- a/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml +++ /dev/null @@ -1,94 +0,0 @@ -<domain type='qemu'> - <name>aarch64test</name> - <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='virt'>hvm</type> - <kernel>/aarch64.kernel</kernel> - <initrd>/aarch64.initrd</initrd> - <cmdline>earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait</cmdline> - <dtb>/aarch64.dtb</dtb> - <boot dev='hd'/> - </os> - <features> - <apic/> - <pae/> - <gic version='2'/> - </features> - <cpu mode='custom' match='exact' check='none'> - <model fallback='allow'>cortex-a53</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <disk type='file' device='disk'> - <driver name='qemu' type='raw'/> - <source file='/aarch64.raw'/> - <target dev='vda' bus='virtio'/> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> - </disk> - <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> - </controller> - <controller type='pci' index='1' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='1' port='0x8'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> - </controller> - <controller type='pci' index='2' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='2' port='0x9'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> - </controller> - <controller type='pci' index='3' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='3' port='0xa'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> - </controller> - <controller type='pci' index='4' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='4' port='0xb'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/> - </controller> - <controller type='pci' index='5' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='5' port='0xc'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/> - </controller> - <controller type='pci' index='6' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='6' port='0xd'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/> - </controller> - <interface type='user'> - <mac address='52:54:00:09:a4:37'/> - <model type='virtio'/> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </interface> - <serial type='pty'> - <target type='system-serial' port='0'> - <model name='pl011'/> - </target> - </serial> - <console type='pty'> - <target type='serial' port='0'/> - </console> - <console type='pty'> - <target type='virtio' port='1'/> - </console> - <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> - </memballoon> - <rng model='virtio'> - <backend model='random'>/dev/random</backend> - <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> - </rng> - </devices> -</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index b281d9970f..dff0241c53 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -766,7 +766,6 @@ mymain(void) DO_TEST_CAPS_LATEST("smbios-type-fwcfg"); DO_TEST_CAPS_ARCH_LATEST("aarch64-aavmf-virtio-mmio", "aarch64"); - DO_TEST_CAPS_ARCH_LATEST("aarch64-virtio-pci-default", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("aarch64-virtio-pci-manual-addresses", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("aarch64-video-virtio-gpu-pci", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("aarch64-pci-serial", "aarch64"); -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:37 +0100, Andrea Bolognani wrote:
After commit 1d8454639f40 (libvirt 3.0.0), the default address type for aarch64/virt guests is PCI. These tests are then pointless, as they are just a subset of other tests, and the comment attached to them inaccurate.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...ch64-virtio-pci-default.aarch64-4.2.0.args | 54 ----------- ...h64-virtio-pci-default.aarch64-latest.args | 54 ----------- .../aarch64-virtio-pci-default.xml | 44 --------- tests/qemuxml2argvtest.c | 6 -- ...ch64-virtio-pci-default.aarch64-latest.xml | 94 ------------------- tests/qemuxml2xmltest.c | 1 - 6 files changed, 253 deletions(-) delete mode 100644 tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-4.2.0.args delete mode 100644 tests/qemuxml2argvdata/aarch64-virtio-pci-default.aarch64-latest.args delete mode 100644 tests/qemuxml2argvdata/aarch64-virtio-pci-default.xml delete mode 100644 tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Even though virtio-mmio is no longer the default on either architecture, and likely nobody is using it at this point, we still provide a way to opt into virtio-mmio usage and want to keep existing guests working. Add explicit test suite coverage for this scenario. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...h64-virt-headless-mmio.aarch64-latest.args | 48 +++++++++++++ .../aarch64-virt-headless-mmio.xml | 48 +++++++++++++ ...v64-virt-headless-mmio.riscv64-latest.args | 43 +++++++++++ .../riscv64-virt-headless-mmio.xml | 43 +++++++++++ tests/qemuxml2argvtest.c | 2 + ...ch64-virt-headless-mmio.aarch64-latest.xml | 71 +++++++++++++++++++ ...cv64-virt-headless-mmio.riscv64-latest.xml | 58 +++++++++++++++ tests/qemuxml2xmltest.c | 2 + 8 files changed, 315 insertions(+) create mode 100644 tests/qemuxml2argvdata/aarch64-virt-headless-mmio.aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/aarch64-virt-headless-mmio.xml create mode 100644 tests/qemuxml2argvdata/riscv64-virt-headless-mmio.riscv64-latest.args create mode 100644 tests/qemuxml2argvdata/riscv64-virt-headless-mmio.xml create mode 100644 tests/qemuxml2xmloutdata/aarch64-virt-headless-mmio.aarch64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/riscv64-virt-headless-mmio.riscv64-latest.xml diff --git a/tests/qemuxml2argvdata/aarch64-virt-headless-mmio.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-virt-headless-mmio.aarch64-latest.args new file mode 100644 index 0000000000..f546cf33c7 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-virt-headless-mmio.aarch64-latest.args @@ -0,0 +1,48 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-aarch64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-blockdev '{"driver":"file","filename":"/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \ +-blockdev '{"driver":"file","filename":"/path/to/guest_VARS.raw","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \ +-machine virt-4.0,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,acpi=on \ +-accel tcg \ +-cpu cortex-a15 \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"virtio-serial-device","id":"virtio-serial0"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/guest.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \ +-device '{"driver":"virtio-blk-device","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \ +-netdev '{"type":"user","id":"hostnet0"}' \ +-device '{"driver":"virtio-net-device","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37"}' \ +-chardev pty,id=charserial0 \ +-serial chardev:charserial0 \ +-chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-device","id":"balloon0"}' \ +-object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/urandom"}' \ +-device '{"driver":"virtio-rng-device","rng":"objrng0","id":"rng0"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/aarch64-virt-headless-mmio.xml b/tests/qemuxml2argvdata/aarch64-virt-headless-mmio.xml new file mode 100644 index 0000000000..4f2519bb1f --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-virt-headless-mmio.xml @@ -0,0 +1,48 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <metadata> + <libosinfo:libosinfo xmlns:libosinfo='http://libosinfo.org/xmlns/libvirt/domain/1.0'> + <libosinfo:os id='http://fedoraproject.org/fedora/29'/> + </libosinfo:libosinfo> + </metadata> + <memory>4194304</memory> + <currentMemory>4194304</currentMemory> + <vcpu>4</vcpu> + <os> + <type arch='aarch64' machine='virt-4.0'>hvm</type> + <loader readonly='yes' type='pflash'>/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw</loader> + <nvram>/path/to/guest_VARS.raw</nvram> + <boot dev='hd'/> + </os> + <features> + <acpi/> + </features> + <clock offset='utc'/> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2'/> + <source file='/var/lib/libvirt/images/guest.qcow2'/> + <target dev='vda' bus='virtio'/> + <address type='virtio-mmio'/> + </disk> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='virtio'/> + <address type='virtio-mmio'/> + </interface> + <console type='pty'/> + <channel type='unix'> + <source mode='bind'/> + <target type='virtio' name='org.qemu.guest_agent.0'/> + </channel> + <memballoon model='virtio'> + <address type='virtio-mmio'/> + </memballoon> + <rng model='virtio'> + <backend model='random'>/dev/urandom</backend> + <address type='virtio-mmio'/> + </rng> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/riscv64-virt-headless-mmio.riscv64-latest.args b/tests/qemuxml2argvdata/riscv64-virt-headless-mmio.riscv64-latest.args new file mode 100644 index 0000000000..bf7ce2cf9e --- /dev/null +++ b/tests/qemuxml2argvdata/riscv64-virt-headless-mmio.riscv64-latest.args @@ -0,0 +1,43 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-riscv64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram \ +-accel tcg \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"virtio-serial-device","id":"virtio-serial0"}' \ +-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/guest.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \ +-device '{"driver":"virtio-blk-device","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \ +-netdev '{"type":"user","id":"hostnet0"}' \ +-device '{"driver":"virtio-net-device","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37"}' \ +-chardev pty,id=charserial0 \ +-serial chardev:charserial0 \ +-chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ +-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-device","id":"balloon0"}' \ +-object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/urandom"}' \ +-device '{"driver":"virtio-rng-device","rng":"objrng0","id":"rng0"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/riscv64-virt-headless-mmio.xml b/tests/qemuxml2argvdata/riscv64-virt-headless-mmio.xml new file mode 100644 index 0000000000..bcba73e9f1 --- /dev/null +++ b/tests/qemuxml2argvdata/riscv64-virt-headless-mmio.xml @@ -0,0 +1,43 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <metadata> + <libosinfo:libosinfo xmlns:libosinfo='http://libosinfo.org/xmlns/libvirt/domain/1.0'> + <libosinfo:os id='http://fedoraproject.org/fedora/29'/> + </libosinfo:libosinfo> + </metadata> + <memory>4194304</memory> + <currentMemory>4194304</currentMemory> + <vcpu>4</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2'/> + <source file='/var/lib/libvirt/images/guest.qcow2'/> + <target dev='vda' bus='virtio'/> + <address type='virtio-mmio'/> + </disk> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='virtio'/> + <address type='virtio-mmio'/> + </interface> + <console type='pty'/> + <channel type='unix'> + <source mode='bind'/> + <target type='virtio' name='org.qemu.guest_agent.0'/> + </channel> + <memballoon model='virtio'> + <address type='virtio-mmio'/> + </memballoon> + <rng model='virtio'> + <backend model='random'>/dev/urandom</backend> + <address type='virtio-mmio'/> + </rng> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0987f4c78f..1bc3985aca 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2539,8 +2539,10 @@ mymain(void) /* Simple headless guests for various architectures */ DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-headless", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-headless-mmio", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("ppc64-pseries-headless", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-headless", "riscv64"); + DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-headless-mmio", "riscv64"); DO_TEST_CAPS_ARCH_LATEST("s390x-ccw-headless", "s390x"); DO_TEST_CAPS_ARCH_LATEST("x86_64-pc-headless", "x86_64"); DO_TEST_CAPS_ARCH_LATEST("x86_64-q35-headless", "x86_64"); diff --git a/tests/qemuxml2xmloutdata/aarch64-virt-headless-mmio.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virt-headless-mmio.aarch64-latest.xml new file mode 100644 index 0000000000..1b2d6e70bd --- /dev/null +++ b/tests/qemuxml2xmloutdata/aarch64-virt-headless-mmio.aarch64-latest.xml @@ -0,0 +1,71 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <metadata> + <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> + <libosinfo:os id="http://fedoraproject.org/fedora/29"/> + </libosinfo:libosinfo> + </metadata> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os firmware='efi'> + <type arch='aarch64' machine='virt-4.0'>hvm</type> + <firmware> + <feature enabled='no' name='enrolled-keys'/> + <feature enabled='no' name='secure-boot'/> + </firmware> + <loader readonly='yes' type='pflash'>/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw</loader> + <nvram template='/usr/share/edk2/aarch64/vars-template-pflash.raw'>/path/to/guest_VARS.raw</nvram> + <boot dev='hd'/> + </os> + <features> + <acpi/> + <gic version='2'/> + </features> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>cortex-a15</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2'/> + <source file='/var/lib/libvirt/images/guest.qcow2'/> + <target dev='vda' bus='virtio'/> + <address type='virtio-mmio'/> + </disk> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='virtio-serial' index='0'> + <address type='virtio-mmio'/> + </controller> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='virtio'/> + <address type='virtio-mmio'/> + </interface> + <serial type='pty'> + <target type='system-serial' port='0'> + <model name='pl011'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <channel type='unix'> + <target type='virtio' name='org.qemu.guest_agent.0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='virtio-mmio'/> + </memballoon> + <rng model='virtio'> + <backend model='random'>/dev/urandom</backend> + <address type='virtio-mmio'/> + </rng> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/riscv64-virt-headless-mmio.riscv64-latest.xml b/tests/qemuxml2xmloutdata/riscv64-virt-headless-mmio.riscv64-latest.xml new file mode 100644 index 0000000000..445029e82b --- /dev/null +++ b/tests/qemuxml2xmloutdata/riscv64-virt-headless-mmio.riscv64-latest.xml @@ -0,0 +1,58 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <metadata> + <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> + <libosinfo:os id="http://fedoraproject.org/fedora/29"/> + </libosinfo:libosinfo> + </metadata> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2'/> + <source file='/var/lib/libvirt/images/guest.qcow2'/> + <target dev='vda' bus='virtio'/> + <address type='virtio-mmio'/> + </disk> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='virtio-serial' index='0'> + <address type='virtio-mmio'/> + </controller> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='virtio'/> + <address type='virtio-mmio'/> + </interface> + <serial type='pty'> + <target type='system-serial' port='0'> + <model name='16550a'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <channel type='unix'> + <target type='virtio' name='org.qemu.guest_agent.0'/> + <address type='virtio-serial' controller='0' bus='0' port='1'/> + </channel> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='virtio-mmio'/> + </memballoon> + <rng model='virtio'> + <backend model='random'>/dev/urandom</backend> + <address type='virtio-mmio'/> + </rng> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index dff0241c53..c21e34b477 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -913,8 +913,10 @@ mymain(void) /* Simple headless guests for various architectures */ DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-headless", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-headless-mmio", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("ppc64-pseries-headless", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-headless", "riscv64"); + DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-headless-mmio", "riscv64"); DO_TEST_CAPS_ARCH_LATEST("s390x-ccw-headless", "s390x"); DO_TEST_CAPS_ARCH_LATEST("x86_64-pc-headless", "x86_64"); DO_TEST_CAPS_ARCH_LATEST("x86_64-q35-headless", "x86_64"); -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:38 +0100, Andrea Bolognani wrote:
Even though virtio-mmio is no longer the default on either architecture, and likely nobody is using it at this point, we still provide a way to opt into virtio-mmio usage and want to keep existing guests working. Add explicit test suite coverage for this scenario.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...h64-virt-headless-mmio.aarch64-latest.args | 48 +++++++++++++ .../aarch64-virt-headless-mmio.xml | 48 +++++++++++++ ...v64-virt-headless-mmio.riscv64-latest.args | 43 +++++++++++ .../riscv64-virt-headless-mmio.xml | 43 +++++++++++ tests/qemuxml2argvtest.c | 2 + ...ch64-virt-headless-mmio.aarch64-latest.xml | 71 +++++++++++++++++++ ...cv64-virt-headless-mmio.riscv64-latest.xml | 58 +++++++++++++++ tests/qemuxml2xmltest.c | 2 + 8 files changed, 315 insertions(+) create mode 100644 tests/qemuxml2argvdata/aarch64-virt-headless-mmio.aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/aarch64-virt-headless-mmio.xml create mode 100644 tests/qemuxml2argvdata/riscv64-virt-headless-mmio.riscv64-latest.args create mode 100644 tests/qemuxml2argvdata/riscv64-virt-headless-mmio.xml create mode 100644 tests/qemuxml2xmloutdata/aarch64-virt-headless-mmio.aarch64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/riscv64-virt-headless-mmio.riscv64-latest.xml
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

All of these are either a subset of other tests, or provide coverage for scenarios that are not really possible: for all versions of QEMU that we support, the virt machine type has a hard dependency on the generic PCIe controller, which means that we will never need to fall back to virtio-mmio. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...ch64-aavmf-virtio-mmio.aarch64-latest.args | 46 --------------- .../aarch64-aavmf-virtio-mmio.xml | 49 ---------------- ...rch64-virt-virtio-MMIO.aarch64.latest.args | 48 ---------------- .../arm-virt-virtio.aarch64-latest.args | 54 ------------------ tests/qemuxml2argvdata/arm-virt-virtio.xml | 45 --------------- .../riscv64-virt-pci.riscv64-latest.args | 35 ------------ tests/qemuxml2argvdata/riscv64-virt-pci.xml | 24 -------- .../riscv64-virt.riscv64-latest.args | 38 ------------- tests/qemuxml2argvdata/riscv64-virt.xml | 19 ------- tests/qemuxml2argvtest.c | 18 ------ ...rch64-aavmf-virtio-mmio.aarch64-latest.xml | 56 ------------------- tests/qemuxml2xmltest.c | 4 -- 12 files changed, 436 deletions(-) delete mode 100644 tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.aarch64-latest.args delete mode 100644 tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.xml delete mode 100644 tests/qemuxml2argvdata/aarch64-virt-virtio-MMIO.aarch64.latest.args delete mode 100644 tests/qemuxml2argvdata/arm-virt-virtio.aarch64-latest.args delete mode 100644 tests/qemuxml2argvdata/arm-virt-virtio.xml delete mode 100644 tests/qemuxml2argvdata/riscv64-virt-pci.riscv64-latest.args delete mode 100644 tests/qemuxml2argvdata/riscv64-virt-pci.xml delete mode 100644 tests/qemuxml2argvdata/riscv64-virt.riscv64-latest.args delete mode 100644 tests/qemuxml2argvdata/riscv64-virt.xml delete mode 100644 tests/qemuxml2xmloutdata/aarch64-aavmf-virtio-mmio.aarch64-latest.xml diff --git a/tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.aarch64-latest.args deleted file mode 100644 index 5569ff3b57..0000000000 --- a/tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.aarch64-latest.args +++ /dev/null @@ -1,46 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \ --accel tcg \ --cpu cortex-a53 \ --m size=1048576k \ --object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \ --overcommit mem-lock=off \ --smp 1,sockets=1,cores=1,threads=1 \ --uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --boot strict=on \ --kernel /aarch64.kernel \ --initrd /aarch64.initrd \ --append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \ --dtb /aarch64.dtb \ --device '{"driver":"virtio-serial-device","id":"virtio-serial0"}' \ --blockdev '{"driver":"file","filename":"/aarch64.raw","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ --blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ --device '{"driver":"virtio-blk-device","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \ --netdev '{"type":"user","id":"hostnet0"}' \ --device '{"driver":"virtio-net-device","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37"}' \ --chardev pty,id=charconsole0 \ --device '{"driver":"virtconsole","chardev":"charconsole0","id":"console0"}' \ --audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-balloon-device","id":"balloon0"}' \ --object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/random"}' \ --device '{"driver":"virtio-rng-device","rng":"objrng0","id":"rng0"}' \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.xml b/tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.xml deleted file mode 100644 index 5d7217307b..0000000000 --- a/tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.xml +++ /dev/null @@ -1,49 +0,0 @@ -<domain type='qemu'> - <name>aarch64test</name> - <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='virt'>hvm</type> - <kernel>/aarch64.kernel</kernel> - <initrd>/aarch64.initrd</initrd> - <cmdline>earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait</cmdline> - <dtb>/aarch64.dtb</dtb> - <boot dev='hd'/> - </os> - <features> - <apic/> - <pae/> - <gic version='2'/> - </features> - <cpu mode='custom' match='exact'> - <model fallback='allow'>cortex-a53</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <disk type='file' device='disk'> - <source file='/aarch64.raw'/> - <target dev='vda' bus='virtio'/> - <address type='virtio-mmio'/> - </disk> - <controller type='virtio-serial' index='0'/> - <interface type='user'> - <mac address='52:54:00:09:a4:37'/> - <model type='virtio'/> - </interface> - <console type='pty'> - <target type='virtio' port='0'/> - </console> - <memballoon model='virtio'> - <address type='virtio-mmio'/> - </memballoon> - <rng model='virtio'> - <backend model='random'>/dev/random</backend> - </rng> - </devices> -</domain> diff --git a/tests/qemuxml2argvdata/aarch64-virt-virtio-MMIO.aarch64.latest.args b/tests/qemuxml2argvdata/aarch64-virt-virtio-MMIO.aarch64.latest.args deleted file mode 100644 index 68eccb441d..0000000000 --- a/tests/qemuxml2argvdata/aarch64-virt-virtio-MMIO.aarch64.latest.args +++ /dev/null @@ -1,48 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=aarch64test,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \ --machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \ --accel tcg \ --cpu cortex-a53 \ --m size=1048576k \ --object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \ --overcommit mem-lock=off \ --smp 1,sockets=1,cores=1,threads=1 \ --uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --boot strict=on \ --kernel /aarch64.kernel \ --initrd /aarch64.initrd \ --append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \ --dtb /aarch64.dtb \ --device '{"driver":"virtio-serial-device","id":"virtio-serial0"}' \ --blockdev '{"driver":"file","filename":"/aarch64.raw","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ --blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ --device '{"driver":"virtio-blk-device","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \ --netdev '{"type":"user","id":"hostnet0"}' \ --device '{"driver":"virtio-net-device","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37"}' \ --chardev pty,id=charserial0 \ --serial chardev:charserial0 \ --chardev pty,id=charconsole1 \ --device '{"driver":"virtconsole","chardev":"charconsole1","id":"console1"}' \ --audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-balloon-device","id":"balloon0"}' \ --object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/random"}' \ --device '{"driver":"virtio-rng-device","rng":"objrng0","id":"rng0"}' \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxml2argvdata/arm-virt-virtio.aarch64-latest.args b/tests/qemuxml2argvdata/arm-virt-virtio.aarch64-latest.args deleted file mode 100644 index b2266bc9bc..0000000000 --- a/tests/qemuxml2argvdata/arm-virt-virtio.aarch64-latest.args +++ /dev/null @@ -1,54 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-armtest \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-armtest/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-armtest/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armtest/.config \ -/usr/bin/qemu-system-aarch64 \ --name guest=armtest,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-armtest/master-key.aes"}' \ --machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=on \ --accel tcg \ --cpu cortex-a15 \ --m size=1048576k \ --object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \ --overcommit mem-lock=off \ --smp 1,sockets=1,cores=1,threads=1 \ --uuid 496d7ea8-9739-544b-4ebd-ef08be936e6a \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --boot strict=on \ --kernel /arm.kernel \ --initrd /arm.initrd \ --append 'console=ttyAMA0,115200n8 rw root=/dev/vda rootwait physmap.enabled=0' \ --dtb /arm.dtb \ --device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ --device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ --device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x2"}' \ --device '{"driver":"pcie-root-port","port":11,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x3"}' \ --device '{"driver":"pcie-root-port","port":12,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x4"}' \ --device '{"driver":"pcie-root-port","port":13,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x1.0x5"}' \ --device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.2","addr":"0x0"}' \ --blockdev '{"driver":"file","filename":"/arm.raw","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ --blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ --device '{"driver":"virtio-blk-pci","bus":"pci.3","addr":"0x0","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \ --netdev '{"type":"user","id":"hostnet0"}' \ --device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ --chardev pty,id=charserial0 \ --serial chardev:charserial0 \ --chardev pty,id=charconsole1 \ --device '{"driver":"virtconsole","chardev":"charconsole1","id":"console1"}' \ --audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.4","addr":"0x0"}' \ --object '{"qom-type":"rng-random","id":"objrng0","filename":"/dev/random"}' \ --device '{"driver":"virtio-rng-pci","rng":"objrng0","id":"rng0","bus":"pci.5","addr":"0x0"}' \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxml2argvdata/arm-virt-virtio.xml b/tests/qemuxml2argvdata/arm-virt-virtio.xml deleted file mode 100644 index 39620070bd..0000000000 --- a/tests/qemuxml2argvdata/arm-virt-virtio.xml +++ /dev/null @@ -1,45 +0,0 @@ -<domain type="qemu"> - <name>armtest</name> - <uuid>496d7ea8-9739-544b-4ebd-ef08be936e6a</uuid> - <memory>1048576</memory> - <currentMemory>1048576</currentMemory> - <vcpu>1</vcpu> - <os> - <type arch="armv7l" machine="virt">hvm</type> - <kernel>/arm.kernel</kernel> - <initrd>/arm.initrd</initrd> - <dtb>/arm.dtb</dtb> - <cmdline>console=ttyAMA0,115200n8 rw root=/dev/vda rootwait physmap.enabled=0</cmdline> - </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> - <clock offset="utc"/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <disk type='file' device='disk'> - <source file='/arm.raw'/> - <target dev='vda' bus='virtio'/> - </disk> - <interface type='user'> - <mac address='52:54:00:09:a4:37'/> - <model type='virtio'/> - </interface> - <console type='pty'/> - <console type='pty'> - <target type='virtio' port='0'/> - </console> - <memballoon model='virtio'/> - <!-- - This actually doesn't work in practice because vexpress only has - 4 virtio slots available, rng makes 5 --> - <rng model='virtio'> - <backend model='random'>/dev/random</backend> - </rng> - </devices> -</domain> diff --git a/tests/qemuxml2argvdata/riscv64-virt-pci.riscv64-latest.args b/tests/qemuxml2argvdata/riscv64-virt-pci.riscv64-latest.args deleted file mode 100644 index ff52cba889..0000000000 --- a/tests/qemuxml2argvdata/riscv64-virt-pci.riscv64-latest.args +++ /dev/null @@ -1,35 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-riscv64 \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-riscv64/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-riscv64/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-riscv64/.config \ -/usr/bin/qemu-system-riscv64 \ --name guest=riscv64,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-riscv64/master-key.aes"}' \ --machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram \ --accel tcg \ --m size=2097152k \ --object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":2147483648}' \ --overcommit mem-lock=off \ --smp 1,sockets=1,cores=1,threads=1 \ --uuid fd65fc03-8838-4c4d-9d8d-395802488790 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --boot strict=on \ --kernel /var/lib/libvirt/images/riscv64.bbl \ --append root=/dev/vda \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/riscv64.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ --blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \ --device '{"driver":"virtio-blk-pci","bus":"pcie.0","addr":"0x1","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \ --audiodev '{"id":"audio1","driver":"none"}' \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxml2argvdata/riscv64-virt-pci.xml b/tests/qemuxml2argvdata/riscv64-virt-pci.xml deleted file mode 100644 index c72cd58086..0000000000 --- a/tests/qemuxml2argvdata/riscv64-virt-pci.xml +++ /dev/null @@ -1,24 +0,0 @@ -<domain type='qemu'> - <name>riscv64</name> - <uuid>fd65fc03-8838-4c4d-9d8d-395802488790</uuid> - <memory unit='KiB'>2097152</memory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='riscv64' machine='virt'>hvm</type> - <kernel>/var/lib/libvirt/images/riscv64.bbl</kernel> - <cmdline>root=/dev/vda</cmdline> - </os> - <devices> - <emulator>/usr/bin/qemu-system-riscv64</emulator> - <disk type='file'> - <driver name='qemu' type='qcow2'/> - <source file='/var/lib/libvirt/images/riscv64.qcow2'/> - <target dev='vda' bus='virtio'/> - <!-- We need to manually pick an address on pcie.0 because otherwise - libvirt would try to add pcie-root-ports, and QEMU doesn't support - PCIe controllers for RISC-V guests yet --> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </disk> - <memballoon model='none'/> - </devices> -</domain> diff --git a/tests/qemuxml2argvdata/riscv64-virt.riscv64-latest.args b/tests/qemuxml2argvdata/riscv64-virt.riscv64-latest.args deleted file mode 100644 index b3a34272fe..0000000000 --- a/tests/qemuxml2argvdata/riscv64-virt.riscv64-latest.args +++ /dev/null @@ -1,38 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/var/lib/libvirt/qemu/domain--1-riscv64 \ -USER=test \ -LOGNAME=test \ -XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-riscv64/.local/share \ -XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-riscv64/.cache \ -XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-riscv64/.config \ -/usr/bin/qemu-system-riscv64 \ --name guest=riscv64,debug-threads=on \ --S \ --object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-riscv64/master-key.aes"}' \ --machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram \ --accel tcg \ --m size=2097152k \ --object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":2147483648}' \ --overcommit mem-lock=off \ --smp 1,sockets=1,cores=1,threads=1 \ --uuid fd65fc03-8838-4c4d-9d8d-395802488790 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-shutdown \ --boot strict=on \ --kernel /var/lib/libvirt/images/bbl \ --append 'console=ttyS0 ro root=/dev/vda' \ --blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/stage4-disk.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ --blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ --device '{"driver":"virtio-blk-device","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1}' \ --chardev pty,id=charserial0 \ --serial chardev:charserial0 \ --audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-balloon-device","id":"balloon0"}' \ --sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ --msg timestamp=on diff --git a/tests/qemuxml2argvdata/riscv64-virt.xml b/tests/qemuxml2argvdata/riscv64-virt.xml deleted file mode 100644 index 3a672bdea5..0000000000 --- a/tests/qemuxml2argvdata/riscv64-virt.xml +++ /dev/null @@ -1,19 +0,0 @@ -<domain type='qemu'> - <name>riscv64</name> - <uuid>fd65fc03-8838-4c4d-9d8d-395802488790</uuid> - <memory unit='KiB'>2097152</memory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='riscv64' machine='virt'>hvm</type> - <kernel>/var/lib/libvirt/images/bbl</kernel> - <cmdline>console=ttyS0 ro root=/dev/vda</cmdline> - </os> - <devices> - <emulator>/usr/bin/qemu-system-riscv64</emulator> - <disk type='file'> - <source file='/var/lib/libvirt/images/stage4-disk.img'/> - <target dev='vda' bus='virtio'/> - </disk> - <serial type='pty'/> - </devices> -</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1bc3985aca..fd89dbe649 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2254,16 +2254,6 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("arm-vexpressa9-nodevs", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("arm-vexpressa9-basic", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("arm-vexpressa9-virtio", "aarch64"); - DO_TEST_CAPS_ARCH_LATEST("arm-virt-virtio", "aarch64"); - - /* test default config if pcie bus is not available */ - DO_TEST_FULL("aarch64-virt-virtio", "-MMIO.aarch64.latest", - ARG_CAPS_ARCH, "aarch64", - ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, - QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_LAST, ARG_END); DO_TEST_CAPS_ARCH_VER("aarch64-virt-virtio", "aarch64", "4.2.0"); DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-virtio", "aarch64"); @@ -2273,7 +2263,6 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("aarch64-virtio-pci-manual-addresses", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("aarch64-video-virtio-gpu-pci", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("aarch64-video-default", "aarch64"); - DO_TEST_CAPS_ARCH_LATEST("aarch64-aavmf-virtio-mmio", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-default-nic", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("aarch64-cpu-passthrough", "aarch64"); DO_TEST_GIC("aarch64-gic-none", "4.2.0", GIC_NONE); @@ -2526,13 +2515,6 @@ mymain(void) DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages"); DO_TEST_CAPS_LATEST_PARSE_ERROR("vhost-user-fs-readonly"); - /* The generic pcie bridge emulation device can be compiled out of qemu. */ - DO_TEST_CAPS_ARCH_LATEST_FULL("riscv64-virt", "riscv64", - ARG_QEMU_CAPS_DEL, - QEMU_CAPS_OBJECT_GPEX, - QEMU_CAPS_LAST); - DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-pci", "riscv64"); - DO_TEST_CAPS_LATEST("virtio-transitional"); DO_TEST_CAPS_LATEST("virtio-non-transitional"); DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-transitional-not-supported"); diff --git a/tests/qemuxml2xmloutdata/aarch64-aavmf-virtio-mmio.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-aavmf-virtio-mmio.aarch64-latest.xml deleted file mode 100644 index 634d8ee683..0000000000 --- a/tests/qemuxml2xmloutdata/aarch64-aavmf-virtio-mmio.aarch64-latest.xml +++ /dev/null @@ -1,56 +0,0 @@ -<domain type='qemu'> - <name>aarch64test</name> - <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid> - <memory unit='KiB'>1048576</memory> - <currentMemory unit='KiB'>1048576</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='aarch64' machine='virt'>hvm</type> - <kernel>/aarch64.kernel</kernel> - <initrd>/aarch64.initrd</initrd> - <cmdline>earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait</cmdline> - <dtb>/aarch64.dtb</dtb> - <boot dev='hd'/> - </os> - <features> - <apic/> - <pae/> - <gic version='2'/> - </features> - <cpu mode='custom' match='exact' check='none'> - <model fallback='allow'>cortex-a53</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-aarch64</emulator> - <disk type='file' device='disk'> - <driver name='qemu' type='raw'/> - <source file='/aarch64.raw'/> - <target dev='vda' bus='virtio'/> - <address type='virtio-mmio'/> - </disk> - <controller type='virtio-serial' index='0'> - <address type='virtio-mmio'/> - </controller> - <controller type='pci' index='0' model='pcie-root'/> - <interface type='user'> - <mac address='52:54:00:09:a4:37'/> - <model type='virtio'/> - <address type='virtio-mmio'/> - </interface> - <console type='pty'> - <target type='virtio' port='0'/> - </console> - <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='virtio-mmio'/> - </memballoon> - <rng model='virtio'> - <backend model='random'>/dev/random</backend> - <address type='virtio-mmio'/> - </rng> - </devices> -</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index c21e34b477..a443f1e87e 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -765,7 +765,6 @@ mymain(void) DO_TEST_CAPS_LATEST("smbios"); DO_TEST_CAPS_LATEST("smbios-type-fwcfg"); - DO_TEST_CAPS_ARCH_LATEST("aarch64-aavmf-virtio-mmio", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("aarch64-virtio-pci-manual-addresses", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("aarch64-video-virtio-gpu-pci", "aarch64"); DO_TEST_CAPS_ARCH_LATEST("aarch64-pci-serial", "aarch64"); @@ -903,9 +902,6 @@ mymain(void) DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages"); DO_TEST_CAPS_LATEST("vhost-user-fs-sock"); - DO_TEST_CAPS_ARCH_LATEST("riscv64-virt", "riscv64"); - DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-pci", "riscv64"); - DO_TEST_CAPS_LATEST("x86-kvm-32-on-64"); DO_TEST_CAPS_LATEST("virtio-transitional"); -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:39 +0100, Andrea Bolognani wrote:
All of these are either a subset of other tests, or provide coverage for scenarios that are not really possible: for all versions of QEMU that we support, the virt machine type has a hard dependency on the generic PCIe controller, which means that we will never need to fall back to virtio-mmio.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...ch64-aavmf-virtio-mmio.aarch64-latest.args | 46 --------------- .../aarch64-aavmf-virtio-mmio.xml | 49 ---------------- ...rch64-virt-virtio-MMIO.aarch64.latest.args | 48 ---------------- .../arm-virt-virtio.aarch64-latest.args | 54 ------------------ tests/qemuxml2argvdata/arm-virt-virtio.xml | 45 --------------- .../riscv64-virt-pci.riscv64-latest.args | 35 ------------ tests/qemuxml2argvdata/riscv64-virt-pci.xml | 24 -------- .../riscv64-virt.riscv64-latest.args | 38 ------------- tests/qemuxml2argvdata/riscv64-virt.xml | 19 ------- tests/qemuxml2argvtest.c | 18 ------ ...rch64-aavmf-virtio-mmio.aarch64-latest.xml | 56 ------------------- tests/qemuxml2xmltest.c | 4 -- 12 files changed, 436 deletions(-) delete mode 100644 tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.aarch64-latest.args delete mode 100644 tests/qemuxml2argvdata/aarch64-aavmf-virtio-mmio.xml delete mode 100644 tests/qemuxml2argvdata/aarch64-virt-virtio-MMIO.aarch64.latest.args delete mode 100644 tests/qemuxml2argvdata/arm-virt-virtio.aarch64-latest.args delete mode 100644 tests/qemuxml2argvdata/arm-virt-virtio.xml delete mode 100644 tests/qemuxml2argvdata/riscv64-virt-pci.riscv64-latest.args delete mode 100644 tests/qemuxml2argvdata/riscv64-virt-pci.xml delete mode 100644 tests/qemuxml2argvdata/riscv64-virt.riscv64-latest.args delete mode 100644 tests/qemuxml2argvdata/riscv64-virt.xml delete mode 100644 tests/qemuxml2xmloutdata/aarch64-aavmf-virtio-mmio.aarch64-latest.xml
- - /* test default config if pcie bus is not available */ - DO_TEST_FULL("aarch64-virt-virtio", "-MMIO.aarch64.latest", - ARG_CAPS_ARCH, "aarch64", - ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, - QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_LAST, ARG_END);
DO_TEST_CAPS_ARCH_VER("aarch64-virt-virtio", "aarch64", "4.2.0"); DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-virtio", "aarch64");
@@ -2526,13 +2515,6 @@ mymain(void) DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages"); DO_TEST_CAPS_LATEST_PARSE_ERROR("vhost-user-fs-readonly");
- /* The generic pcie bridge emulation device can be compiled out of qemu. */ - DO_TEST_CAPS_ARCH_LATEST_FULL("riscv64-virt", "riscv64", - ARG_QEMU_CAPS_DEL, - QEMU_CAPS_OBJECT_GPEX, - QEMU_CAPS_LAST);
I'm not sure about riscv64, but I'm fairly sure we do support non-virt arm machines and it seems that GPEX can be compiled out if you compile out that machine. Arguably that would be an insane configuration and might not be worth worrying about, but we had tests for it. Would it make sense to switch to a different machine type?

On Wed, Jan 17, 2024 at 01:18:55PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:54:39 +0100, Andrea Bolognani wrote:
All of these are either a subset of other tests, or provide coverage for scenarios that are not really possible: for all versions of QEMU that we support, the virt machine type has a hard dependency on the generic PCIe controller, which means that we will never need to fall back to virtio-mmio.
- /* test default config if pcie bus is not available */ - DO_TEST_FULL("aarch64-virt-virtio", "-MMIO.aarch64.latest", - ARG_CAPS_ARCH, "aarch64", - ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, - QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_LAST, ARG_END);
- /* The generic pcie bridge emulation device can be compiled out of qemu. */ - DO_TEST_CAPS_ARCH_LATEST_FULL("riscv64-virt", "riscv64", - ARG_QEMU_CAPS_DEL, - QEMU_CAPS_OBJECT_GPEX, - QEMU_CAPS_LAST);
I'm not sure about riscv64, but I'm fairly sure we do support non-virt arm machines and it seems that GPEX can be compiled out if you compile out that machine.
You're right in saying that it's possible to obtain a GPEX-less aarch64 QEMU binary by compiling out the virt machine type. However, the only way in which we actually use the capability outside of the test suite is to decide whether the virt machine is capable of PCI, for which the answer is always "yes". The remaining usages, in the test suite, are there to confirm that the virt machine type will fall back to virtio-mmio is PCI is not available. But that's no longer a scenario that can present itself, as demonstrated by the fact that we have to go way out of our way to trick libvirt into behaving that way, so why have coverage?
Arguably that would be an insane configuration and might not be worth worrying about, but we had tests for it. Would it make sense to switch to a different machine type?
The original tests were introduced at a time when we still supported versions of QEMU where the virt machine type wasn't PCI capable. They made sense at the time, but that's no longer the case today. With regards to other machine types, we already have some coverage showing how libvirt handles the absence of PCI support: specifically arm-vexpressa9-* and disk-arm-virtio-sd. That seems good enough to me. -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Jan 17, 2024 at 09:02:12 -0500, Andrea Bolognani wrote:
On Wed, Jan 17, 2024 at 01:18:55PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:54:39 +0100, Andrea Bolognani wrote:
All of these are either a subset of other tests, or provide coverage for scenarios that are not really possible: for all versions of QEMU that we support, the virt machine type has a hard dependency on the generic PCIe controller, which means that we will never need to fall back to virtio-mmio.
- /* test default config if pcie bus is not available */ - DO_TEST_FULL("aarch64-virt-virtio", "-MMIO.aarch64.latest", - ARG_CAPS_ARCH, "aarch64", - ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, - QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_LAST, ARG_END);
- /* The generic pcie bridge emulation device can be compiled out of qemu. */ - DO_TEST_CAPS_ARCH_LATEST_FULL("riscv64-virt", "riscv64", - ARG_QEMU_CAPS_DEL, - QEMU_CAPS_OBJECT_GPEX, - QEMU_CAPS_LAST);
I'm not sure about riscv64, but I'm fairly sure we do support non-virt arm machines and it seems that GPEX can be compiled out if you compile out that machine.
You're right in saying that it's possible to obtain a GPEX-less aarch64 QEMU binary by compiling out the virt machine type.
However, the only way in which we actually use the capability outside of the test suite is to decide whether the virt machine is capable of PCI, for which the answer is always "yes".
The remaining usages, in the test suite, are there to confirm that the virt machine type will fall back to virtio-mmio is PCI is not available. But that's no longer a scenario that can present itself, as demonstrated by the fact that we have to go way out of our way to trick libvirt into behaving that way, so why have coverage?
Arguably that would be an insane configuration and might not be worth worrying about, but we had tests for it. Would it make sense to switch to a different machine type?
The original tests were introduced at a time when we still supported versions of QEMU where the virt machine type wasn't PCI capable. They made sense at the time, but that's no longer the case today.
With regards to other machine types, we already have some coverage showing how libvirt handles the absence of PCI support: specifically arm-vexpressa9-* and disk-arm-virtio-sd. That seems good enough to me.
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Drop everything that's not directly related to the scenario being tested. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../balloon-mmio-deflate.aarch64-latest.args | 4 ---- tests/qemuxml2argvdata/balloon-mmio-deflate.xml | 13 ------------- 2 files changed, 17 deletions(-) diff --git a/tests/qemuxml2argvdata/balloon-mmio-deflate.aarch64-latest.args b/tests/qemuxml2argvdata/balloon-mmio-deflate.aarch64-latest.args index 376182a856..89089c9d6b 100644 --- a/tests/qemuxml2argvdata/balloon-mmio-deflate.aarch64-latest.args +++ b/tests/qemuxml2argvdata/balloon-mmio-deflate.aarch64-latest.args @@ -26,10 +26,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --kernel /aarch64.kernel \ --initrd /aarch64.initrd \ --append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \ --dtb /aarch64.dtb \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-device","id":"balloon0","deflate-on-oom":true}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxml2argvdata/balloon-mmio-deflate.xml b/tests/qemuxml2argvdata/balloon-mmio-deflate.xml index 49b7d2c605..a749bf31a2 100644 --- a/tests/qemuxml2argvdata/balloon-mmio-deflate.xml +++ b/tests/qemuxml2argvdata/balloon-mmio-deflate.xml @@ -2,26 +2,13 @@ <name>aarch64test</name> <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid> <memory>1048576</memory> - <currentMemory>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch="aarch64" machine="virt">hvm</type> - <kernel>/aarch64.kernel</kernel> - <initrd>/aarch64.initrd</initrd> - <dtb>/aarch64.dtb</dtb> - <cmdline>earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait</cmdline> </os> - <features> - <apic/> - <pae/> - </features> <cpu match='exact'> <model>cortex-a53</model> </cpu> - <clock offset="utc"/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> <memballoon model='virtio' autodeflate='on'/> -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:40 +0100, Andrea Bolognani wrote:
Drop everything that's not directly related to the scenario being tested.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../balloon-mmio-deflate.aarch64-latest.args | 4 ---- tests/qemuxml2argvdata/balloon-mmio-deflate.xml | 13 ------------- 2 files changed, 17 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

It's impossible to compile out PCI support on aarch64, so if we want to test virtio-balloon together with virtio-mmio we have to either request that explicitly or trick libvirt by masking capabilities. Do the former instead of the latter. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- tests/qemuxml2argvdata/balloon-mmio-deflate.xml | 4 +++- tests/qemuxml2argvtest.c | 8 +------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/qemuxml2argvdata/balloon-mmio-deflate.xml b/tests/qemuxml2argvdata/balloon-mmio-deflate.xml index a749bf31a2..cb4ad0d347 100644 --- a/tests/qemuxml2argvdata/balloon-mmio-deflate.xml +++ b/tests/qemuxml2argvdata/balloon-mmio-deflate.xml @@ -11,6 +11,8 @@ </cpu> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <memballoon model='virtio' autodeflate='on'/> + <memballoon model='virtio' autodeflate='on'> + <address type='virtio-mmio'/> + </memballoon> </devices> </domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index fd89dbe649..5b36a297e0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1719,13 +1719,7 @@ mymain(void) DO_TEST_CAPS_LATEST("balloon-device"); DO_TEST_CAPS_LATEST("balloon-device-deflate"); DO_TEST_CAPS_ARCH_LATEST("balloon-ccw-deflate", "s390x"); - DO_TEST_FULL("balloon-mmio-deflate", ".aarch64-latest", - ARG_CAPS_ARCH, "aarch64", - ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, - QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_LAST, ARG_END); + DO_TEST_CAPS_ARCH_LATEST("balloon-mmio-deflate", "aarch64"); DO_TEST_CAPS_LATEST("balloon-device-deflate-off"); DO_TEST_CAPS_LATEST("balloon-device-auto"); DO_TEST_CAPS_LATEST("balloon-device-period"); -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:41 +0100, Andrea Bolognani wrote:
It's impossible to compile out PCI support on aarch64, so if we want to test virtio-balloon together with virtio-mmio we have to either request that explicitly or trick libvirt by masking capabilities. Do the former instead of the latter.
While same idea about non-virt machines not mandating PCI applies, which would make the commit message misleading ...
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- tests/qemuxml2argvdata/balloon-mmio-deflate.xml | 4 +++- tests/qemuxml2argvtest.c | 8 +------- 2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/tests/qemuxml2argvdata/balloon-mmio-deflate.xml b/tests/qemuxml2argvdata/balloon-mmio-deflate.xml index a749bf31a2..cb4ad0d347 100644 --- a/tests/qemuxml2argvdata/balloon-mmio-deflate.xml +++ b/tests/qemuxml2argvdata/balloon-mmio-deflate.xml @@ -11,6 +11,8 @@ </cpu> <devices> <emulator>/usr/bin/qemu-system-aarch64</emulator> - <memballoon model='virtio' autodeflate='on'/> + <memballoon model='virtio' autodeflate='on'> + <address type='virtio-mmio'/> + </memballoon> </devices> </domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index fd89dbe649..5b36a297e0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1719,13 +1719,7 @@ mymain(void) DO_TEST_CAPS_LATEST("balloon-device"); DO_TEST_CAPS_LATEST("balloon-device-deflate"); DO_TEST_CAPS_ARCH_LATEST("balloon-ccw-deflate", "s390x"); - DO_TEST_FULL("balloon-mmio-deflate", ".aarch64-latest", - ARG_CAPS_ARCH, "aarch64", - ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, - QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_LAST, ARG_END); + DO_TEST_CAPS_ARCH_LATEST("balloon-mmio-deflate", "aarch64"); DO_TEST_CAPS_LATEST("balloon-device-deflate-off"); DO_TEST_CAPS_LATEST("balloon-device-auto"); DO_TEST_CAPS_LATEST("balloon-device-period");
... this bit makes sense. Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On Wed, Jan 17, 2024 at 01:22:28PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:54:41 +0100, Andrea Bolognani wrote:
It's impossible to compile out PCI support on aarch64, so if we want to test virtio-balloon together with virtio-mmio we have to either request that explicitly or trick libvirt by masking capabilities. Do the former instead of the latter.
While same idea about non-virt machines not mandating PCI applies, which would make the commit message misleading ...
You're right, it is. If I changed it to For all supported QEMU version, the virt machine type has a hard dependency on PCI support, so if we want... would that work for you? -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Jan 17, 2024 at 09:04:56 -0500, Andrea Bolognani wrote:
On Wed, Jan 17, 2024 at 01:22:28PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:54:41 +0100, Andrea Bolognani wrote:
It's impossible to compile out PCI support on aarch64, so if we want to test virtio-balloon together with virtio-mmio we have to either request that explicitly or trick libvirt by masking capabilities. Do the former instead of the latter.
While same idea about non-virt machines not mandating PCI applies, which would make the commit message misleading ...
You're right, it is. If I changed it to
For all supported QEMU version, the virt machine type has a hard dependency on PCI support, so if we want...
would that work for you?
Yup, that sounds good.

For all versions of QEMU that we support, this is guaranteed to be compiled in both on aarch64 and on riscv64, so we can stop checking whether the capability is present and just use the device unconditionally. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 12 +++++------- src/qemu/qemu_domain.h | 3 +-- src/qemu/qemu_domain_address.c | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e2a1bf2c13..7c87cd6453 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4168,7 +4168,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, addDefaultUSB = false; addDefaultMemballoon = false; if (qemuDomainIsARMVirt(def)) - addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX); + addPCIeRoot = true; break; case VIR_ARCH_PPC64: @@ -4195,7 +4195,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, case VIR_ARCH_RISCV64: addDefaultUSB = false; if (qemuDomainIsRISCVVirt(def)) - addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX); + addPCIeRoot = true; break; case VIR_ARCH_S390: @@ -9059,8 +9059,7 @@ qemuDomainNeedsFDC(const virDomainDef *def) bool -qemuDomainSupportsPCI(virDomainDef *def, - virQEMUCaps *qemuCaps) +qemuDomainSupportsPCI(virDomainDef *def) { if (def->os.arch != VIR_ARCH_ARMV6L && def->os.arch != VIR_ARCH_ARMV7L && @@ -9072,9 +9071,8 @@ qemuDomainSupportsPCI(virDomainDef *def, if (STREQ(def->os.machine, "versatilepb")) return true; - if ((qemuDomainIsARMVirt(def) || - qemuDomainIsRISCVVirt(def)) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX)) { + if (qemuDomainIsARMVirt(def) || + qemuDomainIsRISCVVirt(def)) { return true; } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index fa566dded6..b0f1587f58 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -834,8 +834,7 @@ bool qemuDomainHasPCIeRoot(const virDomainDef *def); bool qemuDomainHasBuiltinIDE(const virDomainDef *def); bool qemuDomainHasBuiltinESP(const virDomainDef *def); bool qemuDomainNeedsFDC(const virDomainDef *def); -bool qemuDomainSupportsPCI(virDomainDef *def, - virQEMUCaps *qemuCaps); +bool qemuDomainSupportsPCI(virDomainDef *def); void qemuDomainUpdateCurrentMemorySize(virDomainObj *vm); diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 099778b2a8..888ae70d95 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2843,7 +2843,7 @@ qemuDomainAssignPCIAddresses(virDomainDef *def, if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false))) goto cleanup; - if (qemuDomainSupportsPCI(def, qemuCaps)) { + if (qemuDomainSupportsPCI(def)) { if (qemuDomainValidateDevicePCISlotsChipsets(def, addrs) < 0) goto cleanup; -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:42 +0100, Andrea Bolognani wrote:
For all versions of QEMU that we support, this is guaranteed to be compiled in both on aarch64 and on riscv64, so we can stop checking whether the capability is present and just use the device unconditionally.
AFAIK this is not true as there's still a Kconfig option for it and the corresponding meson files still check for it.

On Wed, Jan 17, 2024 at 12:48:39PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:54:42 +0100, Andrea Bolognani wrote:
For all versions of QEMU that we support, this is guaranteed to be compiled in both on aarch64 and on riscv64, so we can stop checking whether the capability is present and just use the device unconditionally.
AFAIK this is not true as there's still a Kconfig option for it and the corresponding meson files still check for it.
Right. Just like the commit message for 8/18, this should be made more accurate. I suggest For all versions of QEMU that we support, the virt machine type has a hard dependency on this device, so we can stop checking whether the capability is present and just use it unconditionally. Sounds good? -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Jan 17, 2024 at 10:41:40 -0500, Andrea Bolognani wrote:
On Wed, Jan 17, 2024 at 12:48:39PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:54:42 +0100, Andrea Bolognani wrote:
For all versions of QEMU that we support, this is guaranteed to be compiled in both on aarch64 and on riscv64, so we can stop checking whether the capability is present and just use the device unconditionally.
AFAIK this is not true as there's still a Kconfig option for it and the corresponding meson files still check for it.
Right. Just like the commit message for 8/18, this should be made more accurate. I suggest
For all versions of QEMU that we support, the virt machine type has a hard dependency on this device, so we can stop checking whether the capability is present and just use it unconditionally.
Sounds good?
Yup, this sounds good.

On Wed, Jan 17, 2024 at 10:54:42 +0100, Andrea Bolognani wrote:
For all versions of QEMU that we support, this is guaranteed to be compiled in both on aarch64 and on riscv64, so we can stop checking whether the capability is present and just use the device unconditionally.
It's guaranteed for the 'virt' machine ...
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 12 +++++------- src/qemu/qemu_domain.h | 3 +-- src/qemu/qemu_domain_address.c | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e2a1bf2c13..7c87cd6453 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4168,7 +4168,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, addDefaultUSB = false; addDefaultMemballoon = false; if (qemuDomainIsARMVirt(def)) - addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX); + addPCIeRoot = true; break;
case VIR_ARCH_PPC64: @@ -4195,7 +4195,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, case VIR_ARCH_RISCV64: addDefaultUSB = false; if (qemuDomainIsRISCVVirt(def)) - addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX); + addPCIeRoot = true;
So these actually make sense.
break;
As long as you clarify the commit message: Reviewed-by: Peter Krempa <pkrempa@redhat.com>

It's no longer used anywhere. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_capabilities.c | 3 +-- src/qemu/qemu_capabilities.h | 2 +- tests/qemucapabilitiesdata/caps_4.2.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_5.0.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_5.0.0_riscv64.xml | 1 - tests/qemucapabilitiesdata/caps_5.2.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_5.2.0_riscv64.xml | 1 - tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_6.0.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_6.2.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_7.0.0_aarch64+hvf.xml | 1 - tests/qemucapabilitiesdata/caps_7.0.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml | 1 - tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml | 1 - tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml | 1 - tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 1 - 25 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a4d42b40ed..dc192b3729 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -332,7 +332,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "migration-event", /* X_QEMU_CAPS_MIGRATION_EVENT */ /* 190 */ - "gpex-pcihost", /* QEMU_CAPS_OBJECT_GPEX */ + "gpex-pcihost", /* X_QEMU_CAPS_OBJECT_GPEX */ "ioh3420", /* QEMU_CAPS_DEVICE_IOH3420 */ "x3130-upstream", /* QEMU_CAPS_DEVICE_X3130_UPSTREAM */ "xio3130-downstream", /* QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM */ @@ -1275,7 +1275,6 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "usb-audio", QEMU_CAPS_OBJECT_USB_AUDIO }, { "pc-dimm", QEMU_CAPS_DEVICE_PC_DIMM }, { "pci-serial", QEMU_CAPS_DEVICE_PCI_SERIAL }, - { "gpex-pcihost", QEMU_CAPS_OBJECT_GPEX}, { "ioh3420", QEMU_CAPS_DEVICE_IOH3420 }, { "x3130-upstream", QEMU_CAPS_DEVICE_X3130_UPSTREAM }, { "xio3130-downstream", QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index a353750670..038ab0a4df 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -310,7 +310,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ X_QEMU_CAPS_MIGRATION_EVENT, /* MIGRATION event */ /* 190 */ - QEMU_CAPS_OBJECT_GPEX, /* have generic PCI host controller */ + X_QEMU_CAPS_OBJECT_GPEX, /* have generic PCI host controller */ QEMU_CAPS_DEVICE_IOH3420, /* -device ioh3420 */ QEMU_CAPS_DEVICE_X3130_UPSTREAM, /* -device x3130-upstream */ QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM, /* -device xio3130-downstream */ diff --git a/tests/qemucapabilitiesdata/caps_4.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_4.2.0_aarch64.xml index 72e6b614cf..2e6ea51d02 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0_aarch64.xml @@ -45,7 +45,6 @@ <flag name='vmware-svga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_5.0.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_5.0.0_aarch64.xml index 9d90e25343..9d3b538119 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0_aarch64.xml @@ -47,7 +47,6 @@ <flag name='vmware-svga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_5.0.0_riscv64.xml b/tests/qemucapabilitiesdata/caps_5.0.0_riscv64.xml index a1393e843d..502a9cecac 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0_riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0_riscv64.xml @@ -48,7 +48,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_5.2.0_aarch64.xml index 46666a783f..5d3f58e887 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0_aarch64.xml @@ -46,7 +46,6 @@ <flag name='vmware-svga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0_riscv64.xml b/tests/qemucapabilitiesdata/caps_5.2.0_riscv64.xml index edd562898e..5ac98d8386 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0_riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0_riscv64.xml @@ -47,7 +47,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='vmware-svga.vgamem_mb'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml index 387fa3c8c2..99c0c2e06c 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0_x86_64.xml @@ -57,7 +57,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_6.0.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_6.0.0_aarch64.xml index 6b7c40fb54..a1712233c5 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0_aarch64.xml @@ -45,7 +45,6 @@ <flag name='vmware-svga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml index daf47aa4b5..294d6f3124 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0_x86_64.xml @@ -56,7 +56,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml index 28f3a94617..d32ebf0c3b 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0_x86_64.xml @@ -56,7 +56,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_6.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_6.2.0_aarch64.xml index 3a16a54ca7..7a12ed41c4 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0_aarch64.xml @@ -50,7 +50,6 @@ <flag name='vmware-svga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml index 3f021441ed..ca9a784c72 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml @@ -56,7 +56,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_7.0.0_aarch64+hvf.xml b/tests/qemucapabilitiesdata/caps_7.0.0_aarch64+hvf.xml index 45131f0b7f..bca905987a 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0_aarch64+hvf.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0_aarch64+hvf.xml @@ -49,7 +49,6 @@ <flag name='vmware-svga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_7.0.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_7.0.0_aarch64.xml index bbdd01b55a..9c61b92c1e 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0_aarch64.xml @@ -50,7 +50,6 @@ <flag name='vmware-svga.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml index 25d9725391..8caeba3773 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml @@ -56,7 +56,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml index 58e1111982..745776b14b 100644 --- a/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml @@ -56,7 +56,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml index a30ec3c164..4018213189 100644 --- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml +++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml @@ -55,7 +55,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml index 24ac7b8f6e..e43890fb68 100644 --- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml @@ -56,7 +56,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml b/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml index 3f2acb5018..8976045015 100644 --- a/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml @@ -41,7 +41,6 @@ <flag name='migrate-rdma'/> <flag name='VGA.vgamem_mb'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml index 85869f6b5d..3095b2fdab 100644 --- a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml @@ -56,7 +56,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml index 0caee53550..6375f428a0 100644 --- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml @@ -56,7 +56,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml index 54fd349365..97a9b5a0fa 100644 --- a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml @@ -45,7 +45,6 @@ <flag name='VGA.vgamem_mb'/> <flag name='pc-dimm'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml index 8a6527810a..0f59fe037a 100644 --- a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml @@ -56,7 +56,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml index b4c3b1bae3..07aca75480 100644 --- a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml @@ -56,7 +56,6 @@ <flag name='pc-dimm'/> <flag name='machine-vmport-opt'/> <flag name='pci-serial'/> - <flag name='gpex-pcihost'/> <flag name='ioh3420'/> <flag name='x3130-upstream'/> <flag name='xio3130-downstream'/> -- 2.43.0

The way the function is currently written sort of obscures this fact, but ultimately we already unconditionally assume PCI support on most architectures. Arm and RISC-V need some additional checks to maintain compatibility with existing configurations but for all future architectures, such as the upcoming LoongArch64, we expect PCI support to come out of the box. Last but not least, the functions is made const-correct. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 31 ++++++++++++++++++------------- src/qemu/qemu_domain.h | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 7c87cd6453..80281d9b48 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9059,24 +9059,29 @@ qemuDomainNeedsFDC(const virDomainDef *def) bool -qemuDomainSupportsPCI(virDomainDef *def) +qemuDomainSupportsPCI(const virDomainDef *def) { - if (def->os.arch != VIR_ARCH_ARMV6L && - def->os.arch != VIR_ARCH_ARMV7L && - def->os.arch != VIR_ARCH_AARCH64 && - !ARCH_IS_RISCV(def->os.arch)) { - return true; + /* On Arm architectures, only the virt and versatilepb + * machine types support PCI */ + if (ARCH_IS_ARM(def->os.arch)) { + if (qemuDomainIsARMVirt(def) || + STREQ(def->os.machine, "versatilepb")) { + return true; + } + return false; } - if (STREQ(def->os.machine, "versatilepb")) - return true; - - if (qemuDomainIsARMVirt(def) || - qemuDomainIsRISCVVirt(def)) { - return true; + /* On RISC-V, only the virt machine type supports PCI */ + if (ARCH_IS_RISCV(def->os.arch)) { + if (qemuDomainIsRISCVVirt(def)) { + return true; + } + return false; } - return false; + /* On all other architectures, PCI support is assumed to + * be present */ + return true; } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index b0f1587f58..49e0fcf498 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -834,7 +834,7 @@ bool qemuDomainHasPCIeRoot(const virDomainDef *def); bool qemuDomainHasBuiltinIDE(const virDomainDef *def); bool qemuDomainHasBuiltinESP(const virDomainDef *def); bool qemuDomainNeedsFDC(const virDomainDef *def); -bool qemuDomainSupportsPCI(virDomainDef *def); +bool qemuDomainSupportsPCI(const virDomainDef *def); void qemuDomainUpdateCurrentMemorySize(virDomainObj *vm); -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:44 +0100, Andrea Bolognani wrote:
The way the function is currently written sort of obscures this fact, but ultimately we already unconditionally assume PCI support on most architectures.
Arm and RISC-V need some additional checks to maintain compatibility with existing configurations but for all future architectures, such as the upcoming LoongArch64, we expect PCI support to come out of the box.
Last but not least, the functions is made const-correct.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 31 ++++++++++++++++++------------- src/qemu/qemu_domain.h | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

It belongs next to qemuDomainSupportsPCI(). Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_alias.c | 2 +- src/qemu/qemu_capabilities.c | 28 ---------------------------- src/qemu/qemu_capabilities.h | 2 -- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_domain.c | 29 +++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 1 + 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index e58c488f8a..686b5a4d80 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -142,7 +142,7 @@ qemuAssignDeviceControllerAlias(virDomainDef *domainDef, return; if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) { - if (!virQEMUCapsHasPCIMultiBus(domainDef)) { + if (!qemuDomainSupportsPCIMultibus(domainDef)) { /* qemus that don't support multiple PCI buses have * hardcoded the name of their single PCI controller as * "pci". diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index dc192b3729..98faf3f1d3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2059,34 +2059,6 @@ virQEMUCapsGet(virQEMUCaps *qemuCaps, } -bool virQEMUCapsHasPCIMultiBus(const virDomainDef *def) -{ - /* x86_64 and i686 support PCI-multibus on all machine types - * since forever */ - if (ARCH_IS_X86(def->os.arch)) - return true; - - /* PPC supports multibus on all machine types which have pci since qemu-2.0.0 */ - if (def->os.arch == VIR_ARCH_PPC || - ARCH_IS_PPC64(def->os.arch)) { - return true; - } - - /* S390 supports PCI-multibus. */ - if (ARCH_IS_S390(def->os.arch)) - return true; - - /* If the virt machine, both on ARM and RISC-V, supports PCI, - * then it also supports multibus */ - if (qemuDomainIsARMVirt(def) || - qemuDomainIsRISCVVirt(def)) { - return true; - } - - return false; -} - - const char *virQEMUCapsGetBinary(virQEMUCaps *qemuCaps) { return qemuCaps->binary; diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 038ab0a4df..4693e2f4de 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -701,8 +701,6 @@ bool virQEMUCapsGet(virQEMUCaps *qemuCaps, void virQEMUCapsInitProcessCapsInterlock(virQEMUCaps *qemuCaps); -bool virQEMUCapsHasPCIMultiBus(const virDomainDef *def); - bool virQEMUCapsSupportsVmport(virQEMUCaps *qemuCaps, const virDomainDef *def); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f2a4e1088b..dcc2e45cf4 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -386,7 +386,7 @@ qemuBuildDeviceAddressPCIGetBus(const virDomainDef *domainDef, * */ if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT && contTargetIndex <= 0) { - if (virQEMUCapsHasPCIMultiBus(domainDef)) + if (qemuDomainSupportsPCIMultibus(domainDef)) contAlias = "pci.0"; else contAlias = "pci"; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 80281d9b48..ef7506258a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9085,6 +9085,35 @@ qemuDomainSupportsPCI(const virDomainDef *def) } +bool +qemuDomainSupportsPCIMultibus(const virDomainDef *def) +{ + /* x86_64 and i686 support PCI-multibus on all machine types + * since forever */ + if (ARCH_IS_X86(def->os.arch)) + return true; + + /* PPC supports multibus on all machine types which have pci since qemu-2.0.0 */ + if (def->os.arch == VIR_ARCH_PPC || + ARCH_IS_PPC64(def->os.arch)) { + return true; + } + + /* S390 supports PCI-multibus. */ + if (ARCH_IS_S390(def->os.arch)) + return true; + + /* If the virt machine, both on ARM and RISC-V, supports PCI, + * then it also supports multibus */ + if (qemuDomainIsARMVirt(def) || + qemuDomainIsRISCVVirt(def)) { + return true; + } + + return false; +} + + static int qemuDomainDefValidateMemoryHotplugDevice(const virDomainMemoryDef *mem, const virDomainDef *def) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 49e0fcf498..b4512cc80e 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -835,6 +835,7 @@ bool qemuDomainHasBuiltinIDE(const virDomainDef *def); bool qemuDomainHasBuiltinESP(const virDomainDef *def); bool qemuDomainNeedsFDC(const virDomainDef *def); bool qemuDomainSupportsPCI(const virDomainDef *def); +bool qemuDomainSupportsPCIMultibus(const virDomainDef *def); void qemuDomainUpdateCurrentMemorySize(virDomainObj *vm); -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:45 +0100, Andrea Bolognani wrote:
It belongs next to qemuDomainSupportsPCI().
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_alias.c | 2 +- src/qemu/qemu_capabilities.c | 28 ---------------------------- src/qemu/qemu_capabilities.h | 2 -- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_domain.c | 29 +++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 1 + 6 files changed, 32 insertions(+), 32 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Rewrite the function so that it's more compact and easier to extend as new architectures, which will likely come with multibus support right out the gate, are introduced. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ef7506258a..de36641137 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9088,23 +9088,16 @@ qemuDomainSupportsPCI(const virDomainDef *def) bool qemuDomainSupportsPCIMultibus(const virDomainDef *def) { - /* x86_64 and i686 support PCI-multibus on all machine types - * since forever */ - if (ARCH_IS_X86(def->os.arch)) - return true; - - /* PPC supports multibus on all machine types which have pci since qemu-2.0.0 */ - if (def->os.arch == VIR_ARCH_PPC || - ARCH_IS_PPC64(def->os.arch)) { + /* Most architectures support multibus for all machine types on + * all supported QEMU versions */ + if (ARCH_IS_X86(def->os.arch) || + ARCH_IS_PPC(def->os.arch) || + ARCH_IS_S390(def->os.arch)) { return true; } - /* S390 supports PCI-multibus. */ - if (ARCH_IS_S390(def->os.arch)) - return true; - - /* If the virt machine, both on ARM and RISC-V, supports PCI, - * then it also supports multibus */ + /* In some cases, support for multibus is limited to some machine + * types */ if (qemuDomainIsARMVirt(def) || qemuDomainIsRISCVVirt(def)) { return true; -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:46 +0100, Andrea Bolognani wrote:
Rewrite the function so that it's more compact and easier to extend as new architectures, which will likely come with multibus support right out the gate, are introduced.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On a Wednesday in 2024, Andrea Bolognani wrote:
Rewrite the function so that it's more compact and easier to extend as new architectures, which will likely come with multibus support right out the gate, are introduced.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-)
For patches 1 to 13: Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

This verifies that, for each architecture, libvirt will pick a reasonable default model for network interface where the user hasn't provided the information themselves. Note that pSeries guests currently get rtl8139 network cards by default, which makes little sense for the architecture. We're going to improve the situation in an upcoming commit. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../aarch64-default-net.aarch64-latest.args | 35 +++++++++++++++ .../qemuxml2argvdata/aarch64-default-net.xml | 17 ++++++++ .../ppc64-default-net.ppc64-latest.args | 33 ++++++++++++++ tests/qemuxml2argvdata/ppc64-default-net.xml | 17 ++++++++ .../riscv64-default-net.riscv64-latest.args | 34 +++++++++++++++ .../qemuxml2argvdata/riscv64-default-net.xml | 17 ++++++++ .../s390x-default-net.s390x-latest.args | 33 ++++++++++++++ tests/qemuxml2argvdata/s390x-default-net.xml | 17 ++++++++ .../x86_64-default-net.x86_64-latest.args | 33 ++++++++++++++ tests/qemuxml2argvdata/x86_64-default-net.xml | 17 ++++++++ tests/qemuxml2argvtest.c | 6 +++ .../aarch64-default-net.aarch64-latest.xml | 43 +++++++++++++++++++ .../ppc64-default-net.ppc64-latest.xml | 34 +++++++++++++++ .../riscv64-default-net.riscv64-latest.xml | 37 ++++++++++++++++ .../s390x-default-net.s390x-latest.xml | 31 +++++++++++++ .../x86_64-default-net.x86_64-latest.xml | 32 ++++++++++++++ tests/qemuxml2xmltest.c | 7 +++ 17 files changed, 443 insertions(+) create mode 100644 tests/qemuxml2argvdata/aarch64-default-net.aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/aarch64-default-net.xml create mode 100644 tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/ppc64-default-net.xml create mode 100644 tests/qemuxml2argvdata/riscv64-default-net.riscv64-latest.args create mode 100644 tests/qemuxml2argvdata/riscv64-default-net.xml create mode 100644 tests/qemuxml2argvdata/s390x-default-net.s390x-latest.args create mode 100644 tests/qemuxml2argvdata/s390x-default-net.xml create mode 100644 tests/qemuxml2argvdata/x86_64-default-net.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/x86_64-default-net.xml create mode 100644 tests/qemuxml2xmloutdata/aarch64-default-net.aarch64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/riscv64-default-net.riscv64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/s390x-default-net.s390x-latest.xml create mode 100644 tests/qemuxml2xmloutdata/x86_64-default-net.x86_64-latest.xml diff --git a/tests/qemuxml2argvdata/aarch64-default-net.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-default-net.aarch64-latest.args new file mode 100644 index 0000000000..3df9155252 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-default-net.aarch64-latest.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-aarch64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \ +-accel tcg \ +-cpu cortex-a15 \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ +-netdev '{"type":"user","id":"hostnet0"}' \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/aarch64-default-net.xml b/tests/qemuxml2argvdata/aarch64-default-net.xml new file mode 100644 index 0000000000..12dbf47fb0 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-default-net.xml @@ -0,0 +1,17 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='usb' model='none'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + </interface> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args b/tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args new file mode 100644 index 0000000000..4180c247d4 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-ppc64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram \ +-accel tcg \ +-cpu POWER9 \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-netdev user,id=hostnet0 \ +-device '{"driver":"rtl8139","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x1"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/ppc64-default-net.xml b/tests/qemuxml2argvdata/ppc64-default-net.xml new file mode 100644 index 0000000000..208a5d48a3 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-net.xml @@ -0,0 +1,17 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='usb' model='none'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + </interface> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/riscv64-default-net.riscv64-latest.args b/tests/qemuxml2argvdata/riscv64-default-net.riscv64-latest.args new file mode 100644 index 0000000000..fb6d4b781f --- /dev/null +++ b/tests/qemuxml2argvdata/riscv64-default-net.riscv64-latest.args @@ -0,0 +1,34 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-riscv64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram \ +-accel tcg \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ +-netdev '{"type":"user","id":"hostnet0"}' \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/riscv64-default-net.xml b/tests/qemuxml2argvdata/riscv64-default-net.xml new file mode 100644 index 0000000000..8d1bd4807c --- /dev/null +++ b/tests/qemuxml2argvdata/riscv64-default-net.xml @@ -0,0 +1,17 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <controller type='usb' model='none'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + </interface> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/s390x-default-net.s390x-latest.args b/tests/qemuxml2argvdata/s390x-default-net.s390x-latest.args new file mode 100644 index 0000000000..1809a5a645 --- /dev/null +++ b/tests/qemuxml2argvdata/s390x-default-net.s390x-latest.args @@ -0,0 +1,33 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ +-accel tcg \ +-cpu qemu \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-netdev '{"type":"user","id":"hostnet0"}' \ +-device '{"driver":"virtio-net-ccw","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","devno":"fe.0.0000"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/s390x-default-net.xml b/tests/qemuxml2argvdata/s390x-default-net.xml new file mode 100644 index 0000000000..0ae2f2ede7 --- /dev/null +++ b/tests/qemuxml2argvdata/s390x-default-net.xml @@ -0,0 +1,17 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='usb' model='none'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + </interface> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/x86_64-default-net.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-default-net.x86_64-latest.args new file mode 100644 index 0000000000..7f9a558cf8 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-net.x86_64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-netdev '{"type":"user","id":"hostnet0"}' \ +-device '{"driver":"rtl8139","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/x86_64-default-net.xml b/tests/qemuxml2argvdata/x86_64-default-net.xml new file mode 100644 index 0000000000..2513f75a10 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-net.xml @@ -0,0 +1,17 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' model='none'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + </interface> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5b36a297e0..9bd228e4fa 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1531,6 +1531,12 @@ mymain(void) DO_TEST_CAPS_LATEST_PARSE_ERROR("vhost_queues-invalid"); + DO_TEST_CAPS_LATEST("x86_64-default-net"); + DO_TEST_CAPS_ARCH_LATEST("aarch64-default-net", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("riscv64-default-net", "riscv64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-net", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("s390x-default-net", "s390x"); + DO_TEST_CAPS_LATEST("net-vhostuser"); DO_TEST_CAPS_LATEST("net-vhostuser-multiq"); DO_TEST_CAPS_LATEST_FAILURE("net-vhostuser-fail"); diff --git a/tests/qemuxml2xmloutdata/aarch64-default-net.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-default-net.aarch64-latest.xml new file mode 100644 index 0000000000..c67277a181 --- /dev/null +++ b/tests/qemuxml2xmloutdata/aarch64-default-net.aarch64-latest.xml @@ -0,0 +1,43 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic version='2'/> + </features> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>cortex-a15</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='usb' index='0' model='none'/> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </interface> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml new file mode 100644 index 0000000000..fa83b6e290 --- /dev/null +++ b/tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml @@ -0,0 +1,34 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER9</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='usb' index='0' model='none'/> + <controller type='pci' index='0' model='pci-root'> + <model name='spapr-pci-host-bridge'/> + <target index='0'/> + </controller> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='rtl8139'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </interface> + <audio id='1' type='none'/> + <memballoon model='none'/> + <panic model='pseries'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/riscv64-default-net.riscv64-latest.xml b/tests/qemuxml2xmloutdata/riscv64-default-net.riscv64-latest.xml new file mode 100644 index 0000000000..b8c881722c --- /dev/null +++ b/tests/qemuxml2xmloutdata/riscv64-default-net.riscv64-latest.xml @@ -0,0 +1,37 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <controller type='usb' index='0' model='none'/> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='virtio'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </interface> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/s390x-default-net.s390x-latest.xml b/tests/qemuxml2xmloutdata/s390x-default-net.s390x-latest.xml new file mode 100644 index 0000000000..fd60d0bbf3 --- /dev/null +++ b/tests/qemuxml2xmloutdata/s390x-default-net.s390x-latest.xml @@ -0,0 +1,31 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='usb' index='0' model='none'/> + <controller type='pci' index='0' model='pci-root'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='virtio'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </interface> + <audio id='1' type='none'/> + <memballoon model='none'/> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/x86_64-default-net.x86_64-latest.xml b/tests/qemuxml2xmloutdata/x86_64-default-net.x86_64-latest.xml new file mode 100644 index 0000000000..9d393f7aa9 --- /dev/null +++ b/tests/qemuxml2xmloutdata/x86_64-default-net.x86_64-latest.xml @@ -0,0 +1,32 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='none'/> + <controller type='pci' index='0' model='pci-root'/> + <interface type='user'> + <mac address='52:54:00:09:a4:37'/> + <model type='rtl8139'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </interface> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index a443f1e87e..5a635444f8 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -376,6 +376,13 @@ mymain(void) DO_TEST_CAPS_LATEST("misc-enable-s4"); DO_TEST_CAPS_LATEST("misc-no-reboot"); DO_TEST_CAPS_LATEST("misc-uuid"); + + DO_TEST_CAPS_LATEST("x86_64-default-net"); + DO_TEST_CAPS_ARCH_LATEST("aarch64-default-net", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("riscv64-default-net", "riscv64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-net", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("s390x-default-net", "s390x"); + DO_TEST_CAPS_LATEST("net-vhostuser"); DO_TEST_CAPS_LATEST("net-user"); DO_TEST_CAPS_LATEST("net-user-addr"); -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:47 +0100, Andrea Bolognani wrote:
This verifies that, for each architecture, libvirt will pick a reasonable default model for network interface where the user hasn't provided the information themselves.
Note that pSeries guests currently get rtl8139 network cards by default, which makes little sense for the architecture. We're going to improve the situation in an upcoming commit.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Outside of x86, where we need to try pretty hard to pick hardware that obsolete operating systems might be able to use, and Arm, where some of the less virtualization-friendly machine types have their own specific default, the sensible choice is virtio-net. This is even more true for any architecture that's going to be introduced in the future, as recent experience has shown that they will be developed with virtualization in mind and use virtio as extensively as possible. Note that the default for ppc64 is changed as part of this. That's technically a breaking change, but it should be safe to apply since * it doesn't affect existing guests; * virt-manager already prefers virtio-net anyway. rtl8139 was a pretty bad default for the architecture in the first place, which was only applied accidentally due to its existing status as default for x86. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 12 ++++-------- .../ppc64-default-net.ppc64-latest.args | 2 +- .../ppc64-default-net.ppc64-latest.xml | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index de36641137..fac83e8bb7 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5392,12 +5392,7 @@ static int qemuDomainDefaultNetModel(const virDomainDef *def, virQEMUCaps *qemuCaps) { - if (ARCH_IS_S390(def->os.arch)) - return VIR_DOMAIN_NET_MODEL_VIRTIO; - - if (def->os.arch == VIR_ARCH_ARMV6L || - def->os.arch == VIR_ARCH_ARMV7L || - def->os.arch == VIR_ARCH_AARCH64) { + if (ARCH_IS_ARM(def->os.arch)) { if (STREQ(def->os.machine, "versatilepb")) return VIR_DOMAIN_NET_MODEL_SMC91C111; @@ -5409,8 +5404,9 @@ qemuDomainDefaultNetModel(const virDomainDef *def, return VIR_DOMAIN_NET_MODEL_LAN9118; } - /* virtio is a sensible default for RISC-V virt guests */ - if (qemuDomainIsRISCVVirt(def)) + /* For all remaining non-x86 architectures, virtio-net is a good + * default */ + if (!ARCH_IS_X86(def->os.arch)) return VIR_DOMAIN_NET_MODEL_VIRTIO; /* In all other cases the model depends on the capabilities. If they were diff --git a/tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args b/tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args index 4180c247d4..d1716817fb 100644 --- a/tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args +++ b/tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ -no-shutdown \ -boot strict=on \ -netdev user,id=hostnet0 \ --device '{"driver":"rtl8139","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x1"}' \ +-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml index fa83b6e290..8b59dcaafd 100644 --- a/tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml +++ b/tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml @@ -24,7 +24,7 @@ </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> - <model type='rtl8139'/> + <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </interface> <audio id='1' type='none'/> -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:48 +0100, Andrea Bolognani wrote:
Outside of x86, where we need to try pretty hard to pick hardware that obsolete operating systems might be able to use, and Arm, where some of the less virtualization-friendly machine types have their own specific default, the sensible choice is virtio-net.
This is even more true for any architecture that's going to be introduced in the future, as recent experience has shown that they will be developed with virtualization in mind and use virtio as extensively as possible.
Note that the default for ppc64 is changed as part of this. That's technically a breaking change, but it should be safe to apply since
* it doesn't affect existing guests; * virt-manager already prefers virtio-net anyway.
rtl8139 was a pretty bad default for the architecture in the first place, which was only applied accidentally due to its existing status as default for x86.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> ---
IMO it would be better to split this patch into the refactor portion, which will explicitly keep ppc64 with the old default and then open the debate about changing the default as another patch. For the change itself, I understand why it would be beneficial but AFAIK we never did this before. At the very least the PPC maintainers should voice their opinion.

On Wed, Jan 17, 2024 at 01:59:57PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:54:48 +0100, Andrea Bolognani wrote:
Outside of x86, where we need to try pretty hard to pick hardware that obsolete operating systems might be able to use, and Arm, where some of the less virtualization-friendly machine types have their own specific default, the sensible choice is virtio-net.
This is even more true for any architecture that's going to be introduced in the future, as recent experience has shown that they will be developed with virtualization in mind and use virtio as extensively as possible.
Note that the default for ppc64 is changed as part of this. That's technically a breaking change, but it should be safe to apply since
* it doesn't affect existing guests; * virt-manager already prefers virtio-net anyway.
rtl8139 was a pretty bad default for the architecture in the first place, which was only applied accidentally due to its existing status as default for x86.
IMO it would be better to split this patch into the refactor portion, which will explicitly keep ppc64 with the old default and then open the debate about changing the default as another patch.
Yeah, that makes a lot of sense.
For the change itself, I understand why it would be beneficial but AFAIK we never did this before.
Well, we've made changes that have effectively modified architecture-specific defaults in the past, but checking back it was mostly to fix scenarios where things wouldn't work at all, and we also keyed those off capabilities. So you're right, this is unusual and something that we might ultimately decide not to do. I'd be okay with that. Though it's a shame to have bad defaults in libvirt, what matters is that higher-level tools are doing the right thing, and they already are.
At the very least the PPC maintainers should voice their opinion.
We have a PPC maintainer in libvirt? :) -- Andrea Bolognani / Red Hat / Virtualization

This provides coverage for the set of devices that libvirt will automatically add to any new guest. They can vary quite a lot depending on the architecture. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...arch64-default-devices.aarch64-latest.args | 31 +++++++++++++++++ .../aarch64-default-devices.xml | 12 +++++++ .../ppc64-default-devices.ppc64-latest.args | 33 +++++++++++++++++++ .../ppc64-default-devices.xml | 12 +++++++ ...iscv64-default-devices.riscv64-latest.args | 33 +++++++++++++++++++ .../riscv64-default-devices.xml | 12 +++++++ .../s390x-default-devices.s390x-latest.args | 32 ++++++++++++++++++ .../s390x-default-devices.xml | 12 +++++++ .../x86_64-default-devices.x86_64-latest.args | 33 +++++++++++++++++++ .../x86_64-default-devices.xml | 12 +++++++ tests/qemuxml2argvtest.c | 6 ++++ ...aarch64-default-devices.aarch64-latest.xml | 26 +++++++++++++++ .../ppc64-default-devices.ppc64-latest.xml | 33 +++++++++++++++++++ ...riscv64-default-devices.riscv64-latest.xml | 33 +++++++++++++++++++ .../s390x-default-devices.s390x-latest.xml | 27 +++++++++++++++ .../x86_64-default-devices.x86_64-latest.xml | 31 +++++++++++++++++ tests/qemuxml2xmltest.c | 6 ++++ 17 files changed, 384 insertions(+) create mode 100644 tests/qemuxml2argvdata/aarch64-default-devices.aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/aarch64-default-devices.xml create mode 100644 tests/qemuxml2argvdata/ppc64-default-devices.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/ppc64-default-devices.xml create mode 100644 tests/qemuxml2argvdata/riscv64-default-devices.riscv64-latest.args create mode 100644 tests/qemuxml2argvdata/riscv64-default-devices.xml create mode 100644 tests/qemuxml2argvdata/s390x-default-devices.s390x-latest.args create mode 100644 tests/qemuxml2argvdata/s390x-default-devices.xml create mode 100644 tests/qemuxml2argvdata/x86_64-default-devices.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/x86_64-default-devices.xml create mode 100644 tests/qemuxml2xmloutdata/aarch64-default-devices.aarch64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/ppc64-default-devices.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/riscv64-default-devices.riscv64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/s390x-default-devices.s390x-latest.xml create mode 100644 tests/qemuxml2xmloutdata/x86_64-default-devices.x86_64-latest.xml diff --git a/tests/qemuxml2argvdata/aarch64-default-devices.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-default-devices.aarch64-latest.args new file mode 100644 index 0000000000..51a196e03e --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-default-devices.aarch64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-aarch64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \ +-accel tcg \ +-cpu cortex-a15 \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/aarch64-default-devices.xml b/tests/qemuxml2argvdata/aarch64-default-devices.xml new file mode 100644 index 0000000000..5b44c14131 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-default-devices.xml @@ -0,0 +1,12 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/ppc64-default-devices.ppc64-latest.args b/tests/qemuxml2argvdata/ppc64-default-devices.ppc64-latest.args new file mode 100644 index 0000000000..69462a5b70 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-devices.ppc64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-ppc64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram \ +-accel tcg \ +-cpu POWER9 \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/ppc64-default-devices.xml b/tests/qemuxml2argvdata/ppc64-default-devices.xml new file mode 100644 index 0000000000..125e651519 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-devices.xml @@ -0,0 +1,12 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/riscv64-default-devices.riscv64-latest.args b/tests/qemuxml2argvdata/riscv64-default-devices.riscv64-latest.args new file mode 100644 index 0000000000..fcb80b009e --- /dev/null +++ b/tests/qemuxml2argvdata/riscv64-default-devices.riscv64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-riscv64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram \ +-accel tcg \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ +-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.1","addr":"0x0"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/riscv64-default-devices.xml b/tests/qemuxml2argvdata/riscv64-default-devices.xml new file mode 100644 index 0000000000..fb67b333c1 --- /dev/null +++ b/tests/qemuxml2argvdata/riscv64-default-devices.xml @@ -0,0 +1,12 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/s390x-default-devices.s390x-latest.args b/tests/qemuxml2argvdata/s390x-default-devices.s390x-latest.args new file mode 100644 index 0000000000..84098e580e --- /dev/null +++ b/tests/qemuxml2argvdata/s390x-default-devices.s390x-latest.args @@ -0,0 +1,32 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ +-accel tcg \ +-cpu qemu \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0000"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/s390x-default-devices.xml b/tests/qemuxml2argvdata/s390x-default-devices.xml new file mode 100644 index 0000000000..3f5202bfdd --- /dev/null +++ b/tests/qemuxml2argvdata/s390x-default-devices.xml @@ -0,0 +1,12 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/x86_64-default-devices.x86_64-latest.args b/tests/qemuxml2argvdata/x86_64-default-devices.x86_64-latest.args new file mode 100644 index 0000000000..606fd70519 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-devices.x86_64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/x86_64-default-devices.xml b/tests/qemuxml2argvdata/x86_64-default-devices.xml new file mode 100644 index 0000000000..33cebaebd8 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-devices.xml @@ -0,0 +1,12 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 9bd228e4fa..c5fa5e5fe6 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1064,6 +1064,12 @@ mymain(void) g_unsetenv("PIPEWIRE_REMOTE"); g_unsetenv("PIPEWIRE_RUNTIME_DIR"); + DO_TEST_CAPS_LATEST("x86_64-default-devices"); + DO_TEST_CAPS_ARCH_LATEST("aarch64-default-devices", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("riscv64-default-devices", "riscv64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-devices", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("s390x-default-devices", "s390x"); + DO_TEST_CAPS_LATEST("minimal"); DO_TEST_CAPS_LATEST_PARSE_ERROR("minimal-no-memory"); diff --git a/tests/qemuxml2xmloutdata/aarch64-default-devices.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-default-devices.aarch64-latest.xml new file mode 100644 index 0000000000..25b415d390 --- /dev/null +++ b/tests/qemuxml2xmloutdata/aarch64-default-devices.aarch64-latest.xml @@ -0,0 +1,26 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='aarch64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <gic version='2'/> + </features> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>cortex-a15</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/ppc64-default-devices.ppc64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-devices.ppc64-latest.xml new file mode 100644 index 0000000000..909f293766 --- /dev/null +++ b/tests/qemuxml2xmloutdata/ppc64-default-devices.ppc64-latest.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER9</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='usb' index='0' model='pci-ohci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='0' model='pci-root'> + <model name='spapr-pci-host-bridge'/> + <target index='0'/> + </controller> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </memballoon> + <panic model='pseries'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/riscv64-default-devices.riscv64-latest.xml b/tests/qemuxml2xmloutdata/riscv64-default-devices.riscv64-latest.xml new file mode 100644 index 0000000000..54363bb426 --- /dev/null +++ b/tests/qemuxml2xmloutdata/riscv64-default-devices.riscv64-latest.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='1' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x9'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/s390x-default-devices.s390x-latest.xml b/tests/qemuxml2xmloutdata/s390x-default-devices.s390x-latest.xml new file mode 100644 index 0000000000..df8e578212 --- /dev/null +++ b/tests/qemuxml2xmloutdata/s390x-default-devices.s390x-latest.xml @@ -0,0 +1,27 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/x86_64-default-devices.x86_64-latest.xml b/tests/qemuxml2xmloutdata/x86_64-default-devices.x86_64-latest.xml new file mode 100644 index 0000000000..3fde74460c --- /dev/null +++ b/tests/qemuxml2xmloutdata/x86_64-default-devices.x86_64-latest.xml @@ -0,0 +1,31 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 5a635444f8..72ddc66d24 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -197,6 +197,12 @@ mymain(void) g_unsetenv("QEMU_AUDIO_DRV"); g_unsetenv("SDL_AUDIODRIVER"); + DO_TEST_CAPS_LATEST("x86_64-default-devices"); + DO_TEST_CAPS_ARCH_LATEST("aarch64-default-devices", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("riscv64-default-devices", "riscv64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-devices", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("s390x-default-devices", "s390x"); + DO_TEST_CAPS_LATEST("minimal"); DO_TEST_CAPS_LATEST("genid"); DO_TEST_CAPS_LATEST("genid-auto"); -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:49 +0100, Andrea Bolognani wrote:
This provides coverage for the set of devices that libvirt will automatically add to any new guest. They can vary quite a lot depending on the architecture.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ...arch64-default-devices.aarch64-latest.args | 31 +++++++++++++++++ .../aarch64-default-devices.xml | 12 +++++++ .../ppc64-default-devices.ppc64-latest.args | 33 +++++++++++++++++++ .../ppc64-default-devices.xml | 12 +++++++ ...iscv64-default-devices.riscv64-latest.args | 33 +++++++++++++++++++ .../riscv64-default-devices.xml | 12 +++++++ .../s390x-default-devices.s390x-latest.args | 32 ++++++++++++++++++ .../s390x-default-devices.xml | 12 +++++++ .../x86_64-default-devices.x86_64-latest.args | 33 +++++++++++++++++++ .../x86_64-default-devices.xml | 12 +++++++ tests/qemuxml2argvtest.c | 6 ++++ ...aarch64-default-devices.aarch64-latest.xml | 26 +++++++++++++++ .../ppc64-default-devices.ppc64-latest.xml | 33 +++++++++++++++++++ ...riscv64-default-devices.riscv64-latest.xml | 33 +++++++++++++++++++ .../s390x-default-devices.s390x-latest.xml | 27 +++++++++++++++ .../x86_64-default-devices.x86_64-latest.xml | 31 +++++++++++++++++ tests/qemuxml2xmltest.c | 6 ++++ 17 files changed, 384 insertions(+) create mode 100644 tests/qemuxml2argvdata/aarch64-default-devices.aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/aarch64-default-devices.xml create mode 100644 tests/qemuxml2argvdata/ppc64-default-devices.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/ppc64-default-devices.xml create mode 100644 tests/qemuxml2argvdata/riscv64-default-devices.riscv64-latest.args create mode 100644 tests/qemuxml2argvdata/riscv64-default-devices.xml create mode 100644 tests/qemuxml2argvdata/s390x-default-devices.s390x-latest.args create mode 100644 tests/qemuxml2argvdata/s390x-default-devices.xml create mode 100644 tests/qemuxml2argvdata/x86_64-default-devices.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/x86_64-default-devices.xml create mode 100644 tests/qemuxml2xmloutdata/aarch64-default-devices.aarch64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/ppc64-default-devices.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/riscv64-default-devices.riscv64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/s390x-default-devices.s390x-latest.xml create mode 100644 tests/qemuxml2xmloutdata/x86_64-default-devices.x86_64-latest.xml
[...]
diff --git a/tests/qemuxml2argvdata/x86_64-default-devices.xml b/tests/qemuxml2argvdata/x86_64-default-devices.xml new file mode 100644 index 0000000000..33cebaebd8 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-devices.xml @@ -0,0 +1,12 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory>4194304</memory> + <vcpu>4</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type>
IMO it would make sense to have one for q35 too.
+ </os> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + </devices> +</domain>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

The idea of adding devices such as USB controllers or memory balloons by default comes from attempting to match QEMU's own defaults at a time when x86 was the only game in town. The unfortunate consequence of this is that, if the user does NOT want the device in question to be present, they have to create a special XML element with model=none to stop libvirt. This is counter-intuitive. For architectures for which we've added support more recently, such as aarch64, we've generally chosen to do the sensible thing and create very minimal guests by default. The user is of course still able to ask for additional hardware if they so desire. When adding RISC-V support, we accidentally forgot to skip the creation of the default memory balloon. Address that oversight. This is technically a breaking change, but it's fairly safe to apply it because: * it doesn't affect existing guests; * virt-manager will automatically add the memballoon device by default anyway; * RISC-V is still not widely used. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 1 + .../riscv64-default-devices.riscv64-latest.args | 3 --- .../riscv64-default-devices.riscv64-latest.xml | 13 ------------- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index fac83e8bb7..20687ee030 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4194,6 +4194,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, case VIR_ARCH_RISCV32: case VIR_ARCH_RISCV64: addDefaultUSB = false; + addDefaultMemballoon = false; if (qemuDomainIsRISCVVirt(def)) addPCIeRoot = true; break; diff --git a/tests/qemuxml2argvdata/riscv64-default-devices.riscv64-latest.args b/tests/qemuxml2argvdata/riscv64-default-devices.riscv64-latest.args index fcb80b009e..c38dddb5fa 100644 --- a/tests/qemuxml2argvdata/riscv64-default-devices.riscv64-latest.args +++ b/tests/qemuxml2argvdata/riscv64-default-devices.riscv64-latest.args @@ -25,9 +25,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \ --device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.1","addr":"0x0"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2xmloutdata/riscv64-default-devices.riscv64-latest.xml b/tests/qemuxml2xmloutdata/riscv64-default-devices.riscv64-latest.xml index 54363bb426..a96af29587 100644 --- a/tests/qemuxml2xmloutdata/riscv64-default-devices.riscv64-latest.xml +++ b/tests/qemuxml2xmloutdata/riscv64-default-devices.riscv64-latest.xml @@ -15,19 +15,6 @@ <devices> <emulator>/usr/bin/qemu-system-riscv64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='pci' index='1' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='1' port='0x8'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> - </controller> - <controller type='pci' index='2' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='2' port='0x9'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> - </controller> <audio id='1' type='none'/> - <memballoon model='virtio'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </memballoon> </devices> </domain> -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:50 +0100, Andrea Bolognani wrote:
The idea of adding devices such as USB controllers or memory balloons by default comes from attempting to match QEMU's own defaults at a time when x86 was the only game in town.
The unfortunate consequence of this is that, if the user does NOT want the device in question to be present, they have to create a special XML element with model=none to stop libvirt. This is counter-intuitive.
For architectures for which we've added support more recently, such as aarch64, we've generally chosen to do the sensible thing and create very minimal guests by default. The user is of course still able to ask for additional hardware if they so desire.
When adding RISC-V support, we accidentally forgot to skip the creation of the default memory balloon. Address that oversight.
This is technically a breaking change, but it's fairly safe to apply it because:
* it doesn't affect existing guests; * virt-manager will automatically add the memballoon device by default anyway; * RISC-V is still not widely used.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 1 + .../riscv64-default-devices.riscv64-latest.args | 3 --- .../riscv64-default-devices.riscv64-latest.xml | 13 ------------- 3 files changed, 1 insertion(+), 16 deletions(-)
Given that riscv64 isn't too widely used still I'm willing to agree to this change, please give it a bit time for others to potentially disagree. Reviewed-by: Peter Krempa <pkrempa@redhat.com>

The current defaults, that can be altered on a per-architecture basis, are derived by the historical x86 behavior. Every time support for a new architecture is added to libvirt, care must be taken to override these default: if that doesn't happen, all guests will end up with additional hardware which is generally not wanted. Turn things around, and require architectures to explicitly ask for the devices to be created by default instead. The behavior for existing architectures is preserved. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 20687ee030..7db5bd1e50 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4109,13 +4109,13 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, virDomainDef *def, virQEMUCaps *qemuCaps) { - bool addDefaultUSB = true; + bool addDefaultUSB = false; int usbModel = -1; /* "default for machinetype" */ int pciRoot; /* index within def->controllers */ bool addImplicitSATA = false; bool addPCIRoot = false; bool addPCIeRoot = false; - bool addDefaultMemballoon = true; + bool addDefaultMemballoon = false; bool addDefaultUSBKBD = false; bool addDefaultUSBMouse = false; bool addPanicDevice = false; @@ -4129,10 +4129,14 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, switch (def->os.arch) { case VIR_ARCH_I686: case VIR_ARCH_X86_64: + addDefaultMemballoon = true; + if (STREQ(def->os.machine, "isapc")) { - addDefaultUSB = false; break; } + + addDefaultUSB = true; + if (qemuDomainIsQ35(def)) { addPCIeRoot = true; addImplicitSATA = true; @@ -4157,16 +4161,12 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, break; case VIR_ARCH_ARMV6L: - addDefaultUSB = false; - addDefaultMemballoon = false; if (STREQ(def->os.machine, "versatilepb")) addPCIRoot = true; break; case VIR_ARCH_ARMV7L: case VIR_ARCH_AARCH64: - addDefaultUSB = false; - addDefaultMemballoon = false; if (qemuDomainIsARMVirt(def)) addPCIeRoot = true; break; @@ -4174,8 +4174,10 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, case VIR_ARCH_PPC64: case VIR_ARCH_PPC64LE: addPCIRoot = true; + addDefaultUSB = true; addDefaultUSBKBD = true; addDefaultUSBMouse = true; + addDefaultMemballoon = true; /* For pSeries guests, the firmware provides the same * functionality as the pvpanic device, so automatically * add the definition if not already present */ @@ -4188,30 +4190,27 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, case VIR_ARCH_PPCEMB: case VIR_ARCH_SH4: case VIR_ARCH_SH4EB: + addDefaultUSB = true; + addDefaultMemballoon = true; addPCIRoot = true; break; case VIR_ARCH_RISCV32: case VIR_ARCH_RISCV64: - addDefaultUSB = false; - addDefaultMemballoon = false; if (qemuDomainIsRISCVVirt(def)) addPCIeRoot = true; break; case VIR_ARCH_S390: case VIR_ARCH_S390X: - addDefaultUSB = false; + addDefaultMemballoon = true; addPanicDevice = true; addPCIRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_ZPCI); break; - case VIR_ARCH_SPARC: - addDefaultUSB = false; - addDefaultMemballoon = false; - break; - case VIR_ARCH_SPARC64: + addDefaultUSB = true; + addDefaultMemballoon = true; addPCIRoot = true; break; @@ -4219,6 +4218,8 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, case VIR_ARCH_MIPSEL: case VIR_ARCH_MIPS64: case VIR_ARCH_MIPS64EL: + addDefaultUSB = true; + addDefaultMemballoon = true; if (qemuDomainIsMipsMalta(def)) addPCIRoot = true; break; @@ -4234,6 +4235,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, case VIR_ARCH_PARISC: case VIR_ARCH_PARISC64: case VIR_ARCH_PPCLE: + case VIR_ARCH_SPARC: case VIR_ARCH_UNICORE32: case VIR_ARCH_XTENSA: case VIR_ARCH_XTENSAEB: -- 2.43.0

On Wed, Jan 17, 2024 at 10:54:51 +0100, Andrea Bolognani wrote:
The current defaults, that can be altered on a per-architecture basis, are derived by the historical x86 behavior.
Every time support for a new architecture is added to libvirt, care must be taken to override these default: if that doesn't happen, all guests will end up with additional hardware which is generally not wanted.
Turn things around, and require architectures to explicitly ask for the devices to be created by default instead. The behavior for existing architectures is preserved.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_domain.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On Wed, Jan 17, 2024 at 10:54:33 +0100, Andrea Bolognani wrote:
This started out as a way to make the upcoming loongarch64 support slightly nicer to implement, but ended up including a bunch of tangentially related changes.
Since trying to unentangle them would just result in a bunch of smaller series that still have dependencies on each other, I'm just sending everything at once.
Note that this series modifies many test cases across qemuxml2argvtest and qemuxml2xmltest. Since my two series: [PATCH 00/23] qemu XML testing improvements, part 2 - enforcement of xml->xml testing [PATCH 0/7] qemu XML testing improvements, part 3 - xmlout->xmlout testing and fixes also modify how testing is done and in the end unify qemuxml2xmltest with argument testing it would be preferential if that goes in first. Please give it a review.

On Wed, Jan 17, 2024 at 12:57:51PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:54:33 +0100, Andrea Bolognani wrote:
This started out as a way to make the upcoming loongarch64 support slightly nicer to implement, but ended up including a bunch of tangentially related changes.
Since trying to unentangle them would just result in a bunch of smaller series that still have dependencies on each other, I'm just sending everything at once.
Note that this series modifies many test cases across qemuxml2argvtest and qemuxml2xmltest. Since my two series:
[PATCH 00/23] qemu XML testing improvements, part 2 - enforcement of xml->xml testing [PATCH 0/7] qemu XML testing improvements, part 3 - xmlout->xmlout testing and fixes
also modify how testing is done and in the end unify qemuxml2xmltest with argument testing it would be preferential if that goes in first.
Please give it a review.
The patches that have been ACKed so far (1-13) mostly drop test cases, so the impact on your series should be fairly small. How about I push those patches, then review your series before respinning the remainder of mine? Or do you think that would introduce a lot of additional burden for you, and I should rather hold everything for now? -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Jan 17, 2024 at 10:45:54 -0500, Andrea Bolognani wrote:
On Wed, Jan 17, 2024 at 12:57:51PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:54:33 +0100, Andrea Bolognani wrote:
This started out as a way to make the upcoming loongarch64 support slightly nicer to implement, but ended up including a bunch of tangentially related changes.
Since trying to unentangle them would just result in a bunch of smaller series that still have dependencies on each other, I'm just sending everything at once.
Note that this series modifies many test cases across qemuxml2argvtest and qemuxml2xmltest. Since my two series:
[PATCH 00/23] qemu XML testing improvements, part 2 - enforcement of xml->xml testing [PATCH 0/7] qemu XML testing improvements, part 3 - xmlout->xmlout testing and fixes
also modify how testing is done and in the end unify qemuxml2xmltest with argument testing it would be preferential if that goes in first.
Please give it a review.
The patches that have been ACKed so far (1-13) mostly drop test cases, so the impact on your series should be fairly small. How about I push those patches, then review your series before respinning the remainder of mine? Or do you think that would introduce a lot of additional burden for you, and I should rather hold everything for now?
Jano already R-b'd my patches so I'll push them right after the pipelines finish.

On Wed, Jan 17, 2024 at 04:48:57PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:45:54 -0500, Andrea Bolognani wrote:
On Wed, Jan 17, 2024 at 12:57:51PM +0100, Peter Krempa wrote:
On Wed, Jan 17, 2024 at 10:54:33 +0100, Andrea Bolognani wrote:
This started out as a way to make the upcoming loongarch64 support slightly nicer to implement, but ended up including a bunch of tangentially related changes.
Since trying to unentangle them would just result in a bunch of smaller series that still have dependencies on each other, I'm just sending everything at once.
Note that this series modifies many test cases across qemuxml2argvtest and qemuxml2xmltest. Since my two series:
[PATCH 00/23] qemu XML testing improvements, part 2 - enforcement of xml->xml testing [PATCH 0/7] qemu XML testing improvements, part 3 - xmlout->xmlout testing and fixes
also modify how testing is done and in the end unify qemuxml2xmltest with argument testing it would be preferential if that goes in first.
Please give it a review.
The patches that have been ACKed so far (1-13) mostly drop test cases, so the impact on your series should be fairly small. How about I push those patches, then review your series before respinning the remainder of mine? Or do you think that would introduce a lot of additional burden for you, and I should rather hold everything for now?
Jano already R-b'd my patches so I'll push them right after the pipelines finish.
Excellent :) -- Andrea Bolognani / Red Hat / Virtualization
participants (3)
-
Andrea Bolognani
-
Ján Tomko
-
Peter Krempa