[PATCH 0/7] qemu XML testing improvements, part 3 - xmlout->xmlout testing and fixes

This series depends on the 'part 2' with cover letter's subject: [PATCH 00/23] qemu XML testing improvements, part 2 - enforcement of xml->xml testing both this along with the rebased prerequisite series can be fetched from: git fetch https://gitlab.com/pipo.sk/libvirt.git test-improvements-3 The main goal of part 3 is to add testing based on parsing of the libvirt-formatted files from tests/qemuxml2xmloutdata and formatting them back, and checking that they are identical. By adding this testing multiple problems in code auto-adding information was discovered. Peter Krempa (7): virDomainDefMaybeAddVirtioSerialController: Reformat hard to read linebreaks conf: domain: Insert auto-added controllers in same order as in XML parser virDomainAssignControllerIndexes: Ensure controller ordering after assigning indexes qemu: Move 'shmem' device size validation to qemu_validate qemuDomainAssignPCIAddresses: Assign extension addresses when auto-assigning PCI address virDomainDefAddConsoleCompat: Fix numbering of console targets after modification qemuxml2conftest: Test re-parsing of formatted XML src/conf/domain_conf.c | 26 ++++++++++--- src/conf/domain_postparse.c | 21 ++++++++++ src/qemu/qemu_command.c | 19 ---------- src/qemu/qemu_domain_address.c | 14 +++++-- src/qemu/qemu_validate.c | 9 +++++ .../autoindex.x86_64-latest.args | 4 +- .../channel-virtio-default.x86_64-latest.args | 2 +- .../channel-virtio-unix.x86_64-latest.args | 2 +- .../chardev-reconnect.x86_64-latest.args | 2 +- .../pci-autoadd-idx.x86_64-latest.args | 16 ++++---- .../pseries-many-buses-2.ppc64-latest.args | 4 +- .../shmem-invalid-size.x86_64-latest.err | 2 +- .../shmem-small-size.x86_64-latest.err | 2 +- .../aarch64-virt-graphics.aarch64-latest.xml | 6 +-- .../aarch64-virt-headless.aarch64-latest.xml | 6 +-- .../aarch64-virt-virtio.aarch64-4.2.0.xml | 6 +-- .../aarch64-virt-virtio.aarch64-latest.xml | 6 +-- ...rch64-virtio-pci-default.aarch64-4.2.0.xml | 6 +-- ...ch64-virtio-pci-default.aarch64-latest.xml | 6 +-- ...io-pci-manual-addresses.aarch64-latest.xml | 6 +-- .../arm-virt-virtio.aarch64-latest.xml | 6 +-- .../autoindex.x86_64-latest.xml | 12 +++--- .../channel-virtio-auto.x86_64-latest.xml | 2 +- .../channel-virtio-autoadd.x86_64-latest.xml | 2 +- .../channel-virtio-default.x86_64-latest.xml | 6 +-- .../channel-virtio-unix.x86_64-latest.xml | 6 +-- .../chardev-reconnect.x86_64-latest.xml | 6 +-- .../console-compat2.x86_64-latest.xml | 2 +- .../cpu-host-model-kvm.x86_64-4.2.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-5.0.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-5.1.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-5.2.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-6.0.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-6.1.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-6.2.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-7.0.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-7.1.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-7.2.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-8.0.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-8.1.0.xml | 12 +++--- .../cpu-host-model-kvm.x86_64-latest.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-4.2.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-5.0.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-5.1.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-5.2.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-6.0.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-6.1.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-6.2.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-7.0.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-7.1.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-7.2.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-8.0.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-8.1.0.xml | 12 +++--- .../cpu-host-model-tcg.x86_64-latest.xml | 12 +++--- .../disk-floppy-q35.x86_64-latest.xml | 8 ++-- ...dev-scsi-autogen-address.x86_64-latest.xml | 6 +-- ...tdev-vfio-zpci-boundaries.s390x-latest.xml | 4 +- ...f-aarch64-virt-headless.aarch64-latest.xml | 6 +-- .../hvf-x86_64-q35-headless.x86_64-latest.xml | 6 +-- ...ach-virt-console-virtio.aarch64-latest.xml | 6 +-- .../net-isolated-port.x86_64-latest.xml | 12 +++--- .../pci-autoadd-idx.x86_64-latest.xml | 22 +++++------ .../pcie-expander-bus.x86_64-latest.xml | 10 ++--- .../pcie-root.x86_64-latest.xml | 12 +++--- ...cie-switch-upstream-port.x86_64-latest.xml | 10 ++--- .../pcihole64-q35.x86_64-latest.xml | 12 +++--- .../pseries-many-buses-2.ppc64-latest.xml | 6 +-- ...eries-phb-default-missing.ppc64-latest.xml | 8 ++-- .../qemuxml2xmloutdata/q35.x86_64-latest.xml | 12 +++--- .../riscv64-virt-graphics.riscv64-latest.xml | 6 +-- .../riscv64-virt-headless.riscv64-latest.xml | 6 +-- .../shmem-invalid-size.x86_64-latest.xml | 34 ----------------- .../shmem-small-size.x86_64-latest.xml | 34 ----------------- .../user-aliases2.x86_64-latest.xml | 8 ++-- .../watchdog-q35-multiple.x86_64-latest.xml | 12 +++--- .../x86_64-q35-graphics.x86_64-latest.xml | 6 +-- .../x86_64-q35-headless.x86_64-latest.xml | 6 +-- tests/qemuxmlconftest.c | 38 ++++++++++++++++++- 78 files changed, 405 insertions(+), 404 deletions(-) delete mode 100644 tests/qemuxml2xmloutdata/shmem-invalid-size.x86_64-latest.xml delete mode 100644 tests/qemuxml2xmloutdata/shmem-small-size.x86_64-latest.xml -- 2.43.0

Format the code the usual way despite having more than 80 columns so that it's easier to read. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_conf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 46c808b801..b70b774965 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21874,7 +21874,8 @@ virDomainDefMaybeAddVirtioSerialController(virDomainDef *def) idx = channel->info.addr.vioserial.controller; if (virDomainDefMaybeAddController(def, - VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL, idx, -1) < 0) + VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL, + idx, -1) < 0) return -1; } } @@ -21884,12 +21885,12 @@ virDomainDefMaybeAddVirtioSerialController(virDomainDef *def) if (console->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) { int idx = 0; - if (console->info.type == - VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL) + if (console->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL) idx = console->info.addr.vioserial.controller; if (virDomainDefMaybeAddController(def, - VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL, idx, -1) < 0) + VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL, + idx, -1) < 0) return -1; } } -- 2.43.0

'virDomainDefAddController' which is used in code-paths which auto-add controllers to the definition such as 'virDomainDefMaybeAddController', 'virDomainDefAddUSBController', 'qemuDomainDefAddDefaultDevices' was adding the controller at the end of the list. However that is not how the XML parser would order the controller in the list as it uses virDomainControllerInsert grouping them by type and additional properties. This would cause that auto-added controllers would re-order: - between first and any subsequent run of the VM (even on commandline) - after a libvirtd/virtqemud restart - after any update of the definition based on the 'define' operation (e.g. virsh edit) To ensure that the ordering of controllers is identical always use virDomainControllerInsert. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_conf.c | 2 +- .../channel-virtio-default.x86_64-latest.args | 2 +- .../channel-virtio-unix.x86_64-latest.args | 2 +- .../chardev-reconnect.x86_64-latest.args | 2 +- .../pci-autoadd-idx.x86_64-latest.args | 16 +++++++------- .../pseries-many-buses-2.ppc64-latest.args | 4 ++-- .../aarch64-virt-graphics.aarch64-latest.xml | 6 ++--- .../aarch64-virt-headless.aarch64-latest.xml | 6 ++--- .../aarch64-virt-virtio.aarch64-4.2.0.xml | 6 ++--- .../aarch64-virt-virtio.aarch64-latest.xml | 6 ++--- ...rch64-virtio-pci-default.aarch64-4.2.0.xml | 6 ++--- ...ch64-virtio-pci-default.aarch64-latest.xml | 6 ++--- ...io-pci-manual-addresses.aarch64-latest.xml | 6 ++--- .../arm-virt-virtio.aarch64-latest.xml | 6 ++--- .../channel-virtio-auto.x86_64-latest.xml | 2 +- .../channel-virtio-autoadd.x86_64-latest.xml | 2 +- .../channel-virtio-default.x86_64-latest.xml | 6 ++--- .../channel-virtio-unix.x86_64-latest.xml | 6 ++--- .../chardev-reconnect.x86_64-latest.xml | 6 ++--- .../cpu-host-model-kvm.x86_64-4.2.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-5.0.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-5.1.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-5.2.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-6.0.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-6.1.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-6.2.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-7.0.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-7.1.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-7.2.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-8.0.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-8.1.0.xml | 12 +++++----- .../cpu-host-model-kvm.x86_64-latest.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-4.2.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-5.0.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-5.1.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-5.2.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-6.0.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-6.1.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-6.2.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-7.0.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-7.1.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-7.2.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-8.0.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-8.1.0.xml | 12 +++++----- .../cpu-host-model-tcg.x86_64-latest.xml | 12 +++++----- .../disk-floppy-q35.x86_64-latest.xml | 8 +++---- ...dev-scsi-autogen-address.x86_64-latest.xml | 6 ++--- ...f-aarch64-virt-headless.aarch64-latest.xml | 6 ++--- .../hvf-x86_64-q35-headless.x86_64-latest.xml | 6 ++--- ...ach-virt-console-virtio.aarch64-latest.xml | 6 ++--- .../net-isolated-port.x86_64-latest.xml | 12 +++++----- .../pci-autoadd-idx.x86_64-latest.xml | 22 +++++++++---------- .../pcie-expander-bus.x86_64-latest.xml | 10 ++++----- .../pcie-root.x86_64-latest.xml | 12 +++++----- ...cie-switch-upstream-port.x86_64-latest.xml | 10 ++++----- .../pcihole64-q35.x86_64-latest.xml | 12 +++++----- .../pseries-many-buses-2.ppc64-latest.xml | 6 ++--- ...eries-phb-default-missing.ppc64-latest.xml | 8 +++---- .../qemuxml2xmloutdata/q35.x86_64-latest.xml | 12 +++++----- .../riscv64-virt-graphics.riscv64-latest.xml | 6 ++--- .../riscv64-virt-headless.riscv64-latest.xml | 6 ++--- .../user-aliases2.x86_64-latest.xml | 8 +++---- .../watchdog-q35-multiple.x86_64-latest.xml | 12 +++++----- .../x86_64-q35-graphics.x86_64-latest.xml | 6 ++--- .../x86_64-q35-headless.x86_64-latest.xml | 6 ++--- 65 files changed, 295 insertions(+), 295 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b70b774965..2283688ba0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16149,7 +16149,7 @@ virDomainDefAddController(virDomainDef *def, cont->idx = idx; cont->model = model; - VIR_APPEND_ELEMENT_COPY(def->controllers, def->ncontrollers, cont); + virDomainControllerInsert(def, cont); return cont; } diff --git a/tests/qemuxml2argvdata/channel-virtio-default.x86_64-latest.args b/tests/qemuxml2argvdata/channel-virtio-default.x86_64-latest.args index aec67fe1ae..193157ad0a 100644 --- a/tests/qemuxml2argvdata/channel-virtio-default.x86_64-latest.args +++ b/tests/qemuxml2argvdata/channel-virtio-default.x86_64-latest.args @@ -26,8 +26,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -no-shutdown \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ --device '{"driver":"virtio-serial-pci","id":"virtio-serial1","bus":"pci.0","addr":"0xa"}' \ -device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x3"}' \ +-device '{"driver":"virtio-serial-pci","id":"virtio-serial1","bus":"pci.0","addr":"0xa"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ diff --git a/tests/qemuxml2argvdata/channel-virtio-unix.x86_64-latest.args b/tests/qemuxml2argvdata/channel-virtio-unix.x86_64-latest.args index 131508cd9a..e7bacb617c 100644 --- a/tests/qemuxml2argvdata/channel-virtio-unix.x86_64-latest.args +++ b/tests/qemuxml2argvdata/channel-virtio-unix.x86_64-latest.args @@ -27,8 +27,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -no-shutdown \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ --device '{"driver":"virtio-serial-pci","id":"virtio-serial1","bus":"pci.0","addr":"0xa"}' \ -device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-serial-pci","id":"virtio-serial1","bus":"pci.0","addr":"0xa"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \ diff --git a/tests/qemuxml2argvdata/chardev-reconnect.x86_64-latest.args b/tests/qemuxml2argvdata/chardev-reconnect.x86_64-latest.args index 4f6ab7d2b9..b86eba21a2 100644 --- a/tests/qemuxml2argvdata/chardev-reconnect.x86_64-latest.args +++ b/tests/qemuxml2argvdata/chardev-reconnect.x86_64-latest.args @@ -27,8 +27,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -no-shutdown \ -boot strict=on \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ --device '{"driver":"virtio-serial-pci","id":"virtio-serial1","bus":"pci.0","addr":"0xa"}' \ -device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x2"}' \ +-device '{"driver":"virtio-serial-pci","id":"virtio-serial1","bus":"pci.0","addr":"0xa"}' \ -device '{"driver":"usb-ccid","id":"ccid0","bus":"usb.0","port":"1"}' \ -chardev socket,id=charsmartcard0,path=/var/lib/libvirt/qemu/channel/target/asdf,reconnect=20 \ -device '{"driver":"ccid-card-passthru","chardev":"charsmartcard0","id":"smartcard0","bus":"ccid0.0"}' \ diff --git a/tests/qemuxml2argvdata/pci-autoadd-idx.x86_64-latest.args b/tests/qemuxml2argvdata/pci-autoadd-idx.x86_64-latest.args index c4731e8e56..aa0a145fea 100644 --- a/tests/qemuxml2argvdata/pci-autoadd-idx.x86_64-latest.args +++ b/tests/qemuxml2argvdata/pci-autoadd-idx.x86_64-latest.args @@ -26,14 +26,14 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-fdr-br/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-bridge","chassis_nr":8,"id":"pci.8","bus":"pci.0","addr":"0x3"}' \ --device '{"driver":"pci-bridge","chassis_nr":1,"id":"pci.1","bus":"pci.0","addr":"0x4"}' \ --device '{"driver":"pci-bridge","chassis_nr":2,"id":"pci.2","bus":"pci.0","addr":"0x5"}' \ --device '{"driver":"pci-bridge","chassis_nr":3,"id":"pci.3","bus":"pci.0","addr":"0x6"}' \ --device '{"driver":"pci-bridge","chassis_nr":4,"id":"pci.4","bus":"pci.0","addr":"0x7"}' \ --device '{"driver":"pci-bridge","chassis_nr":5,"id":"pci.5","bus":"pci.0","addr":"0x8"}' \ --device '{"driver":"pci-bridge","chassis_nr":6,"id":"pci.6","bus":"pci.0","addr":"0x9"}' \ --device '{"driver":"pci-bridge","chassis_nr":7,"id":"pci.7","bus":"pci.0","addr":"0xa"}' \ +-device '{"driver":"pci-bridge","chassis_nr":1,"id":"pci.1","bus":"pci.0","addr":"0x3"}' \ +-device '{"driver":"pci-bridge","chassis_nr":2,"id":"pci.2","bus":"pci.0","addr":"0x4"}' \ +-device '{"driver":"pci-bridge","chassis_nr":3,"id":"pci.3","bus":"pci.0","addr":"0x5"}' \ +-device '{"driver":"pci-bridge","chassis_nr":4,"id":"pci.4","bus":"pci.0","addr":"0x6"}' \ +-device '{"driver":"pci-bridge","chassis_nr":5,"id":"pci.5","bus":"pci.0","addr":"0x7"}' \ +-device '{"driver":"pci-bridge","chassis_nr":6,"id":"pci.6","bus":"pci.0","addr":"0x8"}' \ +-device '{"driver":"pci-bridge","chassis_nr":7,"id":"pci.7","bus":"pci.0","addr":"0x9"}' \ +-device '{"driver":"pci-bridge","chassis_nr":8,"id":"pci.8","bus":"pci.0","addr":"0xa"}' \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ -blockdev '{"driver":"file","filename":"/var/iso/f18kde.iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw","file":"libvirt-1-storage"}' \ diff --git a/tests/qemuxml2argvdata/pseries-many-buses-2.ppc64-latest.args b/tests/qemuxml2argvdata/pseries-many-buses-2.ppc64-latest.args index 624b34b250..74e81b306c 100644 --- a/tests/qemuxml2argvdata/pseries-many-buses-2.ppc64-latest.args +++ b/tests/qemuxml2argvdata/pseries-many-buses-2.ppc64-latest.args @@ -26,8 +26,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"spapr-pci-host-bridge","index":1,"id":"pci.2"}' \ --device '{"driver":"spapr-pci-host-bridge","index":2,"id":"pci.1"}' \ +-device '{"driver":"spapr-pci-host-bridge","index":1,"id":"pci.1"}' \ +-device '{"driver":"spapr-pci-host-bridge","index":2,"id":"pci.2"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml index e00283cd6d..c7bddf4063 100644 --- a/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml +++ b/tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml @@ -42,9 +42,6 @@ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </controller> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -85,6 +82,9 @@ <target chassis='8' port='0xf'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x7'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:53:45:a5'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml index 70e84662b1..5029092842 100644 --- a/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml +++ b/tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml @@ -42,9 +42,6 @@ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </controller> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -80,6 +77,9 @@ <target chassis='7' port='0xe'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x6'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/aarch64-virt-virtio.aarch64-4.2.0.xml b/tests/qemuxml2xmloutdata/aarch64-virt-virtio.aarch64-4.2.0.xml index 41091952e2..3c657b4c91 100644 --- a/tests/qemuxml2xmloutdata/aarch64-virt-virtio.aarch64-4.2.0.xml +++ b/tests/qemuxml2xmloutdata/aarch64-virt-virtio.aarch64-4.2.0.xml @@ -33,9 +33,6 @@ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </disk> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -66,6 +63,9 @@ <target chassis='6' port='0xd'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/aarch64-virt-virtio.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virt-virtio.aarch64-latest.xml index 1ea25a01f5..347cf2ba65 100644 --- a/tests/qemuxml2xmloutdata/aarch64-virt-virtio.aarch64-latest.xml +++ b/tests/qemuxml2xmloutdata/aarch64-virt-virtio.aarch64-latest.xml @@ -33,9 +33,6 @@ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </disk> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -66,6 +63,9 @@ <target chassis='6' port='0xd'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-4.2.0.xml b/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-4.2.0.xml index 41091952e2..3c657b4c91 100644 --- a/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-4.2.0.xml +++ b/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-4.2.0.xml @@ -33,9 +33,6 @@ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </disk> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -66,6 +63,9 @@ <target chassis='6' port='0xd'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml index 1ea25a01f5..347cf2ba65 100644 --- a/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml +++ b/tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml @@ -33,9 +33,6 @@ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </disk> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -66,6 +63,9 @@ <target chassis='6' port='0xd'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.xml index 63c2636f5e..db33608d6d 100644 --- a/tests/qemuxml2xmloutdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.xml +++ b/tests/qemuxml2xmloutdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.xml @@ -42,9 +42,6 @@ <target chassisNr='2'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </controller> - <controller type='scsi' index='0' model='virtio-scsi'> - <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='3' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='3' port='0x10'/> @@ -60,6 +57,9 @@ <target chassis='5' port='0x12'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> </controller> + <controller type='scsi' index='0' model='virtio-scsi'> + <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/arm-virt-virtio.aarch64-latest.xml b/tests/qemuxml2xmloutdata/arm-virt-virtio.aarch64-latest.xml index ffe1e4d8b0..1ae2d28ca2 100644 --- a/tests/qemuxml2xmloutdata/arm-virt-virtio.aarch64-latest.xml +++ b/tests/qemuxml2xmloutdata/arm-virt-virtio.aarch64-latest.xml @@ -34,9 +34,6 @@ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </disk> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -67,6 +64,9 @@ <target chassis='6' port='0xd'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/channel-virtio-auto.x86_64-latest.xml b/tests/qemuxml2xmloutdata/channel-virtio-auto.x86_64-latest.xml index 0056916d3a..92c9dc76af 100644 --- a/tests/qemuxml2xmloutdata/channel-virtio-auto.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/channel-virtio-auto.x86_64-latest.xml @@ -35,10 +35,10 @@ <controller type='virtio-serial' index='1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </controller> - <controller type='pci' index='0' model='pci-root'/> <controller type='virtio-serial' index='2'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </controller> + <controller type='pci' index='0' model='pci-root'/> <channel type='pty'> <target type='virtio' name='org.linux-kvm.port.0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> diff --git a/tests/qemuxml2xmloutdata/channel-virtio-autoadd.x86_64-latest.xml b/tests/qemuxml2xmloutdata/channel-virtio-autoadd.x86_64-latest.xml index 06a9a06705..5e9072ffbf 100644 --- a/tests/qemuxml2xmloutdata/channel-virtio-autoadd.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/channel-virtio-autoadd.x86_64-latest.xml @@ -32,10 +32,10 @@ <controller type='virtio-serial' index='0' ports='4' vectors='4'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> - <controller type='pci' index='0' model='pci-root'/> <controller type='virtio-serial' index='1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </controller> + <controller type='pci' index='0' model='pci-root'/> <channel type='pty'> <target type='virtio' name='org.linux-kvm.port.0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> diff --git a/tests/qemuxml2xmloutdata/channel-virtio-default.x86_64-latest.xml b/tests/qemuxml2xmloutdata/channel-virtio-default.x86_64-latest.xml index 8558bf4c82..cb11f31522 100644 --- a/tests/qemuxml2xmloutdata/channel-virtio-default.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/channel-virtio-default.x86_64-latest.xml @@ -29,13 +29,13 @@ <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </controller> <controller type='virtio-serial' index='1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> - </controller> <channel type='pty'> <target type='virtio'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> diff --git a/tests/qemuxml2xmloutdata/channel-virtio-unix.x86_64-latest.xml b/tests/qemuxml2xmloutdata/channel-virtio-unix.x86_64-latest.xml index 9cce89d858..2cc17c666a 100644 --- a/tests/qemuxml2xmloutdata/channel-virtio-unix.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/channel-virtio-unix.x86_64-latest.xml @@ -29,13 +29,13 @@ <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </controller> <controller type='virtio-serial' index='1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </controller> <controller type='pci' index='0' model='pci-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </controller> <channel type='unix'> <target type='virtio' name='org.qemu.guest_agent.0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> diff --git a/tests/qemuxml2xmloutdata/chardev-reconnect.x86_64-latest.xml b/tests/qemuxml2xmloutdata/chardev-reconnect.x86_64-latest.xml index a49818488e..1458da0cc2 100644 --- a/tests/qemuxml2xmloutdata/chardev-reconnect.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/chardev-reconnect.x86_64-latest.xml @@ -17,6 +17,9 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </controller> <controller type='virtio-serial' index='1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </controller> @@ -24,9 +27,6 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <controller type='pci' index='0' model='pci-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </controller> <controller type='ccid' index='0'/> <smartcard mode='passthrough' type='unix'> <source mode='connect' path='/var/lib/libvirt/qemu/channel/target/asdf'> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-4.2.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-4.2.0.xml index edfc1696ed..10af5b281b 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-4.2.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-4.2.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.0.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.0.0.xml index 6e99b799cb..9eab4c8d86 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.0.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.0.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.1.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.1.0.xml index 258bdc3fbf..eb8ec4b78f 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.1.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.1.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.2.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.2.0.xml index e025fdbbfa..b5b6d7cfbf 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.2.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.2.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.0.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.0.0.xml index c624e0c352..a4cfe7f73a 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.0.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.0.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.1.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.1.0.xml index c28bfaf026..442fe867a0 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.1.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.1.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.2.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.2.0.xml index 9265aa9651..7e5a9d5d76 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.2.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.2.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.0.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.0.0.xml index 3e37b8b5cf..b158e2d158 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.0.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.0.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.1.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.1.0.xml index 4d80e22399..ed09a64c42 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.1.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.1.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.2.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.2.0.xml index 9637e7cd24..c9fb6ab762 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.2.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.2.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-8.0.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-8.0.0.xml index 53325fddbd..310f359af1 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-8.0.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-8.0.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-8.1.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-8.1.0.xml index 0506347661..b3db2e7d6c 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-8.1.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-8.1.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-latest.xml b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-latest.xml index 6b245f6b9d..677b0f16ef 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-latest.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-4.2.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-4.2.0.xml index 5090ed4251..247798eb94 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-4.2.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-4.2.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.0.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.0.0.xml index 86aa1e27d2..e4881a63e1 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.0.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.0.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.1.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.1.0.xml index 4d4fd90b27..4b783b2e92 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.1.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.1.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.2.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.2.0.xml index 4c334dcf20..d415870e0d 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.2.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.2.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.0.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.0.0.xml index 201891dcf1..f1d097531c 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.0.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.0.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.1.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.1.0.xml index 594ab46d39..a5117f5cc6 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.1.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.1.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.2.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.2.0.xml index 3cc3b1faf5..8adf1bccce 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.2.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.2.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.0.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.0.0.xml index b413ddeab6..9dff92b502 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.0.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.0.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.1.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.1.0.xml index fce26032b6..d6976bdd64 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.1.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.1.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.2.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.2.0.xml index e9508469e2..928014eadd 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.2.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.2.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-8.0.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-8.0.0.xml index 0c9da63ded..0602fb4074 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-8.0.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-8.0.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-8.1.0.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-8.1.0.xml index 7717d359a4..76490be279 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-8.1.0.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-8.1.0.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-latest.xml b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-latest.xml index 8089736d61..a02e8ed9bb 100644 --- a/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-latest.xml @@ -16,12 +16,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -37,6 +31,12 @@ <target chassis='3' port='0xa'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/disk-floppy-q35.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-floppy-q35.x86_64-latest.xml index cd6c0e3352..df6c4c6dbd 100644 --- a/tests/qemuxml2xmloutdata/disk-floppy-q35.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/disk-floppy-q35.x86_64-latest.xml @@ -33,10 +33,6 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> <controller type='pci' index='0' model='pcie-root'/> - <controller type='fdc' index='0'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -47,6 +43,10 @@ <target chassis='2' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> + <controller type='fdc' index='0'/> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/hostdev-scsi-autogen-address.x86_64-latest.xml b/tests/qemuxml2xmloutdata/hostdev-scsi-autogen-address.x86_64-latest.xml index a0cc4e1669..90abe475df 100644 --- a/tests/qemuxml2xmloutdata/hostdev-scsi-autogen-address.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/hostdev-scsi-autogen-address.x86_64-latest.xml @@ -26,6 +26,9 @@ <controller type='scsi' index='0' model='virtio-scsi'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </controller> + <controller type='scsi' index='1' model='virtio-scsi'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </controller> <controller type='usb' index='0' model='piix3-uhci'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> @@ -33,9 +36,6 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <controller type='pci' index='0' model='pci-root'/> - <controller type='scsi' index='1' model='virtio-scsi'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> - </controller> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.aarch64-latest.xml b/tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.aarch64-latest.xml index 5e4ebbdaa5..dba840237a 100644 --- a/tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.aarch64-latest.xml +++ b/tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.aarch64-latest.xml @@ -36,9 +36,6 @@ </disk> <controller type='usb' index='0' model='none'/> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -69,6 +66,9 @@ <target chassis='6' port='0xd'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:9a:e6:c6'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.x86_64-latest.xml b/tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.x86_64-latest.xml index b35ef7df9e..6c6c1ea8b0 100644 --- a/tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.x86_64-latest.xml @@ -43,9 +43,6 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -76,6 +73,9 @@ <target chassis='6' port='0xd'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:9a:e6:c6'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/mach-virt-console-virtio.aarch64-latest.xml b/tests/qemuxml2xmloutdata/mach-virt-console-virtio.aarch64-latest.xml index e1ff62f2c5..aede5caa3a 100644 --- a/tests/qemuxml2xmloutdata/mach-virt-console-virtio.aarch64-latest.xml +++ b/tests/qemuxml2xmloutdata/mach-virt-console-virtio.aarch64-latest.xml @@ -22,9 +22,6 @@ <emulator>/usr/bin/qemu-system-aarch64</emulator> <controller type='usb' index='0' model='none'/> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -35,6 +32,9 @@ <target chassis='2' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> <console type='pty'> <target type='virtio' port='0'/> </console> diff --git a/tests/qemuxml2xmloutdata/net-isolated-port.x86_64-latest.xml b/tests/qemuxml2xmloutdata/net-isolated-port.x86_64-latest.xml index cb3f7dbab6..196ea122d6 100644 --- a/tests/qemuxml2xmloutdata/net-isolated-port.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/net-isolated-port.x86_64-latest.xml @@ -24,12 +24,6 @@ <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x10'/> @@ -45,6 +39,12 @@ <target chassis='3' port='0x12'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> + </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> <interface type='network'> <mac address='52:54:00:d6:c0:0b'/> <source network='nat-network;plug-network-basic'/> diff --git a/tests/qemuxml2xmloutdata/pci-autoadd-idx.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pci-autoadd-idx.x86_64-latest.xml index 285a69c937..1da4c4bbaa 100644 --- a/tests/qemuxml2xmloutdata/pci-autoadd-idx.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/pci-autoadd-idx.x86_64-latest.xml @@ -35,45 +35,45 @@ <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> - <controller type='pci' index='8' model='pci-bridge'> - <model name='pci-bridge'/> - <target chassisNr='8'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> - </controller> <controller type='pci' index='0' model='pci-root'/> <controller type='pci' index='1' model='pci-bridge'> <model name='pci-bridge'/> <target chassisNr='1'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </controller> <controller type='pci' index='2' model='pci-bridge'> <model name='pci-bridge'/> <target chassisNr='2'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </controller> <controller type='pci' index='3' model='pci-bridge'> <model name='pci-bridge'/> <target chassisNr='3'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </controller> <controller type='pci' index='4' model='pci-bridge'> <model name='pci-bridge'/> <target chassisNr='4'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </controller> <controller type='pci' index='5' model='pci-bridge'> <model name='pci-bridge'/> <target chassisNr='5'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </controller> <controller type='pci' index='6' model='pci-bridge'> <model name='pci-bridge'/> <target chassisNr='6'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </controller> <controller type='pci' index='7' model='pci-bridge'> <model name='pci-bridge'/> <target chassisNr='7'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> + </controller> + <controller type='pci' index='8' model='pci-bridge'> + <model name='pci-bridge'/> + <target chassisNr='8'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </controller> <input type='mouse' bus='ps2'/> diff --git a/tests/qemuxml2xmloutdata/pcie-expander-bus.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pcie-expander-bus.x86_64-latest.xml index a441be8ebe..06c8eb97af 100644 --- a/tests/qemuxml2xmloutdata/pcie-expander-bus.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/pcie-expander-bus.x86_64-latest.xml @@ -205,17 +205,17 @@ <target chassis='35' port='0x1f'/> <address type='pci' domain='0x0000' bus='0x03' slot='0x1f' function='0x0'/> </controller> + <controller type='pci' index='36' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='36' port='0x8'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + </controller> <controller type='usb' index='0' model='qemu-xhci'> <address type='pci' domain='0x0000' bus='0x24' slot='0x00' function='0x0'/> </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> - <controller type='pci' index='36' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='36' port='0x8'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> - </controller> <interface type='user'> <mac address='52:54:00:f1:95:51'/> <model type='rtl8139'/> diff --git a/tests/qemuxml2xmloutdata/pcie-root.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pcie-root.x86_64-latest.xml index 7c2c9049c1..1c39c453b7 100644 --- a/tests/qemuxml2xmloutdata/pcie-root.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/pcie-root.x86_64-latest.xml @@ -18,12 +18,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -34,6 +28,12 @@ <target chassis='2' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/pcie-switch-upstream-port.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pcie-switch-upstream-port.x86_64-latest.xml index 14bc417fc4..1c92ca3cd6 100644 --- a/tests/qemuxml2xmloutdata/pcie-switch-upstream-port.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/pcie-switch-upstream-port.x86_64-latest.xml @@ -42,17 +42,17 @@ <model name='x3130-upstream'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </controller> + <controller type='pci' index='5' model='pcie-root-port'> + <model name='pcie-root-port'/> + <target chassis='5' port='0x12'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> + </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> <controller type='usb' index='0' model='qemu-xhci'> <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> </controller> - <controller type='pci' index='5' model='pcie-root-port'> - <model name='pcie-root-port'/> - <target chassis='5' port='0x12'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> - </controller> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/pcihole64-q35.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pcihole64-q35.x86_64-latest.xml index e6e1f11f98..5db8aa3e74 100644 --- a/tests/qemuxml2xmloutdata/pcihole64-q35.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/pcihole64-q35.x86_64-latest.xml @@ -26,12 +26,6 @@ <controller type='pci' index='0' model='pcie-root'> <pcihole64 unit='KiB'>1048576</pcihole64> </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x10'/> @@ -42,6 +36,12 @@ <target chassis='2' port='0x11'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> </controller> + <controller type='sata' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> + </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/pseries-many-buses-2.ppc64-latest.xml b/tests/qemuxml2xmloutdata/pseries-many-buses-2.ppc64-latest.xml index f9c5a78edd..036905640c 100644 --- a/tests/qemuxml2xmloutdata/pseries-many-buses-2.ppc64-latest.xml +++ b/tests/qemuxml2xmloutdata/pseries-many-buses-2.ppc64-latest.xml @@ -21,15 +21,15 @@ <model name='spapr-pci-host-bridge'/> <target index='0'/> </controller> - <controller type='pci' index='2' model='pci-root'> + <controller type='pci' index='1' model='pci-root'> <model name='spapr-pci-host-bridge'/> <target index='1'/> </controller> - <controller type='usb' index='0' model='none'/> - <controller type='pci' index='1' model='pci-root'> + <controller type='pci' index='2' model='pci-root'> <model name='spapr-pci-host-bridge'/> <target index='2'/> </controller> + <controller type='usb' index='0' model='none'/> <audio id='1' type='none'/> <memballoon model='none'/> <panic model='pseries'/> diff --git a/tests/qemuxml2xmloutdata/pseries-phb-default-missing.ppc64-latest.xml b/tests/qemuxml2xmloutdata/pseries-phb-default-missing.ppc64-latest.xml index db513febad..80231e3dd7 100644 --- a/tests/qemuxml2xmloutdata/pseries-phb-default-missing.ppc64-latest.xml +++ b/tests/qemuxml2xmloutdata/pseries-phb-default-missing.ppc64-latest.xml @@ -17,6 +17,10 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='pci' index='0' model='pci-root'> + <model name='spapr-pci-host-bridge'/> + <target index='0'/> + </controller> <controller type='pci' index='1' model='pci-root'> <model name='spapr-pci-host-bridge'/> <target index='1'/> @@ -26,10 +30,6 @@ <target index='2'/> </controller> <controller type='usb' index='0' model='none'/> - <controller type='pci' index='0' model='pci-root'> - <model name='spapr-pci-host-bridge'/> - <target index='0'/> - </controller> <audio id='1' type='none'/> <memballoon model='none'/> <panic model='pseries'/> diff --git a/tests/qemuxml2xmloutdata/q35.x86_64-latest.xml b/tests/qemuxml2xmloutdata/q35.x86_64-latest.xml index 3303370e7a..248fd1eced 100644 --- a/tests/qemuxml2xmloutdata/q35.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/q35.x86_64-latest.xml @@ -28,12 +28,6 @@ <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x10'/> @@ -44,6 +38,12 @@ <target chassis='2' port='0x11'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> </controller> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/riscv64-virt-graphics.riscv64-latest.xml b/tests/qemuxml2xmloutdata/riscv64-virt-graphics.riscv64-latest.xml index 4d5afe25bb..e252e9de92 100644 --- a/tests/qemuxml2xmloutdata/riscv64-virt-graphics.riscv64-latest.xml +++ b/tests/qemuxml2xmloutdata/riscv64-virt-graphics.riscv64-latest.xml @@ -29,9 +29,6 @@ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </controller> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -72,6 +69,9 @@ <target chassis='8' port='0xf'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x7'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/riscv64-virt-headless.riscv64-latest.xml b/tests/qemuxml2xmloutdata/riscv64-virt-headless.riscv64-latest.xml index 3808cb775b..ba7c01acd4 100644 --- a/tests/qemuxml2xmloutdata/riscv64-virt-headless.riscv64-latest.xml +++ b/tests/qemuxml2xmloutdata/riscv64-virt-headless.riscv64-latest.xml @@ -29,9 +29,6 @@ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </controller> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -67,6 +64,9 @@ <target chassis='7' port='0xe'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x6'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/user-aliases2.x86_64-latest.xml b/tests/qemuxml2xmloutdata/user-aliases2.x86_64-latest.xml index 22323215aa..78ae497b2d 100644 --- a/tests/qemuxml2xmloutdata/user-aliases2.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/user-aliases2.x86_64-latest.xml @@ -29,10 +29,6 @@ <controller type='pci' index='0' model='pcie-root'> <alias name='ua-MySataController'/> </controller> - <controller type='fdc' index='0'/> - <controller type='usb' index='0' model='qemu-xhci'> - <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -43,6 +39,10 @@ <target chassis='2' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> + <controller type='fdc' index='0'/> + <controller type='usb' index='0' model='qemu-xhci'> + <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> + </controller> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml b/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml index 1ea084854e..7a786b5f62 100644 --- a/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml @@ -18,12 +18,6 @@ <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <controller type='pci' index='0' model='pcie-root'/> - <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/> - </controller> - <controller type='sata' index='0'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -38,6 +32,12 @@ <target chassis='3' port='0x9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' 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'/> <audio id='1' type='none'/> diff --git a/tests/qemuxml2xmloutdata/x86_64-q35-graphics.x86_64-latest.xml b/tests/qemuxml2xmloutdata/x86_64-q35-graphics.x86_64-latest.xml index 4273cd4b6c..e7ac457d45 100644 --- a/tests/qemuxml2xmloutdata/x86_64-q35-graphics.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/x86_64-q35-graphics.x86_64-latest.xml @@ -47,9 +47,6 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x10'/> @@ -85,6 +82,9 @@ <target chassis='7' port='0x16'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:d2:70:0b'/> <model type='virtio'/> diff --git a/tests/qemuxml2xmloutdata/x86_64-q35-headless.x86_64-latest.xml b/tests/qemuxml2xmloutdata/x86_64-q35-headless.x86_64-latest.xml index b3976a85fd..4bbe7a5f20 100644 --- a/tests/qemuxml2xmloutdata/x86_64-q35-headless.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/x86_64-q35-headless.x86_64-latest.xml @@ -47,9 +47,6 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> <controller type='pci' index='0' model='pcie-root'/> - <controller type='virtio-serial' index='0'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> - </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x8'/> @@ -85,6 +82,9 @@ <target chassis='7' port='0xe'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x6'/> </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> + </controller> <interface type='user'> <mac address='52:54:00:09:a4:37'/> <model type='virtio'/> -- 2.43.0

Similarly to auto-adding of controllers, the assignment of indexes can cause them to be considered in different ordering according to the logic in 'virDomainControllerInsert' than they currently are. To prevent changes in commandline between first run after defining a VM xml and any subsequent run or restart of the daemon, we need to reorder them when assigning the index. The simplest method is to assign indexes and then create a new list of controllers and re-instert them. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_postparse.c | 21 +++++++++++++++++++ .../autoindex.x86_64-latest.args | 4 ++-- .../autoindex.x86_64-latest.xml | 12 +++++------ 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_postparse.c b/src/conf/domain_postparse.c index ee27023f3e..cafa2d235d 100644 --- a/src/conf/domain_postparse.c +++ b/src/conf/domain_postparse.c @@ -1335,6 +1335,7 @@ virDomainAssignControllerIndexes(virDomainDef *def) * unused index. */ size_t outer; + bool reinsert = false; for (outer = 0; outer < def->ncontrollers; outer++) { virDomainControllerDef *cont = def->controllers[outer]; @@ -1363,6 +1364,13 @@ virDomainAssignControllerIndexes(virDomainDef *def) */ int prevIdx; + /* virDomainControllerInsert enforces an ordering of USB2 controllers + * based on their master port, which doesn't happen on the initial + * parse if the index wasn't yet allocated. If we encounter a USB2 + * controller where we populated the index, we need to re-shuffle + * the controllers after allocating the index */ + reinsert = true; + prevIdx = outer - 1; while (prevIdx >= 0 && def->controllers[prevIdx]->type != VIR_DOMAIN_CONTROLLER_TYPE_USB) @@ -1399,6 +1407,19 @@ virDomainAssignControllerIndexes(virDomainDef *def) if (!prev) cont->idx = virDomainControllerFindUnusedIndex(def, cont->type); } + + if (reinsert) { + g_autofree virDomainControllerDef **controllers = g_steal_pointer(&def->controllers); + size_t ncontrollers = def->ncontrollers; + size_t i; + + def->controllers = g_new0(virDomainControllerDef *, ncontrollers); + def->ncontrollers = 0; + + for (i = 0; i < ncontrollers; i++) { + virDomainControllerInsertPreAlloced(def, controllers[i]); + } + } } diff --git a/tests/qemuxml2argvdata/autoindex.x86_64-latest.args b/tests/qemuxml2argvdata/autoindex.x86_64-latest.args index e712a324d8..099f3c9029 100644 --- a/tests/qemuxml2argvdata/autoindex.x86_64-latest.args +++ b/tests/qemuxml2argvdata/autoindex.x86_64-latest.args @@ -46,15 +46,15 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.config \ -device '{"driver":"ich9-usb-uhci3","masterbus":"usb.0","firstport":4,"bus":"pcie.0","addr":"0x1d.0x2"}' \ -device '{"driver":"ich9-usb-ehci1","id":"usb1","bus":"pcie.0","addr":"0x1a.0x7"}' \ -device '{"driver":"ich9-usb-uhci1","masterbus":"usb1.0","firstport":0,"bus":"pcie.0","multifunction":true,"addr":"0x1a"}' \ +-device '{"driver":"ich9-usb-ehci1","id":"usb2","bus":"pci.2","addr":"0x1.0x7"}' \ -device '{"driver":"ich9-usb-uhci1","masterbus":"usb2.0","firstport":0,"bus":"pci.2","multifunction":true,"addr":"0x1"}' \ -device '{"driver":"ich9-usb-uhci2","masterbus":"usb2.0","firstport":2,"bus":"pci.2","addr":"0x1.0x1"}' \ -device '{"driver":"ich9-usb-uhci3","masterbus":"usb2.0","firstport":4,"bus":"pci.2","addr":"0x1.0x2"}' \ --device '{"driver":"ich9-usb-ehci1","id":"usb2","bus":"pci.2","addr":"0x1.0x7"}' \ -device '{"driver":"nec-usb-xhci","id":"usb3","bus":"pci.5","addr":"0x0"}' \ +-device '{"driver":"ich9-usb-ehci1","id":"usb4","bus":"pci.2","addr":"0x2.0x7"}' \ -device '{"driver":"ich9-usb-uhci1","masterbus":"usb4.0","firstport":0,"bus":"pci.2","multifunction":true,"addr":"0x2"}' \ -device '{"driver":"ich9-usb-uhci2","masterbus":"usb4.0","firstport":2,"bus":"pci.2","addr":"0x2.0x1"}' \ -device '{"driver":"ich9-usb-uhci3","masterbus":"usb4.0","firstport":4,"bus":"pci.2","addr":"0x2.0x2"}' \ --device '{"driver":"ich9-usb-ehci1","id":"usb4","bus":"pci.2","addr":"0x2.0x7"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -device '{"driver":"ide-hd","bus":"ide.0","drive":"libvirt-1-format","id":"sata0-0-0","bootindex":1}' \ diff --git a/tests/qemuxml2xmloutdata/autoindex.x86_64-latest.xml b/tests/qemuxml2xmloutdata/autoindex.x86_64-latest.xml index c43be23768..357055fff3 100644 --- a/tests/qemuxml2xmloutdata/autoindex.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/autoindex.x86_64-latest.xml @@ -114,6 +114,9 @@ <master startport='0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1a' function='0x0' multifunction='on'/> </controller> + <controller type='usb' index='2' model='ich9-ehci1'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x7'/> + </controller> <controller type='usb' index='2' model='ich9-uhci1'> <master startport='0'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0' multifunction='on'/> @@ -126,12 +129,12 @@ <master startport='4'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x2'/> </controller> - <controller type='usb' index='2' model='ich9-ehci1'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x7'/> - </controller> <controller type='usb' index='3' model='nec-xhci'> <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> </controller> + <controller type='usb' index='4' model='ich9-ehci1'> + <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x7'/> + </controller> <controller type='usb' index='4' model='ich9-uhci1'> <master startport='0'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0' multifunction='on'/> @@ -144,9 +147,6 @@ <master startport='4'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x2'/> </controller> - <controller type='usb' index='4' model='ich9-ehci1'> - <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x7'/> - </controller> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> -- 2.43.0

The 'size' of a 'shmem' device is parsed and formatted as a "scaled" value, stored in bytes, but the formatting scale is mebibytes. This precission loss combined with the fact that the value was validated only when starting and the size is formatted only when non-zero meant that on first parse a value < 1 MiB would be accepted, but would be formatted to the XML as 0 MiB as it was non-zero but truncated and a subsequent parse would parse of such XML would parse it as 0 bytes, which in turn would be interpreted as 'default' size. Fix the issue by moving the validator, which ensures that the number is a power of two and more than 1 MiB to the validator code so that it'll be rejected at XML parsing time. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_command.c | 19 ----------- src/qemu/qemu_validate.c | 9 +++++ .../shmem-invalid-size.x86_64-latest.err | 2 +- .../shmem-small-size.x86_64-latest.err | 2 +- .../shmem-invalid-size.x86_64-latest.xml | 34 ------------------- .../shmem-small-size.x86_64-latest.xml | 34 ------------------- tests/qemuxmlconftest.c | 4 +-- 7 files changed, 13 insertions(+), 91 deletions(-) delete mode 100644 tests/qemuxml2xmloutdata/shmem-invalid-size.x86_64-latest.xml delete mode 100644 tests/qemuxml2xmloutdata/shmem-small-size.x86_64-latest.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 653817173b..e3d728aa82 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9078,25 +9078,6 @@ qemuBuildShmemCommandLine(virCommand *cmd, g_autoptr(virJSONValue) memProps = NULL; g_autoptr(virJSONValue) devProps = NULL; - if (shmem->size) { - /* - * Thanks to our parsing code, we have a guarantee that the - * size is power of two and is at least a mebibyte in size. - * But because it may change in the future, the checks are - * doubled in here. - */ - if (shmem->size & (shmem->size - 1)) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("shmem size must be a power of two")); - return -1; - } - if (shmem->size < 1024 * 1024) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("shmem size must be at least 1 MiB (1024 KiB)")); - return -1; - } - } - if (shmem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("only 'pci' addresses are supported for the shared memory device")); diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index b22d3618fe..01f65c0866 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -5118,6 +5118,15 @@ static int qemuValidateDomainDeviceDefShmem(virDomainShmemDef *shmem, virQEMUCaps *qemuCaps) { + if (shmem->size > 0) { + if (shmem->size < 1024 * 1024 || + !VIR_IS_POW2(shmem->size)) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("shmem size must be a power of 2 and at least 1 MiB (1024 KiB)")); + return -1; + } + } + switch (shmem->model) { case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", diff --git a/tests/qemuxml2argvdata/shmem-invalid-size.x86_64-latest.err b/tests/qemuxml2argvdata/shmem-invalid-size.x86_64-latest.err index 623bd8e5dd..5409cb73c2 100644 --- a/tests/qemuxml2argvdata/shmem-invalid-size.x86_64-latest.err +++ b/tests/qemuxml2argvdata/shmem-invalid-size.x86_64-latest.err @@ -1 +1 @@ -XML error: shmem size must be a power of two +XML error: shmem size must be a power of 2 and at least 1 MiB (1024 KiB) diff --git a/tests/qemuxml2argvdata/shmem-small-size.x86_64-latest.err b/tests/qemuxml2argvdata/shmem-small-size.x86_64-latest.err index b5fcd8b4cf..5409cb73c2 100644 --- a/tests/qemuxml2argvdata/shmem-small-size.x86_64-latest.err +++ b/tests/qemuxml2argvdata/shmem-small-size.x86_64-latest.err @@ -1 +1 @@ -XML error: shmem size must be at least 1 MiB (1024 KiB) +XML error: shmem size must be a power of 2 and at least 1 MiB (1024 KiB) diff --git a/tests/qemuxml2xmloutdata/shmem-invalid-size.x86_64-latest.xml b/tests/qemuxml2xmloutdata/shmem-invalid-size.x86_64-latest.xml deleted file mode 100644 index cc7b63da94..0000000000 --- a/tests/qemuxml2xmloutdata/shmem-invalid-size.x86_64-latest.xml +++ /dev/null @@ -1,34 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>qemu64</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - <shmem name='shmem0'> - <model type='ivshmem-plain'/> - <size unit='M'>12</size> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </shmem> - </devices> -</domain> diff --git a/tests/qemuxml2xmloutdata/shmem-small-size.x86_64-latest.xml b/tests/qemuxml2xmloutdata/shmem-small-size.x86_64-latest.xml deleted file mode 100644 index fc6f9dda7d..0000000000 --- a/tests/qemuxml2xmloutdata/shmem-small-size.x86_64-latest.xml +++ /dev/null @@ -1,34 +0,0 @@ -<domain type='qemu'> - <name>QEMUGuest1</name> - <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> - <memory unit='KiB'>219136</memory> - <currentMemory unit='KiB'>219136</currentMemory> - <vcpu placement='static'>1</vcpu> - <os> - <type arch='x86_64' machine='pc'>hvm</type> - <boot dev='hd'/> - </os> - <cpu mode='custom' match='exact' check='none'> - <model fallback='forbid'>qemu64</model> - </cpu> - <clock offset='utc'/> - <on_poweroff>destroy</on_poweroff> - <on_reboot>restart</on_reboot> - <on_crash>destroy</on_crash> - <devices> - <emulator>/usr/bin/qemu-system-x86_64</emulator> - <controller type='usb' index='0' model='piix3-uhci'> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> - </controller> - <controller type='pci' index='0' model='pci-root'/> - <input type='mouse' bus='ps2'/> - <input type='keyboard' bus='ps2'/> - <audio id='1' type='none'/> - <memballoon model='none'/> - <shmem name='shmem0'> - <model type='ivshmem-plain'/> - <size unit='M'>0</size> - <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> - </shmem> - </devices> -</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 267e4e579e..49fe9c0cae 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2455,9 +2455,9 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST_FULL("fips-enabled", "x86_64", ARG_FLAGS, FLAG_FIPS_HOST); DO_TEST_CAPS_LATEST("shmem-plain-doorbell"); - DO_TEST_CAPS_LATEST_FAILURE("shmem-invalid-size"); + DO_TEST_CAPS_LATEST_PARSE_ERROR("shmem-invalid-size"); DO_TEST_CAPS_LATEST_FAILURE("shmem-invalid-address"); - DO_TEST_CAPS_LATEST_FAILURE("shmem-small-size"); + DO_TEST_CAPS_LATEST_PARSE_ERROR("shmem-small-size"); DO_TEST_CAPS_LATEST_PARSE_ERROR("shmem-msi-only"); DO_TEST_CAPS_LATEST("cpu-host-passthrough-features"); -- 2.43.0

Assigning a PCI address needs to also assign any extension addresses right away. Otherwise they'd be assigned only after subsequent format->parse cycle and thus be potentially missing on first run after defining the VM and thus could change. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/qemu/qemu_domain_address.c | 14 ++++++++++---- .../hostdev-vfio-zpci-boundaries.s390x-latest.xml | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 099778b2a8..979bc8a9fd 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2829,10 +2829,16 @@ qemuDomainAssignPCIAddresses(virDomainDef *def, * controllers don't plug into any other PCI controller, hence * they should skip this step */ if (bus->model != VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT && - bus->model != VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT && - qemuDomainPCIAddressReserveNextAddr(addrs, - &dev.data.controller->info) < 0) { - goto cleanup; + bus->model != VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) { + if (qemuDomainPCIAddressReserveNextAddr(addrs, + &dev.data.controller->info) < 0) + goto cleanup; + + if (qemuDomainFillDevicePCIExtensionFlagsIter(NULL, &dev, &dev.data.controller->info, qemuCaps) < 0) + goto cleanup; + + if (qemuDomainAssignPCIAddressExtension(NULL, NULL, &dev.data.controller->info, addrs) < 0) + goto cleanup; } } diff --git a/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-boundaries.s390x-latest.xml b/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-boundaries.s390x-latest.xml index 8b0044af1c..6a4cf53313 100644 --- a/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-boundaries.s390x-latest.xml +++ b/tests/qemuxml2xmloutdata/hostdev-vfio-zpci-boundaries.s390x-latest.xml @@ -21,7 +21,9 @@ <controller type='pci' index='1' model='pci-bridge'> <model name='pci-bridge'/> <target chassisNr='1'/> - <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'> + <zpci uid='0x0002' fid='0x00000001'/> + </address> </controller> <audio id='1' type='none'/> <hostdev mode='subsystem' type='pci' managed='no'> -- 2.43.0

The XML parser for consoles sets the 'port=' attribute of '<target' to be always the index of the console. Thus when the "really crazy backcompat stuff for consoles" function modifies the order of consoles by inserting the default one for a serial port it must re-number the ports to ensure that the value will not change on subsequent parse. This luckily didn't cause any visible changes to the VM as the port number isn't used for anything. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/domain_conf.c | 15 +++++++++++++++ .../console-compat2.x86_64-latest.xml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2283688ba0..5197953c7f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4957,6 +4957,7 @@ virDomainDefHasDeviceAddress(virDomainDef *def, static int virDomainDefAddConsoleCompat(virDomainDef *def) { + bool renumber_consoles = false; size_t i; /* @@ -5023,6 +5024,8 @@ virDomainDefAddConsoleCompat(virDomainDef *def) /* Create an console alias for the serial port */ def->consoles[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE; def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; + + renumber_consoles = true; } } else if (def->os.type == VIR_DOMAIN_OSTYPE_HVM && def->nserials > 0 && def->serials[0]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { @@ -5050,6 +5053,8 @@ virDomainDefAddConsoleCompat(virDomainDef *def) return -1; } + renumber_consoles = true; + def->consoles[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE; def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; @@ -5065,6 +5070,16 @@ virDomainDefAddConsoleCompat(virDomainDef *def) } } + /* When consoles are parsed in 'virDomainDefParseXML' the value of + * 'target.port' is overriden by the index of the console in the + * 'def->consoles' array. Thus if we are modifying the list here we + * must ensure that the numbering will be identical as if we've parsed + * this definition */ + if (renumber_consoles) { + for (i = 0; i < def->nconsoles; i++) + def->consoles[i]->target.port = i; + } + return 0; } diff --git a/tests/qemuxml2xmloutdata/console-compat2.x86_64-latest.xml b/tests/qemuxml2xmloutdata/console-compat2.x86_64-latest.xml index 81bbb554d0..fd29155eae 100644 --- a/tests/qemuxml2xmloutdata/console-compat2.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/console-compat2.x86_64-latest.xml @@ -42,7 +42,7 @@ <target type='serial' port='0'/> </console> <console type='pty'> - <target type='virtio' port='0'/> + <target type='virtio' port='1'/> </console> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> -- 2.43.0

Re-parse and re-format the output XML to validate that the auto-added bits and the formatter always agree. There's no way to specify an alternative output file as a libvirt-formatted XML must be reformatted identically. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/qemuxmlconftest.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 49fe9c0cae..d13da62bba 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -756,6 +756,38 @@ testCompareDef2XML(const void *data) } +static int +testCompareOutXML2XML(const void *data) +{ + testQemuInfo *info = (void *) data; + g_autofree char *actual = NULL; + g_autoptr(virDomainDef) outdef = NULL; + unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE; + int rc = 0; + + if (!testQemuConfXMLCommon(info, &rc)) + return rc; + + /* parsing of the file produced by libvirt MUST succeed */ + if (!(outdef = virDomainDefParseFile(info->out_xml_inactive, driver.xmlopt, NULL, + info->parseFlags | VIR_DOMAIN_DEF_PARSE_INACTIVE))) { + VIR_TEST_VERBOSE("failed to parse '%s'", info->out_xml_inactive); + return -1; + } + + /* we deliberately format the XML as live to catch potential test regressions + * as virDomainDefFormatInternalSetRootName implies _INACTIVE if 'def->id' + * is -1, thus VM is inactive. */ + if (!(actual = virDomainDefFormat(outdef, driver.xmlopt, format_flags))) + return -1; + + if (virTestCompareToFile(actual, info->out_xml_inactive) < 0) + return -1; + + return 0; +} + + static int testCompareXMLToArgv(const void *data) { @@ -949,6 +981,7 @@ testRun(const char *name, { g_autofree char *name_parse = g_strdup_printf("QEMU XML def parse %s%s", name, suffix); g_autofree char *name_xml = g_strdup_printf("QEMU XML def -> XML %s%s", name, suffix); + g_autofree char *name_outxml = g_strdup_printf("QEMU XML OUT -> XML %s%s", name, suffix); g_autofree char *name_argv = g_strdup_printf("QEMU XML def -> ARGV %s%s", name, suffix); g_autoptr(testQemuInfo) info = g_new0(testQemuInfo, 1); va_list ap; @@ -967,6 +1000,7 @@ testRun(const char *name, virTestRunLog(ret, name_parse, testXMLParse, info); virTestRunLog(ret, name_xml, testCompareDef2XML, info); + virTestRunLog(ret, name_outxml, testCompareOutXML2XML, info); virTestRunLog(ret, name_argv, testCompareXMLToArgv, info); /* clear overriden host cpu */ -- 2.43.0

On a Friday in 2024, Peter Krempa wrote:
This series depends on the 'part 2' with cover letter's subject:
[PATCH 00/23] qemu XML testing improvements, part 2 - enforcement of xml->xml testing
both this along with the rebased prerequisite series can be fetched from:
git fetch https://gitlab.com/pipo.sk/libvirt.git test-improvements-3
The main goal of part 3 is to add testing based on parsing of the libvirt-formatted files from tests/qemuxml2xmloutdata and formatting them back, and checking that they are identical.
By adding this testing multiple problems in code auto-adding information was discovered.
Peter Krempa (7): virDomainDefMaybeAddVirtioSerialController: Reformat hard to read linebreaks conf: domain: Insert auto-added controllers in same order as in XML parser virDomainAssignControllerIndexes: Ensure controller ordering after assigning indexes qemu: Move 'shmem' device size validation to qemu_validate qemuDomainAssignPCIAddresses: Assign extension addresses when auto-assigning PCI address virDomainDefAddConsoleCompat: Fix numbering of console targets after modification qemuxml2conftest: Test re-parsing of formatted XML
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

On 1/12/24 17:05, Peter Krempa wrote:
The main goal of part 3 is to add testing based on parsing of the libvirt-formatted files from tests/qemuxml2xmloutdata and formatting them back, and checking that they are identical.
Firstly, sorry for resurrecting an old thread. Secondly, sorry for hijacking it. BUT. There were patches sent to the list recently [1] and I realized, the way we usually used to do things is disturbed. I mean, whenever new device, device knob, ... was introduced the patch series consisted (roughly) of the following patches: 1) config, XML parser & formatter, RNG, docs AND xml2xml test case, 2) qemu caps 3) qemu cmd line AND xml2argv test case. Now, since we have this one huge qemuxmlconftest.c it's not as easy. If I try to introduce a test case in 1), the test case fails as there's no corresponding .args file. Fair, but also not fair - the feature is not finished at the time of 1) so .args shouldn't even be considered. But if a test case is added at step 3) - well, then anybody backporting 1) won't get the xml2xml test case. Pity. I mean, that's the whole point we split the change into "frontend" and "backend", right? Okay, you may add step 4), which introduces new qemuxmlconftest.c test case. But it bundles both xml2xml AND xml2argv steps rendering it yet again unsuitable for backport. One way out might be to add new testcases to genericxml2xmltest.c, but somehow that feels wrong. Michal 1: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/LEAEN...

On Tue, Mar 19, 2024 at 21:31:52 +0100, Michal Prívozník wrote:
On 1/12/24 17:05, Peter Krempa wrote:
The main goal of part 3 is to add testing based on parsing of the libvirt-formatted files from tests/qemuxml2xmloutdata and formatting them back, and checking that they are identical.
Firstly, sorry for resurrecting an old thread. Secondly, sorry for hijacking it. BUT.
There were patches sent to the list recently [1] and I realized, the way we usually used to do things is disturbed. I mean, whenever new device, device knob, ... was introduced the patch series consisted (roughly) of the following patches:
1) config, XML parser & formatter, RNG, docs AND xml2xml test case, 2) qemu caps 3) qemu cmd line AND xml2argv test case.
Now, since we have this one huge qemuxmlconftest.c it's not as easy. If I try to introduce a test case in 1), the test case fails as there's no corresponding .args file.
You can add a corresponding .args file that will not yet have the commandline bits added by the patches, as the implementation is missing. This means that the corresponding patch adding the qemu code will need to contain the corresponding .args change.
Fair, but also not fair - the feature is not finished at the time of 1) so .args shouldn't even be considered.
Well, it still covers what the code does at that point, so at the very least in theory it makes sense. In practice, it possibly looks a bit awkward, but the tests can still be added in a separate commit after both the XML and qemu bits are implemented. As long as the patches test the code I don't really have a problem with that.
But if a test case is added at step 3) - well, then anybody backporting 1) won't get the xml2xml test case. Pity. I mean, that's the whole point we split the change into "frontend" and "backend", right?
This case would be a problem only if a patchset would add implementations in two hypervisor drivers at same time and you'd decide to backport only the non-qemu one. In such case the qemu XML coverage would be missing. Reallistically that won't happen, but if it did, the corresponding patches to the other hypervisor driver should add their own tests which you really should bacport or you can also add genericxml2xmltest cases. In quite a lot of cases the qemuxml2xmltest case was also added in a separate commit which is totally fine and the 'backport' case above would not cover that one either.
Okay, you may add step 4), which introduces new qemuxmlconftest.c test case. But it bundles both xml2xml AND xml2argv steps rendering it yet again unsuitable for backport.
I don't see how that would be unsuitable for backport. If you are backporting a qemu feature, then the qemu* tests are relevant. Otherwise you should be backporting the corresponding tests at least for that hypervisor you are adding.
One way out might be to add new testcases to genericxml2xmltest.c, but somehow that feels wrong.
Why? Genericxml2xml test is there for all generic configs. It's just that most code usually adds a qemu implementation and it's both more convenient and sufficient to excercise all things to add just the qemuxmlconftest case. P.S: 37% qemuxml2argv test cases did not have a corresponding qemuxml2xmltest case at the time when I've converted it over. Additional few were actually testing something else due to a mismatch in capabilities.
participants (3)
-
Ján Tomko
-
Michal Prívozník
-
Peter Krempa