[PATCH v2 0/7] qemu: capabilities: Remove QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE

After a review from Jano I set out to fix also the test invocations to use real capabilities. This has shown that there was a bug in the validation logic which was pointed out by Jano in the output error file change. This version fixes the bug, improves testing and then removes the useless capability. Peter Krempa (7): qemuValidateDomainDefPCIFeature: un-break error messages qemuValidateDomainDefPCIFeature: Fix validation logic qemuxml2argvtest: Use real-caps testing for 'pc-i440fx-acpi-root-hotplug-disable' qemuxml2argvtest: Use real-caps testing for 'acpi-hotplug-bridge-disable' qemuxml2argvtest: Add '-enable' variants for ACPI-hotplug related cases qemuxml2xmltest: Convert all acpi-hotplug control related tests to DO_TEST_CAPS_LATEST qemu: capabilities: Remove QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE src/qemu/qemu_capabilities.c | 2 - src/qemu/qemu_capabilities.h | 1 - src/qemu/qemu_command.c | 3 +- src/qemu/qemu_validate.c | 15 ++---- .../caps_2.11.0.x86_64.xml | 1 - .../caps_2.12.0.x86_64.xml | 1 - .../caps_3.0.0.x86_64.xml | 1 - .../caps_3.1.0.x86_64.xml | 1 - .../caps_4.0.0.x86_64.xml | 1 - .../caps_4.1.0.x86_64.xml | 1 - .../caps_4.2.0.x86_64.xml | 1 - .../caps_5.0.0.x86_64.xml | 1 - .../caps_5.1.0.x86_64.xml | 1 - .../caps_5.2.0.x86_64.xml | 1 - .../caps_6.0.0.x86_64.xml | 1 - .../caps_6.1.0.x86_64.xml | 1 - ...-hotplug-bridge-disable.aarch64-latest.err | 1 + .../aarch64-acpi-hotplug-bridge-disable.err | 1 - ...hotplug-bridge-disable.x86_64-latest.args} | 15 +++--- ...i-hotplug-bridge-enable.x86_64-latest.args | 34 ++++++++++++ ...cpi-root-hotplug-disable.x86_64-5.1.0.err} | 0 ...i-root-hotplug-disable.x86_64-latest.args} | 15 +++--- ...-acpi-root-hotplug-enable.x86_64-5.1.0.err | 1 + ...cpi-root-hotplug-enable.x86_64-latest.args | 34 ++++++++++++ ...i-hotplug-bridge-disable.x86_64-6.0.0.err} | 0 ...hotplug-bridge-disable.x86_64-latest.args} | 14 +++-- ...pi-hotplug-bridge-enable.x86_64-6.0.0.err} | 0 ...i-hotplug-bridge-enable.x86_64-latest.args | 37 +++++++++++++ tests/qemuxml2argvtest.c | 27 ++++------ ...i-hotplug-bridge-disable.x86_64-latest.xml | 36 +++++++++++++ .../pc-i440fx-acpi-hotplug-bridge-disable.xml | 1 - ...pi-hotplug-bridge-enable.x86_64-latest.xml | 36 +++++++++++++ .../pc-i440fx-acpi-hotplug-bridge-enable.xml | 1 - ...cpi-root-hotplug-disable.x86_64-latest.xml | 33 ++++++++++++ .../pc-i440fx-acpi-root-hotplug-disable.xml | 1 - ...acpi-root-hotplug-enable.x86_64-latest.xml | 33 ++++++++++++ .../pc-i440fx-acpi-root-hotplug-enable.xml | 1 - ...i-hotplug-bridge-disable.x86_64-latest.xml | 53 +++++++++++++++++++ .../q35-acpi-hotplug-bridge-disable.xml | 1 - ...pi-hotplug-bridge-enable.x86_64-latest.xml | 53 +++++++++++++++++++ .../q35-acpi-hotplug-bridge-enable.xml | 1 - tests/qemuxml2xmltest.c | 24 +++------ 42 files changed, 401 insertions(+), 85 deletions(-) create mode 100644 tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err delete mode 100644 tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.err rename tests/qemuxml2argvdata/{pc-i440fx-acpi-hotplug-bridge-disable.args => pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.args} (55%) create mode 100644 tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.args rename tests/qemuxml2argvdata/{pc-i440fx-acpi-root-hotplug-disable.err => pc-i440fx-acpi-root-hotplug-disable.x86_64-5.1.0.err} (100%) rename tests/qemuxml2argvdata/{pc-i440fx-acpi-root-hotplug-disable.args => pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.args} (55%) create mode 100644 tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-5.1.0.err create mode 100644 tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.args rename tests/qemuxml2argvdata/{pc-i440fx-acpi-hotplug-bridge-disable.err => q35-acpi-hotplug-bridge-disable.x86_64-6.0.0.err} (100%) rename tests/qemuxml2argvdata/{q35-acpi-hotplug-bridge-disable.args => q35-acpi-hotplug-bridge-disable.x86_64-latest.args} (61%) rename tests/qemuxml2argvdata/{q35-acpi-hotplug-bridge-disable.err => q35-acpi-hotplug-bridge-enable.x86_64-6.0.0.err} (100%) create mode 100644 tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.args create mode 100644 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.xml create mode 100644 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.xml create mode 100644 tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.xml create mode 100644 tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.xml create mode 100644 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.xml create mode 100644 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.xml -- 2.31.1

https://www.libvirt.org/coding-style.html#error-message-format Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_validate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index be609c9d39..e530368cb3 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -194,8 +194,7 @@ qemuValidateDomainDefPCIFeature(const virDomainDef *def, case VIR_DOMAIN_PCI_ACPI_BRIDGE_HOTPLUG: if (!ARCH_IS_X86(def->os.arch)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("acpi-bridge-hotplug is not available " - "for architecture '%s'"), + _("acpi-bridge-hotplug is not available for architecture '%s'"), virArchToString(def->os.arch)); return -1; } @@ -203,8 +202,7 @@ qemuValidateDomainDefPCIFeature(const virDomainDef *def, !virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("acpi-bridge-hotplug is not available " - "with this QEMU binary")); + _("acpi-bridge-hotplug is not available with this QEMU binary")); return -1; } break; -- 2.31.1

The error that "acpi-bridge-hotplug" is not supported would be triggered only if both the ICH9 and PIIX don't support the capability and the machine is q35. This makes no sense. We want to check that the appropriate platform supports the appropriate feature. Fixes: 7300ccc9b3e Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_validate.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index e530368cb3..7eb9a37870 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -179,9 +179,6 @@ qemuValidateDomainDefPCIFeature(const virDomainDef *def, int feature) { size_t i; - bool q35Dom = qemuDomainIsQ35(def); - bool q35cap = q35Dom && virQEMUCapsGet(qemuCaps, - QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE); if (def->features[feature] == VIR_TRISTATE_SWITCH_ABSENT) return 0; @@ -198,9 +195,9 @@ qemuValidateDomainDefPCIFeature(const virDomainDef *def, virArchToString(def->os.arch)); return -1; } - if (!q35cap && - !virQEMUCapsGet(qemuCaps, - QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE)) { + + if ((qemuDomainIsQ35(def) && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE)) || + (!qemuDomainIsQ35(def) && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("acpi-bridge-hotplug is not available with this QEMU binary")); return -1; -- 2.31.1

We can use two real example configs to prove the support without the need for using fake capabilities. Fix the recently added test cases. Fixes: 133d7983d6c Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- ...fx-acpi-root-hotplug-disable.x86_64-5.1.0.err} | 0 ...-acpi-root-hotplug-disable.x86_64-latest.args} | 15 +++++++++------ tests/qemuxml2argvtest.c | 5 ++--- 3 files changed, 11 insertions(+), 9 deletions(-) rename tests/qemuxml2argvdata/{pc-i440fx-acpi-root-hotplug-disable.err => pc-i440fx-acpi-root-hotplug-disable.x86_64-5.1.0.err} (100%) rename tests/qemuxml2argvdata/{pc-i440fx-acpi-root-hotplug-disable.args => pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.args} (55%) diff --git a/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.err b/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-5.1.0.err similarity index 100% rename from tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.err rename to tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-5.1.0.err diff --git a/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.args b/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.args similarity index 55% rename from tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.args rename to tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.args index dd8ea503fc..056a925bc0 100644 --- a/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.args +++ b/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.args @@ -6,26 +6,29 @@ LOGNAME=test \ XDG_DATA_HOME=/tmp/lib/domain--1-i440fx/.local/share \ XDG_CACHE_HOME=/tmp/lib/domain--1-i440fx/.cache \ XDG_CONFIG_HOME=/tmp/lib/domain--1-i440fx/.config \ -QEMU_AUDIO_DRV=none \ /usr/bin/qemu-system-x86_64 \ -name guest=i440fx,debug-threads=on \ -S \ --object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-i440fx/master-key.aes \ --machine pc-i440fx-2.5,accel=tcg,usb=off,dump-guest-core=off \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-i440fx/master-key.aes"}' \ +-machine pc-i440fx-2.5,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \ +-cpu qemu64 \ -m 1024 \ --realtime mlock=off \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ -smp 1,sockets=1,cores=1,threads=1 \ -uuid 56f5055c-1b8d-490c-844a-ad646a1caaaa \ -display none \ -no-user-config \ -nodefaults \ --chardev socket,id=charmonitor,path=/tmp/lib/domain--1-i440fx/monitor.sock,server=on,wait=off \ +-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 \ -global PIIX4_PM.acpi-root-pci-hotplug=off \ --usb \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-audiodev id=audio1,driver=none \ -device 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/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 116ba714eb..0224bd1854 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2559,9 +2559,8 @@ mymain(void) QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PIIX_DISABLE_S3, QEMU_CAPS_PIIX_DISABLE_S4); - DO_TEST("pc-i440fx-acpi-root-hotplug-disable", - QEMU_CAPS_PIIX4_ACPI_ROOT_PCI_HOTPLUG); - DO_TEST_PARSE_ERROR_NOCAPS("pc-i440fx-acpi-root-hotplug-disable"); + DO_TEST_CAPS_LATEST("pc-i440fx-acpi-root-hotplug-disable"); + DO_TEST_CAPS_VER_PARSE_ERROR("pc-i440fx-acpi-root-hotplug-disable", "5.1.0"); DO_TEST("q35-acpi-hotplug-bridge-disable", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_IOH3420, -- 2.31.1

We can use real example configs to prove the support without the need for using fake capabilities. Fix the recently added test cases. The negative case for 'pc-i440fx-acpi-hotplug-bridge-disable' is removed completely as there is no real qemu libvirt supports which wouldn't have the capability. Fixes: bef0f0d8be6 Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- ...pi-hotplug-bridge-disable.aarch64-latest.err | 1 + .../aarch64-acpi-hotplug-bridge-disable.err | 1 - ...i-hotplug-bridge-disable.x86_64-latest.args} | 15 +++++++++------ .../q35-acpi-hotplug-bridge-disable.err | 1 - ...cpi-hotplug-bridge-disable.x86_64-6.0.0.err} | 0 ...i-hotplug-bridge-disable.x86_64-latest.args} | 14 +++++++++----- tests/qemuxml2argvtest.c | 17 ++++------------- 7 files changed, 23 insertions(+), 26 deletions(-) create mode 100644 tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err delete mode 100644 tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.err rename tests/qemuxml2argvdata/{pc-i440fx-acpi-hotplug-bridge-disable.args => pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.args} (55%) delete mode 100644 tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.err rename tests/qemuxml2argvdata/{pc-i440fx-acpi-hotplug-bridge-disable.err => q35-acpi-hotplug-bridge-disable.x86_64-6.0.0.err} (100%) rename tests/qemuxml2argvdata/{q35-acpi-hotplug-bridge-disable.args => q35-acpi-hotplug-bridge-disable.x86_64-latest.args} (61%) diff --git a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err new file mode 100644 index 0000000000..139591fce3 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err @@ -0,0 +1 @@ +XML error: The PCI controller with index='0' must be model='pcie-root' for this machine type, but model='pci-root' was found instead diff --git a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.err b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.err deleted file mode 100644 index 9f0a88b826..0000000000 --- a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.err +++ /dev/null @@ -1 +0,0 @@ -unsupported configuration: acpi-bridge-hotplug is not available for architecture 'aarch64' diff --git a/tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-disable.args b/tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.args similarity index 55% rename from tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-disable.args rename to tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.args index a1e5dc85c7..26de6c81ec 100644 --- a/tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-disable.args +++ b/tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.args @@ -6,26 +6,29 @@ LOGNAME=test \ XDG_DATA_HOME=/tmp/lib/domain--1-i440fx/.local/share \ XDG_CACHE_HOME=/tmp/lib/domain--1-i440fx/.cache \ XDG_CONFIG_HOME=/tmp/lib/domain--1-i440fx/.config \ -QEMU_AUDIO_DRV=none \ /usr/bin/qemu-system-x86_64 \ -name guest=i440fx,debug-threads=on \ -S \ --object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-i440fx/master-key.aes \ --machine pc-i440fx-2.5,accel=tcg,usb=off,dump-guest-core=off \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-i440fx/master-key.aes"}' \ +-machine pc-i440fx-2.5,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \ +-cpu qemu64 \ -m 1024 \ --realtime mlock=off \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ -smp 1,sockets=1,cores=1,threads=1 \ -uuid 56f5055c-1b8d-490c-844a-ad646a1caaaa \ -display none \ -no-user-config \ -nodefaults \ --chardev socket,id=charmonitor,path=/tmp/lib/domain--1-i440fx/monitor.sock,server=on,wait=off \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ -mon chardev=charmonitor,id=monitor,mode=control \ -rtc base=utc \ -no-shutdown \ -no-acpi \ -global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off \ -boot strict=on \ --usb \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-audiodev id=audio1,driver=none \ -device 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/q35-acpi-hotplug-bridge-disable.err b/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.err deleted file mode 100644 index 8c09a3cd76..0000000000 --- a/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.err +++ /dev/null @@ -1 +0,0 @@ -unsupported configuration: acpi-bridge-hotplug is not available with this QEMU binary diff --git a/tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-disable.err b/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.x86_64-6.0.0.err similarity index 100% rename from tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-disable.err rename to tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.x86_64-6.0.0.err diff --git a/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.args b/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.x86_64-latest.args similarity index 61% rename from tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.args rename to tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.x86_64-latest.args index 007c22c646..0c29f36738 100644 --- a/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.args +++ b/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.x86_64-latest.args @@ -6,20 +6,21 @@ LOGNAME=test \ XDG_DATA_HOME=/tmp/lib/domain--1-q35/.local/share \ XDG_CACHE_HOME=/tmp/lib/domain--1-q35/.cache \ XDG_CONFIG_HOME=/tmp/lib/domain--1-q35/.config \ -QEMU_AUDIO_DRV=none \ /usr/bin/qemu-system-x86_64 \ -name guest=q35,debug-threads=on \ -S \ --object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-q35/master-key.aes \ --machine pc-q35-2.5,accel=tcg,usb=off,dump-guest-core=off \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-q35/master-key.aes"}' \ +-machine pc-q35-2.5,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \ +-cpu qemu64 \ -m 1024 \ --realtime mlock=off \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ -smp 1,sockets=1,cores=1,threads=1 \ -uuid 56f5055c-1b8d-490c-844a-ad646a1caaaa \ -display none \ -no-user-config \ -nodefaults \ --chardev socket,id=charmonitor,path=/tmp/lib/domain--1-q35/monitor.sock,server=on,wait=off \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ -mon chardev=charmonitor,id=monitor,mode=control \ -rtc base=utc \ -no-shutdown \ @@ -29,5 +30,8 @@ QEMU_AUDIO_DRV=none \ -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \ -device ioh3420,port=0x8,chassis=3,id=pci.3,bus=pcie.0,addr=0x1 \ +-device qemu-xhci,id=usb,bus=pci.3,addr=0x0 \ +-audiodev id=audio1,driver=none \ -device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x1 \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0224bd1854..0fad076877 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2561,22 +2561,13 @@ mymain(void) QEMU_CAPS_PIIX_DISABLE_S3, QEMU_CAPS_PIIX_DISABLE_S4); DO_TEST_CAPS_LATEST("pc-i440fx-acpi-root-hotplug-disable"); DO_TEST_CAPS_VER_PARSE_ERROR("pc-i440fx-acpi-root-hotplug-disable", "5.1.0"); - DO_TEST("q35-acpi-hotplug-bridge-disable", - QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, - QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE); - DO_TEST("pc-i440fx-acpi-hotplug-bridge-disable", - QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, - QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE); - DO_TEST_PARSE_ERROR_NOCAPS("q35-acpi-hotplug-bridge-disable"); - DO_TEST_PARSE_ERROR_NOCAPS("pc-i440fx-acpi-hotplug-bridge-disable"); + DO_TEST_CAPS_LATEST("q35-acpi-hotplug-bridge-disable"); + DO_TEST_CAPS_LATEST("pc-i440fx-acpi-hotplug-bridge-disable"); + DO_TEST_CAPS_VER_PARSE_ERROR("q35-acpi-hotplug-bridge-disable", "6.0.0"); /* verify that we fail when acpi-bridge-hotplug option is specified for * archs other than x86 */ - DO_TEST_PARSE_ERROR_NOCAPS("aarch64-acpi-hotplug-bridge-disable"); + DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("aarch64-acpi-hotplug-bridge-disable", "aarch64"); DO_TEST("q35-usb2", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, -- 2.31.1

On a Monday in 2021, Peter Krempa wrote:
We can use real example configs to prove the support without the need for using fake capabilities. Fix the recently added test cases.
The negative case for 'pc-i440fx-acpi-hotplug-bridge-disable' is removed completely as there is no real qemu libvirt supports which wouldn't have the capability.
Fixes: bef0f0d8be6 Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- ...pi-hotplug-bridge-disable.aarch64-latest.err | 1 + .../aarch64-acpi-hotplug-bridge-disable.err | 1 - ...i-hotplug-bridge-disable.x86_64-latest.args} | 15 +++++++++------ .../q35-acpi-hotplug-bridge-disable.err | 1 - ...cpi-hotplug-bridge-disable.x86_64-6.0.0.err} | 0 ...i-hotplug-bridge-disable.x86_64-latest.args} | 14 +++++++++----- tests/qemuxml2argvtest.c | 17 ++++------------- 7 files changed, 23 insertions(+), 26 deletions(-) create mode 100644 tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err delete mode 100644 tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.err rename tests/qemuxml2argvdata/{pc-i440fx-acpi-hotplug-bridge-disable.args => pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.args} (55%) delete mode 100644 tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.err rename tests/qemuxml2argvdata/{pc-i440fx-acpi-hotplug-bridge-disable.err => q35-acpi-hotplug-bridge-disable.x86_64-6.0.0.err} (100%) rename tests/qemuxml2argvdata/{q35-acpi-hotplug-bridge-disable.args => q35-acpi-hotplug-bridge-disable.x86_64-latest.args} (61%)
diff --git a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err new file mode 100644 index 0000000000..139591fce3 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err @@ -0,0 +1 @@ +XML error: The PCI controller with index='0' must be model='pcie-root' for this machine type, but model='pci-root' was found instead
This error is suspicious. Looks like we only validate that the PCI controller is model pcie-root if QEMU_CAPS_OBJECT_GPEX is present. The following fixes it for me, but I have not verified that the definition does not contain other errors. diff --git a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err index 139591fce3..9f0a88b826 100644 --- a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err +++ b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err @@ -1 +1 @@ -XML error: The PCI controller with index='0' must be model='pcie-root' for this machine type, but model='pci-root' was found instead +unsupported configuration: acpi-bridge-hotplug is not available for architecture 'aarch64' diff --git a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.xml b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.xml index 0d5f945bd7..757f7a6776 100644 --- a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.xml +++ b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.xml @@ -22,7 +22,7 @@ <controller type='usb' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> - <controller type='pci' index='0' model='pci-root'/> + <controller type='pci' index='0' model='pcie-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/>
diff --git a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.err b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.err deleted file mode 100644 index 9f0a88b826..0000000000 --- a/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.err +++ /dev/null @@ -1 +0,0 @@ -unsupported configuration: acpi-bridge-hotplug is not available for architecture 'aarch64'
Jano

On Mon, Oct 11, 2021 at 04:51:40PM +0200, Ján Tomko wrote:
On a Monday in 2021, Peter Krempa wrote:
+++ b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err @@ -0,0 +1 @@ +XML error: The PCI controller with index='0' must be model='pcie-root' for this machine type, but model='pci-root' was found instead
This error is suspicious.
Looks like we only validate that the PCI controller is model pcie-root if QEMU_CAPS_OBJECT_GPEX is present.
The following fixes it for me, but I have not verified that the definition does not contain other errors.
+++ b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.xml @@ -22,7 +22,7 @@ <controller type='usb' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> - <controller type='pci' index='0' model='pci-root'/> + <controller type='pci' index='0' model='pcie-root'/>
This change is correct.
<input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/>
The PS/2 input devices, on the other hand, don't make a lot of sense on Arm. You could actually trim the input file down to <domain type='qemu'> <name>test</name> <memory unit='KiB'>1048576</memory> <vcpu placement='static'>1</vcpu> <os> <type arch='aarch64' machine='virt'>hvm</type> </os> <features> <pci> <acpi-bridge-hotplug state='off'/> </pci> </features> </domain> but that might be considered to be beyond the scope of this series. -- Andrea Bolognani / Red Hat / Virtualization

On Mon, Oct 11, 2021 at 09:27:44 -0700, Andrea Bolognani wrote:
On Mon, Oct 11, 2021 at 04:51:40PM +0200, Ján Tomko wrote:
On a Monday in 2021, Peter Krempa wrote:
+++ b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err @@ -0,0 +1 @@ +XML error: The PCI controller with index='0' must be model='pcie-root' for this machine type, but model='pci-root' was found instead
This error is suspicious.
Looks like we only validate that the PCI controller is model pcie-root if QEMU_CAPS_OBJECT_GPEX is present.
The following fixes it for me, but I have not verified that the definition does not contain other errors.
+++ b/tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.xml @@ -22,7 +22,7 @@ <controller type='usb' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> - <controller type='pci' index='0' model='pci-root'/> + <controller type='pci' index='0' model='pcie-root'/>
This change is correct.
<input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/>
The PS/2 input devices, on the other hand, don't make a lot of sense on Arm.
You could actually trim the input file down to
<domain type='qemu'> <name>test</name> <memory unit='KiB'>1048576</memory> <vcpu placement='static'>1</vcpu> <os> <type arch='aarch64' machine='virt'>hvm</type> </os> <features> <pci> <acpi-bridge-hotplug state='off'/> </pci> </features> </domain>
but that might be considered to be beyond the scope of this series.
Let me try it this way. If the error message stays the same I'd say it is relevant to modify the source, as the result stays the same.

We have input files for those, provide also xml2argv testing since we have them. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- ...i-hotplug-bridge-enable.x86_64-latest.args | 34 +++++++++++++++++ ...-acpi-root-hotplug-enable.x86_64-5.1.0.err | 1 + ...cpi-root-hotplug-enable.x86_64-latest.args | 34 +++++++++++++++++ ...cpi-hotplug-bridge-enable.x86_64-6.0.0.err | 1 + ...i-hotplug-bridge-enable.x86_64-latest.args | 37 +++++++++++++++++++ tests/qemuxml2argvtest.c | 5 +++ 6 files changed, 112 insertions(+) create mode 100644 tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-5.1.0.err create mode 100644 tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-enable.x86_64-6.0.0.err create mode 100644 tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.args diff --git a/tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.args b/tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.args new file mode 100644 index 0000000000..92b1c8c541 --- /dev/null +++ b/tests/qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.args @@ -0,0 +1,34 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-i440fx \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-i440fx/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-i440fx/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-i440fx/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=i440fx,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-i440fx/master-key.aes"}' \ +-machine pc-i440fx-2.5,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \ +-cpu qemu64 \ +-m 1024 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 56f5055c-1b8d-490c-844a-ad646a1caaaa \ +-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 \ +-global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=on \ +-boot strict=on \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-audiodev id=audio1,driver=none \ +-device 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/pc-i440fx-acpi-root-hotplug-enable.x86_64-5.1.0.err b/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-5.1.0.err new file mode 100644 index 0000000000..b507f1f8bc --- /dev/null +++ b/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-5.1.0.err @@ -0,0 +1 @@ +unsupported configuration: setting the hotplug property on a 'pci-root' device is not supported by this QEMU binary diff --git a/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.args b/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.args new file mode 100644 index 0000000000..244877a88f --- /dev/null +++ b/tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.args @@ -0,0 +1,34 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-i440fx \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-i440fx/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-i440fx/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-i440fx/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=i440fx,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-i440fx/master-key.aes"}' \ +-machine pc-i440fx-2.5,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \ +-cpu qemu64 \ +-m 1024 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 56f5055c-1b8d-490c-844a-ad646a1caaaa \ +-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 \ +-global PIIX4_PM.acpi-root-pci-hotplug=on \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-audiodev id=audio1,driver=none \ +-device 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/q35-acpi-hotplug-bridge-enable.x86_64-6.0.0.err b/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-enable.x86_64-6.0.0.err new file mode 100644 index 0000000000..8c09a3cd76 --- /dev/null +++ b/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-enable.x86_64-6.0.0.err @@ -0,0 +1 @@ +unsupported configuration: acpi-bridge-hotplug is not available with this QEMU binary diff --git a/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.args b/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.args new file mode 100644 index 0000000000..2dcaaca013 --- /dev/null +++ b/tests/qemuxml2argvdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.args @@ -0,0 +1,37 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-q35 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-q35/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-q35/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-q35/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=q35,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-q35/master-key.aes"}' \ +-machine pc-q35-2.5,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \ +-cpu qemu64 \ +-m 1024 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 56f5055c-1b8d-490c-844a-ad646a1caaaa \ +-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 \ +-global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=on \ +-boot strict=on \ +-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ +-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \ +-device ioh3420,port=0x8,chassis=3,id=pci.3,bus=pcie.0,addr=0x1 \ +-device qemu-xhci,id=usb,bus=pci.3,addr=0x0 \ +-audiodev id=audio1,driver=none \ +-device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x1 \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0fad076877..ec7bb3074e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2560,10 +2560,15 @@ mymain(void) QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PIIX_DISABLE_S3, QEMU_CAPS_PIIX_DISABLE_S4); DO_TEST_CAPS_LATEST("pc-i440fx-acpi-root-hotplug-disable"); + DO_TEST_CAPS_LATEST("pc-i440fx-acpi-root-hotplug-enable"); DO_TEST_CAPS_VER_PARSE_ERROR("pc-i440fx-acpi-root-hotplug-disable", "5.1.0"); + DO_TEST_CAPS_VER_PARSE_ERROR("pc-i440fx-acpi-root-hotplug-enable", "5.1.0"); DO_TEST_CAPS_LATEST("q35-acpi-hotplug-bridge-disable"); + DO_TEST_CAPS_LATEST("q35-acpi-hotplug-bridge-enable"); DO_TEST_CAPS_LATEST("pc-i440fx-acpi-hotplug-bridge-disable"); + DO_TEST_CAPS_LATEST("pc-i440fx-acpi-hotplug-bridge-enable"); DO_TEST_CAPS_VER_PARSE_ERROR("q35-acpi-hotplug-bridge-disable", "6.0.0"); + DO_TEST_CAPS_VER_PARSE_ERROR("q35-acpi-hotplug-bridge-enable", "6.0.0"); /* verify that we fail when acpi-bridge-hotplug option is specified for * archs other than x86 */ -- 2.31.1

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- ...i-hotplug-bridge-disable.x86_64-latest.xml | 36 +++++++++++++ .../pc-i440fx-acpi-hotplug-bridge-disable.xml | 1 - ...pi-hotplug-bridge-enable.x86_64-latest.xml | 36 +++++++++++++ .../pc-i440fx-acpi-hotplug-bridge-enable.xml | 1 - ...cpi-root-hotplug-disable.x86_64-latest.xml | 33 ++++++++++++ .../pc-i440fx-acpi-root-hotplug-disable.xml | 1 - ...acpi-root-hotplug-enable.x86_64-latest.xml | 33 ++++++++++++ .../pc-i440fx-acpi-root-hotplug-enable.xml | 1 - ...i-hotplug-bridge-disable.x86_64-latest.xml | 53 +++++++++++++++++++ .../q35-acpi-hotplug-bridge-disable.xml | 1 - ...pi-hotplug-bridge-enable.x86_64-latest.xml | 53 +++++++++++++++++++ .../q35-acpi-hotplug-bridge-enable.xml | 1 - tests/qemuxml2xmltest.c | 24 +++------ 13 files changed, 250 insertions(+), 24 deletions(-) create mode 100644 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.xml create mode 100644 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.xml create mode 100644 tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.xml create mode 100644 tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.xml create mode 100644 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.xml create mode 100644 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.xml delete mode 120000 tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.xml diff --git a/tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.xml new file mode 100644 index 0000000000..1b63ff9539 --- /dev/null +++ b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.xml @@ -0,0 +1,36 @@ +<domain type='qemu'> + <name>i440fx</name> + <uuid>56f5055c-1b8d-490c-844a-ad646a1caaaa</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type> + <boot dev='network'/> + </os> + <features> + <pci> + <acpi-bridge-hotplug state='off'/> + </pci> + </features> + <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/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.xml b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.xml deleted file mode 120000 index 8154897401..0000000000 --- a/tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-disable.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.xml new file mode 100644 index 0000000000..f7b2cbb9ce --- /dev/null +++ b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.xml @@ -0,0 +1,36 @@ +<domain type='qemu'> + <name>i440fx</name> + <uuid>56f5055c-1b8d-490c-844a-ad646a1caaaa</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type> + <boot dev='network'/> + </os> + <features> + <pci> + <acpi-bridge-hotplug state='on'/> + </pci> + </features> + <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/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.xml b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.xml deleted file mode 120000 index 6b9e5492f8..0000000000 --- a/tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/pc-i440fx-acpi-hotplug-bridge-enable.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.xml new file mode 100644 index 0000000000..5a78fe638d --- /dev/null +++ b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>i440fx</name> + <uuid>56f5055c-1b8d-490c-844a-ad646a1caaaa</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type> + <boot dev='network'/> + </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='pci' index='0' model='pci-root'> + <target hotplug='off'/> + </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <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/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.xml b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.xml deleted file mode 120000 index 0570e40273..0000000000 --- a/tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.xml new file mode 100644 index 0000000000..002bfea99d --- /dev/null +++ b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>i440fx</name> + <uuid>56f5055c-1b8d-490c-844a-ad646a1caaaa</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type> + <boot dev='network'/> + </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='pci' index='0' model='pci-root'> + <target hotplug='on'/> + </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <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/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.xml b/tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.xml deleted file mode 120000 index 2b0e42925f..0000000000 --- a/tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-enable.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.x86_64-latest.xml b/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.x86_64-latest.xml new file mode 100644 index 0000000000..87e61763fe --- /dev/null +++ b/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.x86_64-latest.xml @@ -0,0 +1,53 @@ +<domain type='qemu'> + <name>q35</name> + <uuid>56f5055c-1b8d-490c-844a-ad646a1caaaa</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc-q35-2.5'>hvm</type> + <boot dev='network'/> + </os> + <features> + <pci> + <acpi-bridge-hotplug state='off'/> + </pci> + </features> + <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='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='dmi-to-pci-bridge'> + <model name='i82801b11-bridge'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/> + </controller> + <controller type='pci' index='2' model='pci-bridge'> + <model name='pci-bridge'/> + <target chassisNr='2'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='ioh3420'/> + <target chassis='3' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </controller> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.xml b/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.xml deleted file mode 120000 index 77719b1325..0000000000 --- a/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/q35-acpi-hotplug-bridge-disable.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.xml b/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.xml new file mode 100644 index 0000000000..9a8043849c --- /dev/null +++ b/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.xml @@ -0,0 +1,53 @@ +<domain type='qemu'> + <name>q35</name> + <uuid>56f5055c-1b8d-490c-844a-ad646a1caaaa</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc-q35-2.5'>hvm</type> + <boot dev='network'/> + </os> + <features> + <pci> + <acpi-bridge-hotplug state='on'/> + </pci> + </features> + <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='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='dmi-to-pci-bridge'> + <model name='i82801b11-bridge'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/> + </controller> + <controller type='pci' index='2' model='pci-bridge'> + <model name='pci-bridge'/> + <target chassisNr='2'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='ioh3420'/> + <target chassis='3' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </controller> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.xml b/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.xml deleted file mode 120000 index 3cd8ee569e..0000000000 --- a/tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/q35-acpi-hotplug-bridge-enable.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 2e622c002f..a8be510523 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -424,24 +424,12 @@ mymain(void) DO_TEST_NOCAPS("input-usbtablet"); DO_TEST_NOCAPS("misc-acpi"); DO_TEST("misc-disable-s3", QEMU_CAPS_PIIX_DISABLE_S3); - DO_TEST("pc-i440fx-acpi-root-hotplug-disable", - QEMU_CAPS_PIIX4_ACPI_ROOT_PCI_HOTPLUG); - DO_TEST("pc-i440fx-acpi-root-hotplug-enable", - QEMU_CAPS_PIIX4_ACPI_ROOT_PCI_HOTPLUG); - DO_TEST("pc-i440fx-acpi-hotplug-bridge-disable", - QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE); - DO_TEST("pc-i440fx-acpi-hotplug-bridge-enable", - QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE); - DO_TEST("q35-acpi-hotplug-bridge-disable", - QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, - QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE); - DO_TEST("q35-acpi-hotplug-bridge-enable", - QEMU_CAPS_DEVICE_PCI_BRIDGE, - QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, - QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE); + DO_TEST_CAPS_LATEST("pc-i440fx-acpi-root-hotplug-disable"); + DO_TEST_CAPS_LATEST("pc-i440fx-acpi-root-hotplug-enable"); + DO_TEST_CAPS_LATEST("pc-i440fx-acpi-hotplug-bridge-disable"); + DO_TEST_CAPS_LATEST("pc-i440fx-acpi-hotplug-bridge-enable"); + DO_TEST_CAPS_LATEST("q35-acpi-hotplug-bridge-disable"); + DO_TEST_CAPS_LATEST("q35-acpi-hotplug-bridge-enable"); DO_TEST("misc-disable-suspends", QEMU_CAPS_PIIX_DISABLE_S3, QEMU_CAPS_PIIX_DISABLE_S4); -- 2.31.1

Commit 58ba0f6a3d7342fba29edbbf2bb9cb5497c870e5 added a capability which is supported by all qemu versions we support. Remove it and the associated dead code. Since the capability isn't present in any upstream release we can delete it completely. Specifically the commit itself states that it was introduced "around (qemu) 2.1". The rest of the code handles properly that the feature is used only on x86 with the i440fx machine so the capability is pointless. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_capabilities.c | 2 -- src/qemu/qemu_capabilities.h | 1 - src/qemu/qemu_command.c | 3 +-- src/qemu/qemu_validate.c | 4 ++-- tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml | 1 - tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 - 16 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c4d0e1858c..e95a44517e 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -644,7 +644,6 @@ VIR_ENUM_IMPL(virQEMUCaps, "virtio-mem-pci", /* QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI */ "memory-backend-file.reserve", /* QEMU_CAPS_MEMORY_BACKEND_RESERVE */ "piix4.acpi-root-pci-hotplug", /* QEMU_CAPS_PIIX4_ACPI_ROOT_PCI_HOTPLUG */ - "piix4.acpi-hotplug-bridge", /* QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE */ "ich9.acpi-hotplug-bridge", /* QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE */ ); @@ -1474,7 +1473,6 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsPiix4PM[] = { { "disable_s3", QEMU_CAPS_PIIX_DISABLE_S3, NULL }, { "disable_s4", QEMU_CAPS_PIIX_DISABLE_S4, NULL }, { "acpi-root-pci-hotplug", QEMU_CAPS_PIIX4_ACPI_ROOT_PCI_HOTPLUG, NULL }, - { "acpi-pci-hotplug-with-bridge-support", QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE, NULL }, }; static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsUSBRedir[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index e9bd6c8885..92337d2503 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -624,7 +624,6 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI, /* -device virtio-mem-pci */ QEMU_CAPS_MEMORY_BACKEND_RESERVE, /* -object memory-backend-*.reserve= */ QEMU_CAPS_PIIX4_ACPI_ROOT_PCI_HOTPLUG, /* -M pc PIIX4_PM.acpi-root-pci-hotplug */ - QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE, /* -M pc PIIX4_PM.acpi-pci-hotplug-with-bridge-support */ QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE, /* -M q35 ICH9-LPC.acpi-pci-hotplug-with-bridge-support */ QEMU_CAPS_LAST /* this must always be the last item */ diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 995b294736..5b7a3e5bc3 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6151,8 +6151,7 @@ qemuBuildPMCommandLine(virCommand *cmd, if (acpihp_br != VIR_TRISTATE_SWITCH_ABSENT) { const char *pm_object = NULL; - if (!qemuDomainIsQ35(def) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE)) + if (!qemuDomainIsQ35(def)) pm_object = "PIIX4_PM"; if (qemuDomainIsQ35(def) && diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 7eb9a37870..c7b8d18434 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -196,8 +196,8 @@ qemuValidateDomainDefPCIFeature(const virDomainDef *def, return -1; } - if ((qemuDomainIsQ35(def) && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE)) || - (!qemuDomainIsQ35(def) && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE))) { + if (qemuDomainIsQ35(def) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_ACPI_HOTPLUG_BRIDGE)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("acpi-bridge-hotplug is not available with this QEMU binary")); return -1; diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml index 65bfe911dd..d6549d6440 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml @@ -172,7 +172,6 @@ <flag name='am53c974'/> <flag name='cpu-max'/> <flag name='input-linux'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>2011000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100288</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml index e4d936886b..354a95cebc 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -184,7 +184,6 @@ <flag name='cpu-max'/> <flag name='input-linux'/> <flag name='virtio-blk.queue-size'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>2011090</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100289</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml index b903fbe403..cffe482bf6 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -190,7 +190,6 @@ <flag name='cpu-max'/> <flag name='input-linux'/> <flag name='virtio-blk.queue-size'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>3000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100239</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml index 143edb4e52..514e5985ac 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -194,7 +194,6 @@ <flag name='input-linux'/> <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>3000092</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100240</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml index 936726939d..5e733fec13 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml @@ -202,7 +202,6 @@ <flag name='input-linux'/> <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>4000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100240</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml index 742e71e4ae..ba9ee0dd96 100644 --- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml @@ -209,7 +209,6 @@ <flag name='input-linux'/> <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>4001000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100241</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml index 52d0acef3d..034a770b08 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -220,7 +220,6 @@ <flag name='input-linux'/> <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>4002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml index ccd7e53ea8..aae5fe018f 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -227,7 +227,6 @@ <flag name='input-linux'/> <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>5000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100241</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml index 267a3acd9d..e9ae3c5abb 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -230,7 +230,6 @@ <flag name='query-display-options'/> <flag name='virtio-blk.queue-size'/> <flag name='virtio-mem-pci'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>5001000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml index 2be17f0e45..98b5f34f2b 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml @@ -232,7 +232,6 @@ <flag name='virtio-blk.queue-size'/> <flag name='virtio-mem-pci'/> <flag name='piix4.acpi-root-pci-hotplug'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>5002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100243</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml index 9070eb85aa..f13a909314 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml @@ -240,7 +240,6 @@ <flag name='virtio-blk.queue-size'/> <flag name='virtio-mem-pci'/> <flag name='piix4.acpi-root-pci-hotplug'/> - <flag name='piix4.acpi-hotplug-bridge'/> <version>6000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml index 01833aff4b..9c9f17a83d 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml @@ -243,7 +243,6 @@ <flag name='virtio-mem-pci'/> <flag name='memory-backend-file.reserve'/> <flag name='piix4.acpi-root-pci-hotplug'/> - <flag name='piix4.acpi-hotplug-bridge'/> <flag name='ich9.acpi-hotplug-bridge'/> <version>6001000</version> <kvmVersion>0</kvmVersion> -- 2.31.1

On a Monday in 2021, Peter Krempa wrote:
After a review from Jano I set out to fix also the test invocations to use real capabilities. This has shown that there was a bug in the validation logic which was pointed out by Jano in the output error file change.
The cover letter mentions my name twice. Are these my 15 minutes of fame?
This version fixes the bug, improves testing and then removes the useless capability.
Peter Krempa (7): qemuValidateDomainDefPCIFeature: un-break error messages qemuValidateDomainDefPCIFeature: Fix validation logic qemuxml2argvtest: Use real-caps testing for 'pc-i440fx-acpi-root-hotplug-disable' qemuxml2argvtest: Use real-caps testing for 'acpi-hotplug-bridge-disable' qemuxml2argvtest: Add '-enable' variants for ACPI-hotplug related cases qemuxml2xmltest: Convert all acpi-hotplug control related tests to DO_TEST_CAPS_LATEST qemu: capabilities: Remove QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE
src/qemu/qemu_capabilities.c | 2 - src/qemu/qemu_capabilities.h | 1 - src/qemu/qemu_command.c | 3 +- src/qemu/qemu_validate.c | 15 ++---- .../caps_2.11.0.x86_64.xml | 1 - .../caps_2.12.0.x86_64.xml | 1 -
[...]
...pi-hotplug-bridge-enable.x86_64-latest.xml | 53 +++++++++++++++++++ .../q35-acpi-hotplug-bridge-enable.xml | 1 - tests/qemuxml2xmltest.c | 24 +++------ 42 files changed, 401 insertions(+), 85 deletions(-) create mode 100644 tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.aarch64-latest.err delete mode 100644 tests/qemuxml2argvdata/aarch64-acpi-hotplug-bridge-disable.err
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (3)
-
Andrea Bolognani
-
Ján Tomko
-
Peter Krempa