[libvirt PATCH 00/10] Disable hotplug on pcie-root-ports

This series enables use of QEMU 5.0's new "hotplug=off" setting for pcie-root-ports and pcie-switch-downstream-ports. When set (in the <target> subelement of the <controller> config), the emulated controller will report to the guest OS that devices cannot be hotplugged into or, maybe more importantly, out of the port. The result is that when a device is plugged into such a port at boot time, "certain guest OSes" won't show a menu to all users listing all PCIe devices as available to "Safely Remove". I had to hand-edit several capabilities results files in patch 1, since the pcie-root-port device has been present in QEMU for a long time, but we previously had not been gathering the list of options for that device. If someone has a setup to regenerate *actual* results for all those versions of QEMU, I would be very appreciative and gladly use that instead (Hi Kyle Two!) NB: the last 3 patches are each trivial, and I'd be happy to squash them, but had already committed them separately, and thought it helped in explaining. This resolves https://bugzilla.redhat.com/1802592 Laine Stump (10): qemu: new capabilities flag pcie-root-port.hotplug conf: new attribute "hotplug" for pci controllers qemu: hook up pcie-root-port hotplug='off' option docs: mention hotplug='off' in news.xml conf: add new PCI_CONNECT flag AUTOASSIGN conf/qemu: s/VIR_PCI_CONNECT_HOTPLUGGABLE/VIR_PCI_CONNECT_AUTOASSIGN/g conf: simplify logic when checking for AUTOASSIGN PCI addresses qemu/conf: set HOTPLUGGABLE connect flag during PCI address set init conf: check HOTPLUGGABLE connect flag when validating a PCI address conf: during PCI hotplug, require that the controller support hotplug docs/formatdomain.html.in | 11 ++ docs/news.xml | 12 ++ docs/schemas/domaincommon.rng | 5 + src/conf/domain_addr.c | 85 ++++---- src/conf/domain_addr.h | 44 +++-- src/conf/domain_conf.c | 20 +- src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 8 + src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 4 + src/qemu/qemu_domain_address.c | 24 ++- src/qemu/qemu_validate.c | 31 +++ .../caps_2.10.0.aarch64.replies | 142 ++++++++++++-- .../caps_2.10.0.x86_64.replies | 154 ++++++++++++--- .../caps_2.11.0.x86_64.replies | 154 ++++++++++++--- .../caps_2.12.0.aarch64.replies | 158 ++++++++++++--- .../caps_2.12.0.x86_64.replies | 170 +++++++++++++--- .../caps_2.9.0.x86_64.replies | 154 ++++++++++++--- .../caps_3.0.0.x86_64.replies | 170 +++++++++++++--- .../caps_3.1.0.x86_64.replies | 170 +++++++++++++--- .../caps_4.0.0.aarch64.replies | 158 ++++++++++++--- .../caps_4.0.0.ppc64.replies | 150 +++++++++++++-- .../caps_4.0.0.riscv32.replies | 150 +++++++++++++-- .../caps_4.0.0.riscv64.replies | 150 +++++++++++++-- .../caps_4.0.0.x86_64.replies | 170 +++++++++++++--- .../caps_4.1.0.x86_64.replies | 162 +++++++++++++--- .../caps_4.2.0.aarch64.replies | 166 +++++++++++++--- .../caps_4.2.0.ppc64.replies | 150 +++++++++++++-- .../caps_4.2.0.x86_64.replies | 162 +++++++++++++--- .../caps_5.0.0.aarch64.replies | 166 +++++++++++++--- .../caps_5.0.0.ppc64.replies | 150 +++++++++++++-- .../caps_5.0.0.x86_64.replies | 181 +++++++++++++++--- .../caps_5.0.0.x86_64.xml | 1 + .../pcie-root-port-nohotplug.args | 39 ++++ .../pcie-root-port-nohotplug.xml | 35 ++++ tests/qemuxml2argvtest.c | 7 + .../pcie-root-port-nohotplug.xml | 64 +++++++ tests/qemuxml2xmltest.c | 7 + 38 files changed, 3038 insertions(+), 548 deletions(-) create mode 100644 tests/qemuxml2argvdata/pcie-root-port-nohotplug.args create mode 100644 tests/qemuxml2argvdata/pcie-root-port-nohotplug.xml create mode 100644 tests/qemuxml2xmloutdata/pcie-root-port-nohotplug.xml -- 2.25.2

This caps flag is set when the qemu binary supports the option "hotplug" for pcie-root-port, ioh3420 (Intel pcie-root-port) and xio3130-downstream (Intel pcie-downstream-port). If it's available, it's possible to disable hotplugging/unplugging devices on a particular port by adding ",hotplug=off" to the qemu device commandline. This option first appears in qemu-5.0.0. Signed-off-by: Laine Stump <laine@redhat.com> --- Hi Pavel! These replies files were hand edited, but a proper regeneration from the actual qemu binaries would probably be better. If you still have a setup to easily generate those (or advice on how to do it in the simplest way possible) that would be appreciated! src/qemu/qemu_capabilities.c | 8 + src/qemu/qemu_capabilities.h | 1 + .../caps_2.10.0.aarch64.replies | 142 ++++++++++++-- .../caps_2.10.0.x86_64.replies | 154 ++++++++++++--- .../caps_2.11.0.x86_64.replies | 154 ++++++++++++--- .../caps_2.12.0.aarch64.replies | 158 ++++++++++++--- .../caps_2.12.0.x86_64.replies | 170 +++++++++++++--- .../caps_2.9.0.x86_64.replies | 154 ++++++++++++--- .../caps_3.0.0.x86_64.replies | 170 +++++++++++++--- .../caps_3.1.0.x86_64.replies | 170 +++++++++++++--- .../caps_4.0.0.aarch64.replies | 158 ++++++++++++--- .../caps_4.0.0.ppc64.replies | 150 +++++++++++++-- .../caps_4.0.0.riscv32.replies | 150 +++++++++++++-- .../caps_4.0.0.riscv64.replies | 150 +++++++++++++-- .../caps_4.0.0.x86_64.replies | 170 +++++++++++++--- .../caps_4.1.0.x86_64.replies | 162 +++++++++++++--- .../caps_4.2.0.aarch64.replies | 166 +++++++++++++--- .../caps_4.2.0.ppc64.replies | 150 +++++++++++++-- .../caps_4.2.0.x86_64.replies | 162 +++++++++++++--- .../caps_5.0.0.aarch64.replies | 166 +++++++++++++--- .../caps_5.0.0.ppc64.replies | 150 +++++++++++++-- .../caps_5.0.0.x86_64.replies | 181 +++++++++++++++--- .../caps_5.0.0.x86_64.xml | 1 + 23 files changed, 2713 insertions(+), 484 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 994f1fd179..211b3c0ee6 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -571,6 +571,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 360 */ "fsdev.multidevs", + "pcie-root-port.hotplug", ); @@ -1323,6 +1324,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioNet[] = { { "failover", QEMU_CAPS_VIRTIO_NET_FAILOVER }, }; +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsPCIeRootPort[] = { + { "hotplug", QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG }, +}; + static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSpaprPCIHostBridge[] = { { "numa_node", QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE }, }; @@ -1564,6 +1569,9 @@ static virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] = { { "nvdimm", virQEMUCapsDevicePropsNVDIMM, G_N_ELEMENTS(virQEMUCapsDevicePropsNVDIMM), QEMU_CAPS_DEVICE_NVDIMM }, + { "pcie-root-port", virQEMUCapsDevicePropsPCIeRootPort, + G_N_ELEMENTS(virQEMUCapsDevicePropsPCIeRootPort), + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT }, }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index d247e19710..7b957d6185 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -552,6 +552,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 360 */ QEMU_CAPS_FSDEV_MULTIDEVS, /* fsdev.multidevs */ + QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG, /* pcie-root-port.hotplug */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.replies index 73a99a36ea..c75d4ab8a7 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.10.0.aarch64.replies @@ -4895,10 +4895,120 @@ } { - "execute": "query-machines", + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, "id": "libvirt-29" } +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-29" +} + +{ + "execute": "query-machines", + "id": "libvirt-30" +} + { "return": [ { @@ -5163,12 +5273,12 @@ "cpu-max": 1 } ], - "id": "libvirt-29" + "id": "libvirt-30" } { "execute": "query-cpu-definitions", - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -5334,34 +5444,34 @@ "static": false } ], - "id": "libvirt-30" + "id": "libvirt-31" } { "execute": "query-tpm-models", - "id": "libvirt-31" + "id": "libvirt-32" } { "return": [ ], - "id": "libvirt-31" + "id": "libvirt-32" } { "execute": "query-tpm-types", - "id": "libvirt-32" + "id": "libvirt-33" } { "return": [ ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-command-line-options", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -6506,12 +6616,12 @@ "option": "drive" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { "execute": "query-migrate-capabilities", - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -6561,12 +6671,12 @@ "capability": "return-path" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-qmp-schema", - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -16289,12 +16399,12 @@ "meta-type": "object" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-gic-capabilities", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -16310,7 +16420,7 @@ "kernel": true } ], - "id": "libvirt-36" + "id": "libvirt-37" } { diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies index 8f96b4c567..d5deea9b3c 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies @@ -4448,10 +4448,120 @@ } { - "execute": "query-machines", + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, "id": "libvirt-35" } +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-35" +} + +{ + "execute": "query-machines", + "id": "libvirt-36" +} + { "return": [ { @@ -4638,12 +4748,12 @@ "alias": "q35" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-cpu-definitions", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4978,36 +5088,36 @@ "migration-safe": true } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-models", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "tpm-tis" ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-tpm-types", - "id": "libvirt-38" + "id": "libvirt-39" } { "return": [ "passthrough" ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-command-line-options", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -6286,12 +6396,12 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-migrate-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -6341,12 +6451,12 @@ "capability": "return-path" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-qmp-schema", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -16069,7 +16179,7 @@ "meta-type": "object" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -16080,7 +16190,7 @@ "name": "host" } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -16259,7 +16369,7 @@ } } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -16440,7 +16550,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -16683,7 +16793,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -16697,7 +16807,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -16876,7 +16986,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -17057,7 +17167,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -17300,7 +17410,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.replies index d91f01b55d..75ca78f75e 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.replies @@ -4475,10 +4475,120 @@ } { - "execute": "query-machines", + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, "id": "libvirt-35" } +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-35" +} + +{ + "execute": "query-machines", + "id": "libvirt-36" +} + { "return": [ { @@ -4665,12 +4775,12 @@ "cpu-max": 288 } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-cpu-definitions", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4984,24 +5094,24 @@ "migration-safe": true } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-models", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "tpm-tis" ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-tpm-types", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -5009,12 +5119,12 @@ "passthrough", "emulator" ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-command-line-options", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -6309,12 +6419,12 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-migrate-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -6372,12 +6482,12 @@ "capability": "x-multifd" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-qmp-schema", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -16245,7 +16355,7 @@ "meta-type": "object" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -16256,7 +16366,7 @@ "name": "host" } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -16436,7 +16546,7 @@ } } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -16618,7 +16728,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -16863,7 +16973,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -16877,7 +16987,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -17057,7 +17167,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -17239,7 +17349,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -17484,7 +17594,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.replies index 87414a9bca..b99913ed37 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.aarch64.replies @@ -5251,12 +5251,122 @@ "id": "libvirt-28" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-29" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -5310,7 +5420,7 @@ "type": "string" } ], - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -5318,7 +5428,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -5372,7 +5482,7 @@ "type": "string" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -5380,7 +5490,7 @@ "arguments": { "typename": "max-arm-cpu" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -5495,12 +5605,12 @@ "type": "child<irq>" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { "execute": "query-machines", - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -5797,7 +5907,7 @@ "cpu-max": 1 } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -5805,7 +5915,7 @@ "arguments": { "typename": "virt-2.12-machine" }, - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -5935,12 +6045,12 @@ "type": "bool" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { "execute": "query-cpu-definitions", - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -6116,35 +6226,35 @@ "static": false } ], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-tpm-models", - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-tpm-types", - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ "emulator" ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-command-line-options", - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -7309,12 +7419,12 @@ "option": "drive" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-migrate-capabilities", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -7376,12 +7486,12 @@ "capability": "dirty-bitmaps" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-qmp-schema", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -18749,12 +18859,12 @@ "meta-type": "object" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-gic-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -18770,7 +18880,7 @@ "kernel": false } ], - "id": "libvirt-40" + "id": "libvirt-41" } { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies index b4c243096b..1e3ba0885a 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies @@ -4641,12 +4641,122 @@ "id": "libvirt-34" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-35" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-35" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4700,7 +4810,7 @@ "type": "string" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4708,7 +4818,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4758,7 +4868,7 @@ "type": "string" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4766,7 +4876,7 @@ "arguments": { "typename": "max-x86_64-cpu" }, - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -5788,12 +5898,12 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-machines", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -5992,12 +6102,12 @@ "cpu-max": 255 } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-cpu-definitions", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -6511,12 +6621,12 @@ "migration-safe": true } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-tpm-models", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -6524,12 +6634,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-tpm-types", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -6537,12 +6647,12 @@ "passthrough", "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-command-line-options", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -7829,12 +7939,12 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-migrate-capabilities", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -7896,12 +8006,12 @@ "capability": "dirty-bitmaps" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-qmp-schema", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -19269,12 +19379,12 @@ "meta-type": "object" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { "execute": "query-sev-capabilities", - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -19284,7 +19394,7 @@ "cert-chain": "AQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAA", "pdh": "AQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAA" }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -19295,7 +19405,7 @@ "name": "host" } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -19485,7 +19595,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -19677,7 +19787,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -19932,7 +20042,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -19946,7 +20056,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -20136,7 +20246,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -20328,7 +20438,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { @@ -20583,7 +20693,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies index 8f32313b46..5cff9c485b 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies @@ -3992,10 +3992,120 @@ } { - "execute": "query-machines", + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, "id": "libvirt-35" } +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-35" +} + +{ + "execute": "query-machines", + "id": "libvirt-36" +} + { "return": [ { @@ -4172,12 +4282,12 @@ "cpu-max": 255 } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-cpu-definitions", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4459,36 +4569,36 @@ "migration-safe": true } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-models", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "tpm-tis" ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-tpm-types", - "id": "libvirt-38" + "id": "libvirt-39" } { "return": [ "passthrough" ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-command-line-options", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -5737,12 +5847,12 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-migrate-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -5784,12 +5894,12 @@ "capability": "release-ram" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-qmp-schema", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -15075,7 +15185,7 @@ "meta-type": "object" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -15086,7 +15196,7 @@ "name": "host" } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -15265,7 +15375,7 @@ } } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -15446,7 +15556,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -15687,7 +15797,7 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -15701,7 +15811,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -15880,7 +15990,7 @@ } } }, - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -16061,7 +16171,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -16302,7 +16412,7 @@ } } }, - "id": "libvirt-45" + "id": "libvirt-46" } { diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies index f25e5deb94..c683f672f7 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.replies @@ -4776,12 +4776,122 @@ } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-35" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-35" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4831,7 +4941,7 @@ "type": "string" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4839,7 +4949,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4889,7 +4999,7 @@ "type": "string" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4897,7 +5007,7 @@ "arguments": { "typename": "max-x86_64-cpu" }, - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -5951,12 +6061,12 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-machines", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -6165,12 +6275,12 @@ "cpu-max": 255 } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-cpu-definitions", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -6607,12 +6717,12 @@ "migration-safe": true } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-tpm-models", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -6620,12 +6730,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-tpm-types", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -6633,12 +6743,12 @@ "passthrough", "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-command-line-options", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -7937,12 +8047,12 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-migrate-capabilities", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -8012,12 +8122,12 @@ "capability": "late-block-activate" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-qmp-schema", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -19897,16 +20007,16 @@ "meta-type": "object" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { "execute": "query-sev-capabilities", - "id": "libvirt-45" + "id": "libvirt-46" } { - "id": "libvirt-45", + "id": "libvirt-46", "error": { "class": "GenericError", "desc": "SEV feature is not available" @@ -19921,7 +20031,7 @@ "name": "host" } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -20114,7 +20224,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -20309,7 +20419,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -20572,7 +20682,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -20586,7 +20696,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -20779,7 +20889,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -20974,7 +21084,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { @@ -21237,7 +21347,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies index 256fa92af9..e0e1edddf1 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.replies @@ -4818,12 +4818,122 @@ "id": "libvirt-34" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-35" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-35" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4884,7 +4994,7 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4892,7 +5002,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4952,7 +5062,7 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -4960,7 +5070,7 @@ "arguments": { "typename": "max-x86_64-cpu" }, - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -6062,12 +6172,12 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-machines", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -6286,12 +6396,12 @@ "cpu-max": 255 } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-cpu-definitions", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -6810,12 +6920,12 @@ "migration-safe": true } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-tpm-models", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -6823,12 +6933,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-tpm-types", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -6836,12 +6946,12 @@ "passthrough", "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-command-line-options", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -8115,12 +8225,12 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-migrate-capabilities", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -8190,12 +8300,12 @@ "capability": "late-block-activate" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-qmp-schema", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -20380,16 +20490,16 @@ "meta-type": "object" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { "execute": "query-sev-capabilities", - "id": "libvirt-45" + "id": "libvirt-46" } { - "id": "libvirt-45", + "id": "libvirt-46", "error": { "class": "GenericError", "desc": "SEV feature is not available" @@ -20404,7 +20514,7 @@ "name": "host" } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -20606,7 +20716,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -20810,7 +20920,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -21085,7 +21195,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -21099,7 +21209,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -21301,7 +21411,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -21505,7 +21615,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { @@ -21780,7 +21890,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.replies b/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.replies index 0eca77acca..ddd77ba48a 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.aarch64.replies @@ -5718,12 +5718,122 @@ "id": "libvirt-29" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-30" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -5788,7 +5898,7 @@ "type": "bool" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -5796,7 +5906,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -5860,7 +5970,7 @@ "type": "bool" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -5868,7 +5978,7 @@ "arguments": { "typename": "max-arm-cpu" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -5983,12 +6093,12 @@ "type": "child<irq>" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-machines", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -6330,7 +6440,7 @@ "cpu-max": 1 } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -6338,7 +6448,7 @@ "arguments": { "typename": "virt-4.0-machine" }, - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -6473,12 +6583,12 @@ "type": "string" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-cpu-definitions", - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -6669,34 +6779,34 @@ "static": false } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-tpm-models", - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-types", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-command-line-options", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -7844,12 +7954,12 @@ "option": "drive" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-migrate-capabilities", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -7923,12 +8033,12 @@ "capability": "x-ignore-shared" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-qmp-schema", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -20015,12 +20125,12 @@ ] } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-gic-capabilities", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -20036,7 +20146,7 @@ "kernel": false } ], - "id": "libvirt-41" + "id": "libvirt-42" } { diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.replies b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.replies index 84b5f06c5d..356e12aa01 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.replies @@ -5773,12 +5773,122 @@ "id": "libvirt-30" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-31" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-31" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -5843,7 +5953,7 @@ "type": "bool" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -5851,7 +5961,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -5915,12 +6025,12 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-machines", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -6073,7 +6183,7 @@ "cpu-max": 1 } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -6081,7 +6191,7 @@ "arguments": { "typename": "pseries-4.0-machine" }, - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -6280,12 +6390,12 @@ "type": "string" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-cpu-definitions", - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -8481,34 +8591,34 @@ "static": false } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-tpm-models", - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-types", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-command-line-options", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -9651,12 +9761,12 @@ "option": "drive" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-migrate-capabilities", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -9730,12 +9840,12 @@ "capability": "x-ignore-shared" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-qmp-schema", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -21793,7 +21903,7 @@ ] } ], - "id": "libvirt-40" + "id": "libvirt-41" } { diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.replies b/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.replies index 2b1d832c6b..2d63851d3a 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.replies @@ -3892,12 +3892,122 @@ "id": "libvirt-30" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-31" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-31" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -3962,7 +4072,7 @@ "type": "bool" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -3970,7 +4080,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -4034,12 +4144,12 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-machines", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -4076,7 +4186,7 @@ "cpu-max": 1 } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -4084,7 +4194,7 @@ "arguments": { "typename": "virt-machine" }, - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -4189,34 +4299,34 @@ "type": "bool" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-tpm-models", - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-tpm-types", - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-command-line-options", - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -5488,12 +5598,12 @@ "option": "drive" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-migrate-capabilities", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -5567,12 +5677,12 @@ "capability": "x-ignore-shared" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-qmp-schema", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -17851,12 +17961,12 @@ ] } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-machines", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -17893,5 +18003,5 @@ "cpu-max": 1 } ], - "id": "libvirt-40" + "id": "libvirt-41" } diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.replies b/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.replies index 8fd9646f53..4df475d7c0 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.replies @@ -3892,12 +3892,122 @@ "id": "libvirt-30" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-31" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-31a" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -3962,7 +4072,7 @@ "type": "bool" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -3970,7 +4080,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -4034,12 +4144,12 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-machines", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -4076,7 +4186,7 @@ "cpu-max": 1 } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -4084,7 +4194,7 @@ "arguments": { "typename": "virt-machine" }, - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -4189,34 +4299,34 @@ "type": "bool" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-tpm-models", - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-tpm-types", - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-command-line-options", - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -5488,12 +5598,12 @@ "option": "drive" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-migrate-capabilities", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -5567,12 +5677,12 @@ "capability": "x-ignore-shared" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-qmp-schema", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -17851,12 +17961,12 @@ ] } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-machines", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -17893,5 +18003,5 @@ "cpu-max": 1 } ], - "id": "libvirt-40" + "id": "libvirt-41" } diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.replies index 09112a207f..8ac67e0b75 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.replies @@ -5043,12 +5043,122 @@ "id": "libvirt-34" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-35" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-35" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -5113,7 +5223,7 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -5121,7 +5231,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5185,7 +5295,7 @@ "type": "bool" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5193,7 +5303,7 @@ "arguments": { "typename": "max-x86_64-cpu" }, - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -6311,12 +6421,12 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-machines", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -6535,12 +6645,12 @@ "alias": "q35" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-cpu-definitions", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -7057,12 +7167,12 @@ "migration-safe": true } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-tpm-models", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -7070,12 +7180,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-tpm-types", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -7083,12 +7193,12 @@ "passthrough", "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-command-line-options", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -8370,12 +8480,12 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-migrate-capabilities", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -8449,12 +8559,12 @@ "capability": "x-ignore-shared" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-qmp-schema", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -20919,16 +21029,16 @@ ] } ], - "id": "libvirt-44" + "id": "libvirt-45" } { "execute": "query-sev-capabilities", - "id": "libvirt-45" + "id": "libvirt-46" } { - "id": "libvirt-45", + "id": "libvirt-46", "error": { "class": "GenericError", "desc": "SEV feature is not available" @@ -20943,7 +21053,7 @@ "name": "host" } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -21147,7 +21257,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -21353,7 +21463,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -21632,7 +21742,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -21646,7 +21756,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -21850,7 +21960,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -22056,7 +22166,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { @@ -22335,7 +22445,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.replies index c143866dcc..5c3c706651 100644 --- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.replies @@ -5336,12 +5336,122 @@ "id": "libvirt-34" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-35" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-35" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -5406,7 +5516,7 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -5414,7 +5524,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5478,7 +5588,7 @@ "type": "int" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5486,7 +5596,7 @@ "arguments": { "typename": "max-x86_64-cpu" }, - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -6651,12 +6761,12 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-machines", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -6980,12 +7090,12 @@ "deprecated": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-cpu-definitions", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -8130,12 +8240,12 @@ "migration-safe": true } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-tpm-models", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -8143,12 +8253,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-tpm-types", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -8156,12 +8266,12 @@ "passthrough", "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-command-line-options", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -9435,12 +9545,12 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-migrate-capabilities", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -9514,12 +9624,12 @@ "capability": "x-ignore-shared" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-qmp-schema", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -22104,16 +22214,16 @@ ] } ], - "id": "libvirt-44" + "id": "libvirt-45" } { "execute": "query-sev-capabilities", - "id": "libvirt-45" + "id": "libvirt-46" } { - "id": "libvirt-45", + "id": "libvirt-46", "error": { "class": "GenericError", "desc": "SEV feature is not available" @@ -22128,7 +22238,7 @@ "name": "host" } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -22336,7 +22446,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -22350,7 +22460,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -22558,7 +22668,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies index e5d5b53667..4d28047ebe 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies @@ -6090,12 +6090,122 @@ "id": "libvirt-29" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-30" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -6160,7 +6270,7 @@ "type": "bool" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -6168,7 +6278,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -6232,7 +6342,7 @@ "type": "bool" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -6240,7 +6350,7 @@ "arguments": { "typename": "max-arm-cpu" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -6427,12 +6537,12 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-machines", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -6990,7 +7100,7 @@ "deprecated": false } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -6998,7 +7108,7 @@ "arguments": { "typename": "virt-4.2-machine" }, - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -7151,12 +7261,12 @@ "type": "child<cfi.pflash01>" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-cpu-definitions", - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -7347,34 +7457,34 @@ "static": false } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-tpm-models", - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-types", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-command-line-options", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -8542,12 +8652,12 @@ "option": "drive" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-migrate-capabilities", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -8625,12 +8735,12 @@ "capability": "validate-uuid" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-qmp-schema", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -21201,12 +21311,12 @@ ] } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-gic-capabilities", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -21222,7 +21332,7 @@ "kernel": false } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -21233,7 +21343,7 @@ "name": "host" } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -21263,7 +21373,7 @@ } } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -21277,11 +21387,11 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "GenericError", "desc": "Parameter 'migratable' is unexpected" diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.replies b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.replies index 2414105e25..95ec00a651 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.replies +++ b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.replies @@ -5895,12 +5895,122 @@ "id": "libvirt-30" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-31" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-31" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -5965,7 +6075,7 @@ "type": "bool" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -5973,7 +6083,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -6037,12 +6147,12 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-machines", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -6304,7 +6414,7 @@ "deprecated": false } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -6312,7 +6422,7 @@ "arguments": { "typename": "pseries-4.2-machine" }, - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -6511,12 +6621,12 @@ "type": "string" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-cpu-definitions", - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -8712,34 +8822,34 @@ "static": false } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-tpm-models", - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-types", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-command-line-options", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -9878,12 +9988,12 @@ "option": "drive" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-migrate-capabilities", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -9961,12 +10071,12 @@ "capability": "validate-uuid" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-qmp-schema", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -22195,7 +22305,7 @@ ] } ], - "id": "libvirt-40" + "id": "libvirt-41" } { diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.replies index b9481b6f85..c09ebb5460 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.replies @@ -5576,12 +5576,122 @@ "id": "libvirt-34" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-35" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-35" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -5646,7 +5756,7 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -5654,7 +5764,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5718,7 +5828,7 @@ "type": "int" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5726,7 +5836,7 @@ "arguments": { "typename": "max-x86_64-cpu" }, - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -7280,12 +7390,12 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-machines", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -7677,12 +7787,12 @@ "deprecated": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-cpu-definitions", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -9065,12 +9175,12 @@ "migration-safe": true } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-tpm-models", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -9078,12 +9188,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-tpm-types", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -9091,12 +9201,12 @@ "passthrough", "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-command-line-options", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -10382,12 +10492,12 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-migrate-capabilities", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -10465,12 +10575,12 @@ "capability": "validate-uuid" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-qmp-schema", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -23389,16 +23499,16 @@ ] } ], - "id": "libvirt-44" + "id": "libvirt-45" } { "execute": "query-sev-capabilities", - "id": "libvirt-45" + "id": "libvirt-46" } { - "id": "libvirt-45", + "id": "libvirt-46", "error": { "class": "GenericError", "desc": "SEV feature is not available" @@ -23413,7 +23523,7 @@ "name": "host" } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -23715,7 +23825,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -23729,7 +23839,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -24031,7 +24141,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.replies b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.replies index a3136a0966..067cbb7e31 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.replies @@ -6476,12 +6476,122 @@ "id": "libvirt-29" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-30" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -6546,7 +6656,7 @@ "type": "bool" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -6554,7 +6664,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -6618,7 +6728,7 @@ "type": "bool" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -6626,7 +6736,7 @@ "arguments": { "typename": "max-arm-cpu" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -6826,12 +6936,12 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-machines", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -7411,7 +7521,7 @@ "deprecated": false } ], - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -7419,7 +7529,7 @@ "arguments": { "typename": "virt-5.0-machine" }, - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -7557,12 +7667,12 @@ "type": "child<cfi.pflash01>" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-cpu-definitions", - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -7758,34 +7868,34 @@ "static": false } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-tpm-models", - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-types", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-command-line-options", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -8943,12 +9053,12 @@ "option": "drive" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-migrate-capabilities", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -9026,12 +9136,12 @@ "capability": "validate-uuid" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-qmp-schema", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -21768,12 +21878,12 @@ ] } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-gic-capabilities", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -21789,7 +21899,7 @@ "kernel": false } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -21800,7 +21910,7 @@ "name": "host" } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -21831,7 +21941,7 @@ } } }, - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -21845,11 +21955,11 @@ } } }, - "id": "libvirt-43" + "id": "libvirt-44" } { - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "GenericError", "desc": "Parameter 'migratable' is unexpected" diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.replies b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.replies index 9e54e1f9f6..8e754bfb80 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.replies +++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.replies @@ -6525,12 +6525,122 @@ "id": "libvirt-31" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-32" +} + +{ + "return": [ + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "name": "aer_log_max", + "type": "uint16" + }, + { + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "name": "slot", + "type": "uint16" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "port", + "type": "uint8" + }, + { + "name": "mem-reserve", + "type": "size" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "pref64-reserve", + "type": "size" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "chassis", + "type": "uint8" + }, + { + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "name": "pref32-reserve", + "type": "size" + }, + { + "name": "bus-reserve", + "type": "uint32" + }, + { + "name": "x-migrate-msix", + "type": "bool" + }, + { + "name": "disable-acs", + "type": "bool" + }, + { + "name": "io-reserve", + "type": "size" + } + ], + "id": "libvirt-32" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -6600,7 +6710,7 @@ "type": "bool" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -6608,7 +6718,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -6677,12 +6787,12 @@ "type": "bool" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { "execute": "query-machines", - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -6952,7 +7062,7 @@ "deprecated": false } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -6960,7 +7070,7 @@ "arguments": { "typename": "pseries-5.0-machine" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -7169,12 +7279,12 @@ "type": "string" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-cpu-definitions", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -9380,24 +9490,24 @@ "static": false } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-tpm-models", - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "tpm-spapr" ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-tpm-types", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -9405,12 +9515,12 @@ "passthrough", "emulator" ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-command-line-options", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -10487,12 +10597,12 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-migrate-capabilities", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -10570,12 +10680,12 @@ "capability": "validate-uuid" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-qmp-schema", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -23336,7 +23446,7 @@ ] } ], - "id": "libvirt-41" + "id": "libvirt-42" } { diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.replies index 95a7d62f5a..af2299a41e 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.replies @@ -6041,12 +6041,141 @@ "id": "libvirt-34" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "pcie-root-port" + }, + "id": "libvirt-35" +} + +{ + "return": [ + { + "name": "romfile", + "type": "str" + }, + { + "default-value": -1, + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or 06", + "type": "int32" + }, + { + "name": "failover_pair_id", + "type": "str" + }, + { + "default-value": true, + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 1, + "name": "rombar", + "type": "uint32" + }, + { + "default-value": true, + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "default-value": false, + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "port", + "type": "uint8" + }, + { + "default-value": 8, + "name": "aer_log_max", + "type": "uint16" + }, + { + "default-value": true, + "name": "hotplug", + "type": "bool" + }, + { + "default-value": 0, + "name": "slot", + "type": "uint16" + }, + { + "default-value": 0, + "name": "chassis", + "type": "uint8" + }, + { + "default-value": true, + "name": "power_controller_present", + "description": "on/off", + "type": "bool" + }, + { + "default-value": false, + "name": "disable-acs", + "type": "bool" + }, + { + "default-value": 18446744073709551615, + "name": "mem-reserve", + "type": "size" + }, + { + "default-value": 18446744073709551615, + "name": "pref64-reserve", + "type": "size" + }, + { + "default-value": 4294967295, + "name": "bus-reserve", + "type": "uint32" + }, + { + "default-value": "32", + "name": "x-width", + "description": "1/2/4/8/12/16/32", + "type": "PCIELinkWidth" + }, + { + "default-value": true, + "name": "x-migrate-msix", + "type": "bool" + }, + { + "default-value": 18446744073709551615, + "name": "io-reserve", + "type": "size" + }, + { + "default-value": "16", + "name": "x-speed", + "description": "2_5/5/8/16", + "type": "PCIELinkSpeed" + }, + { + "default-value": 18446744073709551615, + "name": "pref32-reserve", + "type": "size" + } + ], + "id": "libvirt-35" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -6116,7 +6245,7 @@ "type": "bool" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -6124,7 +6253,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -6193,7 +6322,7 @@ "type": "int" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -6201,7 +6330,7 @@ "arguments": { "typename": "max-x86_64-cpu" }, - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -7767,12 +7896,12 @@ "type": "bool" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-machines", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -8148,12 +8277,12 @@ "deprecated": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "execute": "query-cpu-definitions", - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -9665,12 +9794,12 @@ "migration-safe": true } ], - "id": "libvirt-39" + "id": "libvirt-40" } { "execute": "query-tpm-models", - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -9678,12 +9807,12 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-40" + "id": "libvirt-41" } { "execute": "query-tpm-types", - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -9691,12 +9820,12 @@ "passthrough", "emulator" ], - "id": "libvirt-41" + "id": "libvirt-42" } { "execute": "query-command-line-options", - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -10972,12 +11101,12 @@ "option": "drive" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { "execute": "query-migrate-capabilities", - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -11055,12 +11184,12 @@ "capability": "validate-uuid" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { "execute": "query-qmp-schema", - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -24788,16 +24917,16 @@ ] } ], - "id": "libvirt-44" + "id": "libvirt-45" } { "execute": "query-sev-capabilities", - "id": "libvirt-45" + "id": "libvirt-46" } { - "id": "libvirt-45", + "id": "libvirt-46", "error": { "class": "GenericError", "desc": "SEV feature is not available" @@ -24812,7 +24941,7 @@ "name": "host" } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -25115,7 +25244,7 @@ } } }, - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -25129,7 +25258,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -25432,7 +25561,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml index df3557d1ad..2f89f22c2b 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -228,6 +228,7 @@ <flag name='blockdev-snapshot.allow-write-only-overlay'/> <flag name='storage.werror'/> <flag name='fsdev.multidevs'/> + <flag name='pcie-root-port.hotplug'/> <version>4002091</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100241</microcodeVersion> -- 2.25.2

a <controller type='pci'...> element can now have a "hotplug" attribute in the <target> subelement. This is intended to control whether or not the slot(s) of the controller support hotplugging/unplugging a device: <controller type='pci' model='pcie-root-port'> <target hotplug='off'/> </controller> The default value of hotplug is "on". Since support for configuring such an option is hypervisor-dependent (and will vary among different types of PCI controllers even on a single hypervisor), no validation is done in this patch - that validation will be done in the patch that wires support for the setting into the hypervisor. Signed-off-by: Laine Stump <laine@redhat.com> --- docs/formatdomain.html.in | 11 ++++ docs/schemas/domaincommon.rng | 5 ++ src/conf/domain_conf.c | 20 +++++- src/conf/domain_conf.h | 1 + .../pcie-root-port-nohotplug.xml | 35 ++++++++++ .../pcie-root-port-nohotplug.xml | 64 +++++++++++++++++++ tests/qemuxml2xmltest.c | 7 ++ 7 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/pcie-root-port-nohotplug.xml create mode 100644 tests/qemuxml2xmloutdata/pcie-root-port-nohotplug.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index fbffb16866..341f7c78dc 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4706,6 +4706,17 @@ which is visible to the virtual machine. If set, port must be between 0 and 255. </dd> + <dt><code>hotplug</code></dt> + <dd> + pcie-root-port and pcie-switch-downstream-port controllers can + also have a <code>hotplug</code> attribute in + the <code><target></code> subelement, which is used to + disable hotplug/unplug of devices on a particular + controller. The default setting of <code>hotplug</code> + is <code>on</code>; it should be set to <code>off</code> to + disable hotplug/unplug of devices on a particular controller. + <span class="since">Since 6.3.0</span> + </dd> <dt><code>busNr</code></dt> <dd> pci-expander-bus and pcie-expander-bus controllers can have an diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index dcf2e09db8..7db32ec5c0 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2475,6 +2475,11 @@ <ref name='uint8'/> </attribute> </optional> + <optional> + <attribute name='hotplug'> + <ref name="virOnOff"/> + </attribute> + </optional> <optional> <element name='node'> <ref name='unsignedInt'/> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 460f8064be..4c81579eaf 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11035,6 +11035,7 @@ virDomainControllerDefParseXML(virDomainXMLOptionPtr xmlopt, g_autofree char *port = NULL; g_autofree char *busNr = NULL; g_autofree char *targetIndex = NULL; + g_autofree char *hotplug = NULL; g_autofree char *ioeventfd = NULL; g_autofree char *portsStr = NULL; g_autofree char *iothread = NULL; @@ -11106,6 +11107,7 @@ virDomainControllerDefParseXML(virDomainXMLOptionPtr xmlopt, chassis = virXMLPropString(cur, "chassis"); port = virXMLPropString(cur, "port"); busNr = virXMLPropString(cur, "busNr"); + hotplug = virXMLPropString(cur, "hotplug"); targetIndex = virXMLPropString(cur, "index"); processedTarget = true; } @@ -11342,6 +11344,17 @@ virDomainControllerDefParseXML(virDomainXMLOptionPtr xmlopt, } def->opts.pciopts.numaNode = numaNode; } + if (hotplug) { + int val = virTristateSwitchTypeFromString(hotplug); + + if (val <= 0) { + virReportError(VIR_ERR_XML_ERROR, + _("PCI controller unrecognized hotplug setting '%s'"), + hotplug); + goto error; + } + def->opts.pciopts.hotplug = val; + } break; case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: { g_autofree char *gntframes = virXMLPropString(node, "maxGrantFrames"); @@ -25333,7 +25346,8 @@ virDomainControllerDefFormat(virBufferPtr buf, def->opts.pciopts.port != -1 || def->opts.pciopts.busNr != -1 || def->opts.pciopts.targetIndex != -1 || - def->opts.pciopts.numaNode != -1) { + def->opts.pciopts.numaNode != -1 || + def->opts.pciopts.hotplug != VIR_TRISTATE_SWITCH_ABSENT) { virBufferAddLit(&childBuf, "<target"); if (def->opts.pciopts.chassisNr != -1) virBufferAsprintf(&childBuf, " chassisNr='%d'", @@ -25350,6 +25364,10 @@ virDomainControllerDefFormat(virBufferPtr buf, if (def->opts.pciopts.targetIndex != -1) virBufferAsprintf(&childBuf, " index='%d'", def->opts.pciopts.targetIndex); + if (def->opts.pciopts.hotplug != VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&childBuf, " hotplug='%s'", + virTristateSwitchTypeToString(def->opts.pciopts.hotplug)); + } if (def->opts.pciopts.numaNode == -1) { virBufferAddLit(&childBuf, "/>\n"); } else { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 2038b54c32..bd5aaeaef1 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -722,6 +722,7 @@ struct _virDomainPCIControllerOpts { * item in memory target config) -1 == unspecified */ int numaNode; + virTristateSwitch hotplug; /* 'off' to prevent hotplug/unplug, default 'on' */ }; struct _virDomainUSBControllerOpts { diff --git a/tests/qemuxml2argvdata/pcie-root-port-nohotplug.xml b/tests/qemuxml2argvdata/pcie-root-port-nohotplug.xml new file mode 100644 index 0000000000..8a01494470 --- /dev/null +++ b/tests/qemuxml2argvdata/pcie-root-port-nohotplug.xml @@ -0,0 +1,35 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='x86_64' machine='q35'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'/> + <controller type='pci' index='2' model='pcie-root-port'> + <target hotplug='off'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='ioh3420'/> + <target hotplug='off'/> + </controller> + <controller type='pci' index='4' model='pcie-switch-upstream-port'/> + <controller type='pci' index='5' model='pcie-switch-downstream-port'> + <target hotplug='off'/> + </controller> + <controller type='pci' index='6' model='pcie-switch-downstream-port'> + <target hotplug='on'/> + </controller> + <controller type='pci' index='7' model='pcie-switch-downstream-port'/> + <controller type='pci' index='8' model='pcie-switch-downstream-port'> + <model name='xio3130-downstream'/> + <target chassis='30' port='0x27'/> + </controller> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/pcie-root-port-nohotplug.xml b/tests/qemuxml2xmloutdata/pcie-root-port-nohotplug.xml new file mode 100644 index 0000000000..2ecb99728d --- /dev/null +++ b/tests/qemuxml2xmloutdata/pcie-root-port-nohotplug.xml @@ -0,0 +1,64 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='x86_64' machine='q35'>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-x86_64</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='0x10'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> + </controller> + <controller type='pci' index='2' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='2' port='0x11' hotplug='off'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> + </controller> + <controller type='pci' index='3' model='pcie-root-port'> + <model name='ioh3420'/> + <target chassis='3' port='0x12' hotplug='off'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> + </controller> + <controller type='pci' index='4' model='pcie-switch-upstream-port'> + <model name='x3130-upstream'/> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='5' model='pcie-switch-downstream-port'> + <model name='xio3130-downstream'/> + <target chassis='5' port='0x0' hotplug='off'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + </controller> + <controller type='pci' index='6' model='pcie-switch-downstream-port'> + <model name='xio3130-downstream'/> + <target chassis='6' port='0x1' hotplug='on'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x01' function='0x0'/> + </controller> + <controller type='pci' index='7' model='pcie-switch-downstream-port'> + <model name='xio3130-downstream'/> + <target chassis='7' port='0x2'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x02' function='0x0'/> + </controller> + <controller type='pci' index='8' model='pcie-switch-downstream-port'> + <model name='xio3130-downstream'/> + <target chassis='30' port='0x27'/> + <address type='pci' domain='0x0000' bus='0x04' slot='0x03' function='0x0'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index b4c83fccca..4b40468d15 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -960,6 +960,13 @@ mymain(void) DO_TEST("pcie-root-port-model-ioh3420", QEMU_CAPS_DEVICE_IOH3420); + DO_TEST("pcie-root-port-nohotplug", + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_DEVICE_X3130_UPSTREAM, + QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM, + QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG); + DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_DEVICE_X3130_UPSTREAM, -- 2.25.2

If a pcie-root-port or pcie-downstream-port has hotplug='off' in its <target> subelement, and if the qemu binary supports the hotplug=false option, then it will be added to the commandline for the pcie controller. This controller will then not allow any hotplug/unplug of devices while the guest is running (and the hotplug capability won't be advertised to the guest OS, so the guest OS also won't present unplugging of PCI devices as an option). <controller type='pci' model='pcie-root-port'> <target hotplug='off'/> </controller> For any PCI controllers other than pcie-downstream-port and pcie-root-port, of for qemu binaries that don't support the hotplug commandline option, an error will be logged during validation. Signed-off-by: Laine Stump <laine@redhat.com> --- src/qemu/qemu_command.c | 4 ++ src/qemu/qemu_validate.c | 31 +++++++++++++++ .../pcie-root-port-nohotplug.args | 39 +++++++++++++++++++ tests/qemuxml2argvtest.c | 7 ++++ 4 files changed, 81 insertions(+) create mode 100644 tests/qemuxml2argvdata/pcie-root-port-nohotplug.args diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index df90f5edf5..f619ef32be 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3016,6 +3016,10 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, virBufferAsprintf(&buf, "%s,port=0x%x,chassis=%d,id=%s", modelName, pciopts->port, pciopts->chassis, def->info.alias); + if (pciopts->hotplug != VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&buf, ",hotplug=%s", + virTristateSwitchTypeToString(pciopts->hotplug)); + } break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: virBufferAsprintf(&buf, "%s,index=%d,id=%s", diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 6f94361b52..49f9af69db 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2637,6 +2637,37 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, virReportEnumRangeError(virDomainControllerModelPCI, cont->model); } + /* hotplug */ + if (pciopts->hotplug != VIR_TRISTATE_SWITCH_ABSENT) { + switch ((virDomainControllerModelPCI) cont->model) { + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("setting the hotplug property on a '%s' device is not supported by this QEMU binary"), + modelName); + return -1; + } + break; + + case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: + case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: + case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE: + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: + case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS: + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS: + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE: + virReportControllerInvalidOption(cont, model, modelName, "hotplug"); + return -1; + + case VIR_DOMAIN_CONTROLLER_MODEL_PCI_DEFAULT: + case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: + default: + virReportEnumRangeError(virDomainControllerModelPCI, cont->model); + } + } + /* QEMU device availability */ if (cap < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, diff --git a/tests/qemuxml2argvdata/pcie-root-port-nohotplug.args b/tests/qemuxml2argvdata/pcie-root-port-nohotplug.args new file mode 100644 index 0000000000..3a4904c24f --- /dev/null +++ b/tests/qemuxml2argvdata/pcie-root-port-nohotplug.args @@ -0,0 +1,39 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-x86_64 \ +-name guest \ +-S \ +-machine q35,accel=tcg,usb=off,dump-guest-core=off \ +-m 2048 \ +-realtime mlock=off \ +-smp 2,sockets=2,cores=1,threads=1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ +server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,\ +multifunction=on,addr=0x2 \ +-device pcie-root-port,port=0x11,chassis=2,id=pci.2,hotplug=off,bus=pcie.0,\ +addr=0x2.0x1 \ +-device ioh3420,port=0x12,chassis=3,id=pci.3,hotplug=off,bus=pcie.0,\ +addr=0x2.0x2 \ +-device x3130-upstream,id=pci.4,bus=pci.1,addr=0x0 \ +-device xio3130-downstream,port=0x0,chassis=5,id=pci.5,hotplug=off,bus=pci.4,\ +addr=0x0 \ +-device xio3130-downstream,port=0x1,chassis=6,id=pci.6,hotplug=on,bus=pci.4,\ +addr=0x1 \ +-device xio3130-downstream,port=0x2,chassis=7,id=pci.7,bus=pci.4,addr=0x2 \ +-device xio3130-downstream,port=0x27,chassis=30,id=pci.8,bus=pci.4,addr=0x3 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index fdeb3c2e65..9a10528251 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2436,6 +2436,13 @@ mymain(void) DO_TEST("pcie-root-port-model-ioh3420", QEMU_CAPS_DEVICE_IOH3420); + DO_TEST("pcie-root-port-nohotplug", + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_DEVICE_X3130_UPSTREAM, + QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM, + QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG); + DO_TEST("autoindex", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, -- 2.25.2

On a Monday in 2020, Laine Stump wrote:
If a pcie-root-port or pcie-downstream-port has hotplug='off' in its <target> subelement, and if the qemu binary supports the hotplug=false option, then it will be added to the commandline for the pcie controller. This controller will then not allow any hotplug/unplug of devices while the guest is running (and the hotplug capability won't be advertised to the guest OS, so the guest OS also won't present unplugging of PCI devices as an option).
<controller type='pci' model='pcie-root-port'> <target hotplug='off'/> </controller>
For any PCI controllers other than pcie-downstream-port and pcie-root-port, of for qemu binaries that don't support the hotplug commandline option, an error will be logged during validation.
Signed-off-by: Laine Stump <laine@redhat.com> --- src/qemu/qemu_command.c | 4 ++ src/qemu/qemu_validate.c | 31 +++++++++++++++ .../pcie-root-port-nohotplug.args | 39 +++++++++++++++++++ tests/qemuxml2argvtest.c | 7 ++++ 4 files changed, 81 insertions(+) create mode 100644 tests/qemuxml2argvdata/pcie-root-port-nohotplug.args
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index df90f5edf5..f619ef32be 100644 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index fdeb3c2e65..9a10528251 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2436,6 +2436,13 @@ mymain(void) DO_TEST("pcie-root-port-model-ioh3420", QEMU_CAPS_DEVICE_IOH3420);
+ DO_TEST("pcie-root-port-nohotplug", + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_DEVICE_X3130_UPSTREAM, + QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM, + QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG); +
Can you use DO_TEST_CAPS_LATEST instead to verify this works with a real-world capability set? Jano
DO_TEST("autoindex", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, -- 2.25.2

Signed-off-by: Laine Stump <laine@redhat.com> --- docs/news.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 0d3f3386ec..4d0efd4219 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -44,6 +44,18 @@ <libvirt> <release version="v6.3.0" date="unreleased"> <section title="New features"> + <change> + <summary> + qemu: support disabling hotplug/unplug of PCIe devices + </summary> + <description> + libvirt can now set the "hotplug" option for pcie-root-ports + and pcie-switch-downstream-ports, which can be used to + disable hotplug/unplug of devices from these ports (default + behavior is for these controllers to accept all + hotplug/unplug attempts, but this is often undesireable). + </description> + </change> </section> <section title="Improvements"> </section> -- 2.25.2

This new flag will be set for any controller that we decide can have devices assigned to it automatically during PCI device assignment. In the past PCI_CONNECT_TYPE_HOTPLUGGABLE was used for this purpose, but that is overloading that flag, and no longer technically correct; what we *really* want is to auto-assign devices to any pcie-root-port or pcie-switch-downstream-port regardless of whether or not that controller happens to have hotplug enabled. This patch just adds the flag, but doesn't use it at all. Note that the numbering of all the other flags was changed in order to insert the new flag near the beginning of the list; that doesn't cause any problem because the connect flags aren't stored anywhere between runs of libvirtd. Signed-off-by: Laine Stump <laine@redhat.com> --- src/conf/domain_addr.h | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index dcb90618f8..40738ddb72 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -32,26 +32,27 @@ typedef enum { } virPCIDeviceAddressExtensionFlags; typedef enum { - VIR_PCI_CONNECT_HOTPLUGGABLE = 1 << 0, /* is hotplug needed/supported */ - - /* set for devices that can share a single slot in auto-assignment - * (by assigning one device to each of the 8 functions on the slot) - */ - VIR_PCI_CONNECT_AGGREGATE_SLOT = 1 << 1, - - /* kinds of devices as a bitmap so they can be combined (some PCI - * controllers permit connecting multiple types of devices) - */ - VIR_PCI_CONNECT_TYPE_PCI_DEVICE = 1 << 2, - VIR_PCI_CONNECT_TYPE_PCIE_DEVICE = 1 << 3, - VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT = 1 << 4, - VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT = 1 << 5, - VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_DOWNSTREAM_PORT = 1 << 6, - VIR_PCI_CONNECT_TYPE_DMI_TO_PCI_BRIDGE = 1 << 7, - VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS = 1 << 8, - VIR_PCI_CONNECT_TYPE_PCIE_EXPANDER_BUS = 1 << 9, - VIR_PCI_CONNECT_TYPE_PCI_BRIDGE = 1 << 10, - VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE = 1 << 11, + VIR_PCI_CONNECT_AUTOASSIGN = 1 << 0, /* okay to autoassign a device to this controller */ + VIR_PCI_CONNECT_HOTPLUGGABLE = 1 << 1, /* is hotplug needed/supported */ + + /* set for devices that can share a single slot in auto-assignment + * (by assigning one device to each of the 8 functions on the slot) + */ + VIR_PCI_CONNECT_AGGREGATE_SLOT = 1 << 2, + + /* kinds of devices as a bitmap so they can be combined (some PCI + * controllers permit connecting multiple types of devices) + */ + VIR_PCI_CONNECT_TYPE_PCI_DEVICE = 1 << 3, + VIR_PCI_CONNECT_TYPE_PCIE_DEVICE = 1 << 4, + VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT = 1 << 5, + VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT = 1 << 6, + VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_DOWNSTREAM_PORT = 1 << 7, + VIR_PCI_CONNECT_TYPE_DMI_TO_PCI_BRIDGE = 1 << 8, + VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS = 1 << 9, + VIR_PCI_CONNECT_TYPE_PCIE_EXPANDER_BUS = 1 << 10, + VIR_PCI_CONNECT_TYPE_PCI_BRIDGE = 1 << 11, + VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE = 1 << 12, } virDomainPCIConnectFlags; /* a combination of all bits that describe the type of connections -- 2.25.2

When the HOTPLUGGABLE flag was originally added, it was set for all the PCI controllers that accepted hotplugged devices, and requested for all devices that were auto-assigned to a controller. While we're still autoassigning to the same list of controllers, those controllers may or may not support hotplug, so let's use the flag that fits what we're actually doing. Signed-off-by: Laine Stump <laine@redhat.com> --- src/conf/domain_addr.c | 18 +++++++++--------- src/qemu/qemu_domain_address.c | 14 +++++++------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index e8629b3ed8..effc223a12 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -362,8 +362,8 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr, * libvirt's assumptions about whether or not hotplug * capability will be required. */ - if (devFlags & VIR_PCI_CONNECT_HOTPLUGGABLE) - busFlags |= VIR_PCI_CONNECT_HOTPLUGGABLE; + if (devFlags & VIR_PCI_CONNECT_AUTOASSIGN) + busFlags |= VIR_PCI_CONNECT_AUTOASSIGN; /* if the device is a pci-bridge, allow manually * assigning to any bus that would also accept a * standard PCI device. @@ -419,8 +419,8 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr, addrStr, addr->bus, connectStr); return false; } - if ((devFlags & VIR_PCI_CONNECT_HOTPLUGGABLE) && - !(busFlags & VIR_PCI_CONNECT_HOTPLUGGABLE)) { + if ((devFlags & VIR_PCI_CONNECT_AUTOASSIGN) && + !(busFlags & VIR_PCI_CONNECT_AUTOASSIGN)) { if (reportError) { virReportError(errType, _("The device at PCI address %s requires " @@ -509,7 +509,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, */ switch (model) { case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: - bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE | + bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCI_DEVICE | VIR_PCI_CONNECT_TYPE_PCI_BRIDGE | VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS); @@ -517,14 +517,14 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: - bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE | + bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCI_DEVICE | VIR_PCI_CONNECT_TYPE_PCI_BRIDGE); bus->minSlot = 1; bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS: - bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE | + bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCI_DEVICE | VIR_PCI_CONNECT_TYPE_PCI_BRIDGE); bus->minSlot = 0; @@ -555,7 +555,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE: /* Same as pci-bridge: 32 hotpluggable traditional PCI slots (0-31), * the first of which is not usable because of the SHPC */ - bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE | + bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCI_DEVICE | VIR_PCI_CONNECT_TYPE_PCI_BRIDGE); bus->minSlot = 1; @@ -566,7 +566,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, /* provides one slot which is pcie, can be used by endpoint * devices, pcie-switch-upstream-ports or pcie-to-pci-bridges, * and is hotpluggable */ - bus->flags = (VIR_PCI_CONNECT_HOTPLUGGABLE | + bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCIE_DEVICE | VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT | VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE); diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index ab6bce19f4..f853d2003d 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -580,7 +580,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, virDomainPCIConnectFlags virtioFlags) { virDomainPCIConnectFlags pciFlags = (VIR_PCI_CONNECT_TYPE_PCI_DEVICE | - VIR_PCI_CONNECT_HOTPLUGGABLE); + VIR_PCI_CONNECT_AUTOASSIGN); switch ((virDomainDeviceType)dev->type) { case VIR_DOMAIN_DEVICE_CONTROLLER: { @@ -1072,17 +1072,17 @@ qemuDomainFillDevicePCIConnectFlagsIterInit(virDomainDefPtr def, if (qemuDomainHasPCIeRoot(def)) { data->pcieFlags = (VIR_PCI_CONNECT_TYPE_PCIE_DEVICE | - VIR_PCI_CONNECT_HOTPLUGGABLE); + VIR_PCI_CONNECT_AUTOASSIGN); } else { data->pcieFlags = (VIR_PCI_CONNECT_TYPE_PCI_DEVICE | - VIR_PCI_CONNECT_HOTPLUGGABLE); + VIR_PCI_CONNECT_AUTOASSIGN); } if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY)) { data->virtioFlags = data->pcieFlags; } else { data->virtioFlags = (VIR_PCI_CONNECT_TYPE_PCI_DEVICE | - VIR_PCI_CONNECT_HOTPLUGGABLE); + VIR_PCI_CONNECT_AUTOASSIGN); } } @@ -1736,7 +1736,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, virPCIDeviceAddress tmp_addr; bool qemuDeviceVideoUsable = virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); g_autofree char *addrStr = NULL; - virDomainPCIConnectFlags flags = (VIR_PCI_CONNECT_HOTPLUGGABLE + virDomainPCIConnectFlags flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCI_DEVICE); /* Verify that first IDE and USB controllers (if any) is on the PIIX3, fn 1 */ @@ -2673,7 +2673,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, * domain. */ virDomainDeviceInfo info = { - .pciConnectFlags = (VIR_PCI_CONNECT_HOTPLUGGABLE | + .pciConnectFlags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCI_DEVICE), .pciAddrExtFlags = VIR_PCI_ADDRESS_EXTENSION_NONE }; @@ -2714,7 +2714,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, addrs->nbuses > max_idx + 1 && qemuDomainHasPCIeRoot(def)) { virDomainDeviceInfo info = { - .pciConnectFlags = (VIR_PCI_CONNECT_HOTPLUGGABLE | + .pciConnectFlags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCIE_DEVICE), .pciAddrExtFlags = VIR_PCI_ADDRESS_EXTENSION_NONE }; -- 2.25.2

Old behavior: If the address was manually provided by config, copy device AUTOASSIGN flag into the bus flag, and then later on in the function *always* check for a match of the flags (which will always match if the address came from config, since we just copied it). New behavior: Don't mess with the bus flags - just directly check if the AUTOASSIGN flag matches in bus and dev, but only make the check if the address didn't come from config (i.e. it was auto-assigned by libvirt). Signed-off-by: Laine Stump <laine@redhat.com> --- src/conf/domain_addr.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index effc223a12..429550e970 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -358,18 +358,22 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr, */ if (busFlags & VIR_PCI_CONNECT_TYPES_ENDPOINT) busFlags |= VIR_PCI_CONNECT_TYPES_ENDPOINT; - /* Also allow manual specification of bus to override - * libvirt's assumptions about whether or not hotplug - * capability will be required. - */ - if (devFlags & VIR_PCI_CONNECT_AUTOASSIGN) - busFlags |= VIR_PCI_CONNECT_AUTOASSIGN; /* if the device is a pci-bridge, allow manually * assigning to any bus that would also accept a * standard PCI device. */ if (devFlags & VIR_PCI_CONNECT_TYPE_PCI_BRIDGE) devFlags |= VIR_PCI_CONNECT_TYPE_PCI_DEVICE; + } else if ((devFlags & VIR_PCI_CONNECT_AUTOASSIGN) && + !(busFlags & VIR_PCI_CONNECT_AUTOASSIGN)) { + if (reportError) { + virReportError(errType, + _("The device at PCI address %s was auto-assigned " + "this address, but the PCI controller " + "with index='%d' doesn't allow auto-assignment"), + addrStr, addr->bus); + } + return false; } /* If this bus doesn't allow the type of connection (PCI @@ -419,17 +423,6 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr, addrStr, addr->bus, connectStr); return false; } - if ((devFlags & VIR_PCI_CONNECT_AUTOASSIGN) && - !(busFlags & VIR_PCI_CONNECT_AUTOASSIGN)) { - if (reportError) { - virReportError(errType, - _("The device at PCI address %s requires " - "hotplug capability, but the PCI controller " - "with index='%d' doesn't support hotplug"), - addrStr, addr->bus); - } - return false; - } return true; } -- 2.25.2

virDomainPCIAddressBusSetModel() is called for each PCI controller when building an address set prior to assiging PCI addresses to devices. This patch adds a new argument, allowHotplug, to that function that can be set to false if we know for certain that a particular controller won't support hotplug The most interesting case is in qemuDomainPCIAddressSetCreate(), where the config of each existing controller is available while building the address set, so we can appropriately set allowHotplug = false when the user has "hotplug='off'" in the config of a controller that normally would support hotplug. In all other cases, it is set to true or false in accordance with the capability of the controller model. So far we aren't doing anything with this bus flag in the address set. Signed-off-by: Laine Stump <laine@redhat.com> --- src/conf/domain_addr.c | 31 +++++++++++++++++++++---------- src/conf/domain_addr.h | 3 ++- src/qemu/qemu_domain_address.c | 10 +++++++--- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 429550e970..b58989ac8b 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -495,31 +495,40 @@ virDomainPCIAddressValidate(virDomainPCIAddressSetPtr addrs, int virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, - virDomainControllerModelPCI model) + virDomainControllerModelPCI model, + bool allowHotplug) { /* set flags for what can be connected *downstream* from each * bus. */ + virDomainPCIConnectFlags hotplugFlag = 0; + + if (allowHotplug) + hotplugFlag = VIR_PCI_CONNECT_HOTPLUGGABLE; + switch (model) { case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCI_DEVICE | VIR_PCI_CONNECT_TYPE_PCI_BRIDGE | - VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS); + VIR_PCI_CONNECT_TYPE_PCI_EXPANDER_BUS | + hotplugFlag); bus->minSlot = 1; bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCI_DEVICE | - VIR_PCI_CONNECT_TYPE_PCI_BRIDGE); + VIR_PCI_CONNECT_TYPE_PCI_BRIDGE | + hotplugFlag); bus->minSlot = 1; bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS: bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCI_DEVICE | - VIR_PCI_CONNECT_TYPE_PCI_BRIDGE); + VIR_PCI_CONNECT_TYPE_PCI_BRIDGE | + hotplugFlag); bus->minSlot = 0; bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST; break; @@ -550,7 +559,8 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, * the first of which is not usable because of the SHPC */ bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCI_DEVICE | - VIR_PCI_CONNECT_TYPE_PCI_BRIDGE); + VIR_PCI_CONNECT_TYPE_PCI_BRIDGE | + hotplugFlag); bus->minSlot = 1; bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST; break; @@ -562,7 +572,8 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, bus->flags = (VIR_PCI_CONNECT_AUTOASSIGN | VIR_PCI_CONNECT_TYPE_PCIE_DEVICE | VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT | - VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE); + VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE | + hotplugFlag); bus->minSlot = 0; bus->maxSlot = 0; break; @@ -759,7 +770,7 @@ virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs, * rest are of the requested type */ if (virDomainPCIAddressBusSetModel(&addrs->buses[i++], - VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE) < 0) { + VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE, false) < 0) { return -1; } } @@ -776,20 +787,20 @@ virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs, * will be allocated for the dummy PCIe device later on. */ if (virDomainPCIAddressBusSetModel(&addrs->buses[i], - VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT) < 0) { + VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT, true) < 0) { return -1; } addrs->buses[i].flags = VIR_PCI_CONNECT_TYPE_PCIE_TO_PCI_BRIDGE; i++; if (virDomainPCIAddressBusSetModel(&addrs->buses[i++], - VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE) < 0) { + VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE, true) < 0) { return -1; } } for (; i < addrs->nbuses; i++) { - if (virDomainPCIAddressBusSetModel(&addrs->buses[i], model) < 0) + if (virDomainPCIAddressBusSetModel(&addrs->buses[i], model, true) < 0) return -1; } diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 40738ddb72..c1363c1490 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -148,7 +148,8 @@ bool virDomainPCIAddressValidate(virDomainPCIAddressSetPtr addrs, int virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, - virDomainControllerModelPCI model) + virDomainControllerModelPCI model, + bool allowHotplug) ATTRIBUTE_NONNULL(1); bool virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index f853d2003d..07431343ed 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1652,6 +1652,7 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def, for (i = 0; i < def->ncontrollers; i++) { virDomainControllerDefPtr cont = def->controllers[i]; size_t idx = cont->idx; + bool allowHotplug = false; if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_PCI) continue; @@ -1663,7 +1664,10 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def, goto error; } - if (virDomainPCIAddressBusSetModel(&addrs->buses[idx], cont->model) < 0) + if (cont->opts.pciopts.hotplug != VIR_TRISTATE_SWITCH_OFF) + allowHotplug = true; + + if (virDomainPCIAddressBusSetModel(&addrs->buses[idx], cont->model, allowHotplug) < 0) goto error; /* Forward the information about isolation groups */ @@ -1681,7 +1685,7 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def, * assigning addresses to devices. */ if (virDomainPCIAddressBusSetModel(&addrs->buses[0], - VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) < 0) + VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT, true) < 0) goto error; } @@ -1703,7 +1707,7 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def, if (addrs->buses[i].model) continue; - if (virDomainPCIAddressBusSetModel(&addrs->buses[i], defaultModel) < 0) + if (virDomainPCIAddressBusSetModel(&addrs->buses[i], defaultModel, true) < 0) goto error; VIR_DEBUG("Auto-adding <controller type='pci' model='%s' index='%zu'/>", -- 2.25.2

The HOTPLUGGABLE flag is set for appropriates buses in a PCI address set, and thnis patch updates virDomainPCIAddressFlagsCompatible() to check the HOTPLUGGABLE flag when searching for a suitable bus/slot for a device. No devices request HOTPLUGGABLE though (yet), so there is no observable effect. Signed-off-by: Laine Stump <laine@redhat.com> --- src/conf/domain_addr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index b58989ac8b..580cf7e64d 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -376,6 +376,18 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr, return false; } + if ((devFlags & VIR_PCI_CONNECT_HOTPLUGGABLE) && + !(busFlags & VIR_PCI_CONNECT_HOTPLUGGABLE)) { + if (reportError) { + virReportError(errType, + _("The device at PCI address %s requires " + "hotplug capability, but the PCI controller " + "with index='%d' doesn't support hotplug"), + addrStr, addr->bus); + } + return false; + } + /* If this bus doesn't allow the type of connection (PCI * vs. PCIe) required by the device, or if the device requires * hot-plug and this bus doesn't have it, return false. -- 2.25.2

Before this patch we would simply rely on QEMU failing to attach the device. Since we have a flag in the address set telling us which controllers support hotplug, we can fail the operation sooner. This also assures that when hotplugging with no provided PCI address, that we skip any controllers with hotplug='off', and attempt to assign the device to a controller that not only supports hotplug, but also has it enabled. Signed-off-by: Laine Stump <laine@redhat.com> --- src/conf/domain_addr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 580cf7e64d..5652bc9a33 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -931,6 +931,11 @@ virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs, if (!flags) return 0; + /* This function is only called during hotplug, so we require hotplug + * support from the controller. + */ + flags |= VIR_PCI_CONNECT_HOTPLUGGABLE; + if (!(addrStr = virPCIDeviceAddressAsString(&dev->addr.pci))) return -1; -- 2.25.2

On 6. 4. 2020 15:51, Laine Stump wrote:
This series enables use of QEMU 5.0's new "hotplug=off" setting for pcie-root-ports and pcie-switch-downstream-ports. When set (in the <target> subelement of the <controller> config), the emulated controller will report to the guest OS that devices cannot be hotplugged into or, maybe more importantly, out of the port. The result is that when a device is plugged into such a port at boot time, "certain guest OSes" won't show a menu to all users listing all PCIe devices as available to "Safely Remove".
I had to hand-edit several capabilities results files in patch 1, since the pcie-root-port device has been present in QEMU for a long time, but we previously had not been gathering the list of options for that device. If someone has a setup to regenerate *actual* results for all those versions of QEMU, I would be very appreciative and gladly use that instead (Hi Kyle Two!)
NB: the last 3 patches are each trivial, and I'd be happy to squash them, but had already committed them separately, and thought it helped in explaining.
This resolves https://bugzilla.redhat.com/1802592
Laine Stump (10): qemu: new capabilities flag pcie-root-port.hotplug conf: new attribute "hotplug" for pci controllers qemu: hook up pcie-root-port hotplug='off' option docs: mention hotplug='off' in news.xml conf: add new PCI_CONNECT flag AUTOASSIGN conf/qemu: s/VIR_PCI_CONNECT_HOTPLUGGABLE/VIR_PCI_CONNECT_AUTOASSIGN/g conf: simplify logic when checking for AUTOASSIGN PCI addresses qemu/conf: set HOTPLUGGABLE connect flag during PCI address set init conf: check HOTPLUGGABLE connect flag when validating a PCI address conf: during PCI hotplug, require that the controller support hotplug
docs/formatdomain.html.in | 11 ++ docs/news.xml | 12 ++ docs/schemas/domaincommon.rng | 5 + src/conf/domain_addr.c | 85 ++++---- src/conf/domain_addr.h | 44 +++-- src/conf/domain_conf.c | 20 +- src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 8 + src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 4 + src/qemu/qemu_domain_address.c | 24 ++- src/qemu/qemu_validate.c | 31 +++ .../caps_2.10.0.aarch64.replies | 142 ++++++++++++-- .../caps_2.10.0.x86_64.replies | 154 ++++++++++++--- .../caps_2.11.0.x86_64.replies | 154 ++++++++++++--- .../caps_2.12.0.aarch64.replies | 158 ++++++++++++--- .../caps_2.12.0.x86_64.replies | 170 +++++++++++++--- .../caps_2.9.0.x86_64.replies | 154 ++++++++++++--- .../caps_3.0.0.x86_64.replies | 170 +++++++++++++--- .../caps_3.1.0.x86_64.replies | 170 +++++++++++++--- .../caps_4.0.0.aarch64.replies | 158 ++++++++++++--- .../caps_4.0.0.ppc64.replies | 150 +++++++++++++-- .../caps_4.0.0.riscv32.replies | 150 +++++++++++++-- .../caps_4.0.0.riscv64.replies | 150 +++++++++++++-- .../caps_4.0.0.x86_64.replies | 170 +++++++++++++--- .../caps_4.1.0.x86_64.replies | 162 +++++++++++++--- .../caps_4.2.0.aarch64.replies | 166 +++++++++++++--- .../caps_4.2.0.ppc64.replies | 150 +++++++++++++-- .../caps_4.2.0.x86_64.replies | 162 +++++++++++++--- .../caps_5.0.0.aarch64.replies | 166 +++++++++++++--- .../caps_5.0.0.ppc64.replies | 150 +++++++++++++-- .../caps_5.0.0.x86_64.replies | 181 +++++++++++++++--- .../caps_5.0.0.x86_64.xml | 1 + .../pcie-root-port-nohotplug.args | 39 ++++ .../pcie-root-port-nohotplug.xml | 35 ++++ tests/qemuxml2argvtest.c | 7 + .../pcie-root-port-nohotplug.xml | 64 +++++++ tests/qemuxml2xmltest.c | 7 + 38 files changed, 3038 insertions(+), 548 deletions(-) create mode 100644 tests/qemuxml2argvdata/pcie-root-port-nohotplug.args create mode 100644 tests/qemuxml2argvdata/pcie-root-port-nohotplug.xml create mode 100644 tests/qemuxml2xmloutdata/pcie-root-port-nohotplug.xml
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal
participants (3)
-
Ján Tomko
-
Laine Stump
-
Michal Prívozník