[PATCH 2/7] conf: domain: Insert auto-added controllers in same order as in XML parser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'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@xxxxxxxxxx>
---
 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
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux