[libvirt] [PATCH 5/6] qemu: don't require a hotpluggable slot for devices that can't be hotplugged

Laine Stump laine at laine.org
Mon Aug 8 08:56:56 UTC 2016


qemuDomainAssignDevicePCISlots() blindly sets the HOTPLUGGABLE flag
for all devices, even though only a subset of devices actually support
hotplugging. In particular, these devices do support hotplug:

  <interface>
  <hostdev>
  <rng>
  <serial>
  <disk> (only virtio)
  <controller> (SCSI controllers only)

and these devices don't support hotplug:

  <filesystem>
  <sound>
  <balloon>
  <watchdog>
  <video>
  <shmem>
  <input>

By turning off the HOTPLUGGABLE flag for the devices that couldn't be
hotplugged anyway, we can convince libvirt to auto-assign them to
pcie-root (which doesn't support hotplug, but *does* allow both PCIe
and legacy PCI devices).
---
 src/qemu/qemu_domain_address.c                     | 67 +++++++++++++++++++---
 tests/qemuxml2argvdata/qemuxml2argv-autoindex.args | 22 +++----
 .../qemuxml2argv-bios-nvram-secure.args            |  2 +-
 .../qemuxml2argv-machine-smm-opt.args              |  2 +-
 .../qemuxml2argv-q35-hotpluggable.args             |  6 +-
 .../qemuxml2argv-q35-pm-disable-fallback.args      |  3 +-
 .../qemuxml2argv-q35-pm-disable.args               |  3 +-
 .../qemuxml2argv-q35-usb2-multi.args               | 10 ++--
 .../qemuxml2argv-q35-usb2-reorder.args             | 10 ++--
 .../qemuxml2xmlout-autoindex.xml                   | 18 +++---
 .../qemuxml2xmlout-q35-hotpluggable.xml            |  6 +-
 .../qemuxml2xmlout-q35-usb2-multi.xml              |  8 +--
 .../qemuxml2xmlout-q35-usb2-reorder.xml            |  8 +--
 13 files changed, 108 insertions(+), 57 deletions(-)

diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 3d52d72..87a1268 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -1021,19 +1021,16 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
         }
     }
 
-    /* all other devices that plug into a PCI slot are treated as a
-     * PCI endpoint devices that require a hotplug-capable slot
-     * (except for some special cases which have specific handling
-     * below)
-     */
-    flags = VIR_PCI_CONNECT_HOTPLUGGABLE | VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
-
     for (i = 0; i < def->nfss; i++) {
         if (!virDeviceInfoPCIAddressWanted(&def->fss[i]->info))
             continue;
 
         /* Only support VirtIO-9p-pci so far. If that changes,
          * we might need to skip devices here */
+
+        /* <filesystem> devices are not hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs, &def->fss[i]->info,
                                                flags) < 0)
             goto error;
@@ -1049,6 +1046,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             !virDeviceInfoPCIAddressWanted(&def->nets[i]->info)) {
             continue;
         }
+        /* most <interface> devices are hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_HOTPLUGGABLE | VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs, &def->nets[i]->info,
                                                flags) < 0)
             goto error;
@@ -1064,6 +1064,8 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             def->sounds[i]->model == VIR_DOMAIN_SOUND_MODEL_USB)
             continue;
 
+        /* <sound> devices are not hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
         if (virDomainPCIAddressReserveNextSlot(addrs, &def->sounds[i]->info,
                                                flags) < 0)
             goto error;
@@ -1129,6 +1131,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
                 break;
             }
 
+            /* USB2 controllers not hotpluggable, legacy PCI */
+            flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
             if (!foundAddr) {
                 /* This is the first part of the controller, so need
                  * to find a free slot & then reserve a function */
@@ -1142,6 +1147,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
                 addrs->lastaddr.function = 0;
                 addrs->lastaddr.multi = VIR_TRISTATE_SWITCH_ABSENT;
             }
+
             /* Finally we can reserve the slot+function */
             if (virDomainPCIAddressReserveAddr(addrs, &addr, flags,
                                                false, foundAddr) < 0)
@@ -1150,6 +1156,19 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             def->controllers[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
             def->controllers[i]->info.addr.pci = addr;
         } else {
+            flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+            /* USB3 (nec-xhci) controllers can be either PCIe or
+             * legacy PCI, depending on the type of controller they
+             * are plugged into.
+             */
+            if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
+                def->controllers[i]->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI)
+                flags |= VIR_PCI_CONNECT_TYPE_PCIE_DEVICE;
+
+            /* SCSI controllers can be hot plugged. All others can't */
+            if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI)
+                flags |= VIR_PCI_CONNECT_HOTPLUGGABLE;
+
             if (virDomainPCIAddressReserveNextSlot(addrs,
                                                    &def->controllers[i]->info,
                                                    flags) < 0)
@@ -1184,6 +1203,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             goto error;
         }
 
+        /* <disk> devices are hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_HOTPLUGGABLE | VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs, &def->disks[i]->info,
                                                flags) < 0)
             goto error;
@@ -1197,6 +1219,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             def->hostdevs[i]->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
             continue;
 
+        /* <hostdev> devices are hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_HOTPLUGGABLE | VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs,
                                                def->hostdevs[i]->info,
                                                flags) < 0)
@@ -1207,6 +1232,10 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
     if (def->memballoon &&
         def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO &&
         virDeviceInfoPCIAddressWanted(&def->memballoon->info)) {
+
+        /* <balloon> devices are NOT hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs,
                                                &def->memballoon->info,
                                                flags) < 0)
@@ -1219,6 +1248,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             !virDeviceInfoPCIAddressWanted(&def->rngs[i]->info))
             continue;
 
+        /* <rng> devices are hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_HOTPLUGGABLE | VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs,
                                                &def->rngs[i]->info, flags) < 0)
             goto error;
@@ -1228,6 +1260,10 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
     if (def->watchdog &&
         def->watchdog->model == VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB &&
         virDeviceInfoPCIAddressWanted(&def->watchdog->info)) {
+
+        /* <hostdev> devices are NOT hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs, &def->watchdog->info,
                                                flags) < 0)
             goto error;
@@ -1237,6 +1273,10 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
      * assigned address. */
     if (def->nvideos > 0 &&
         virDeviceInfoPCIAddressWanted(&def->videos[0]->info)) {
+
+        /* <video> devices are NOT hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs, &def->videos[0]->info,
                                                flags) < 0)
             goto error;
@@ -1251,6 +1291,10 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
         }
         if (!virDeviceInfoPCIAddressWanted(&def->videos[i]->info))
             continue;
+
+        /* <video> devices are NOT hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs, &def->videos[i]->info,
                                                flags) < 0)
             goto error;
@@ -1261,6 +1305,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
         if (!virDeviceInfoPCIAddressWanted(&def->shmems[i]->info))
             continue;
 
+        /* <shmem> devices are NOT hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs,
                                                &def->shmems[i]->info, flags) < 0)
             goto error;
@@ -1270,6 +1317,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             !virDeviceInfoPCIAddressWanted(&def->inputs[i]->info))
             continue;
 
+        /* <input> devices are NOT hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs,
                                                &def->inputs[i]->info, flags) < 0)
             goto error;
@@ -1284,6 +1334,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             !virDeviceInfoPCIAddressWanted(&chr->info))
             continue;
 
+        /* <serial> devices are hotpluggable, legacy PCI */
+        flags = VIR_PCI_CONNECT_HOTPLUGGABLE | VIR_PCI_CONNECT_TYPE_PCI_DEVICE;
+
         if (virDomainPCIAddressReserveNextSlot(addrs, &chr->info, flags) < 0)
             goto error;
     }
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-autoindex.args b/tests/qemuxml2argvdata/qemuxml2argv-autoindex.args
index 43b9661..cddf7a0 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-autoindex.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-autoindex.args
@@ -38,16 +38,16 @@ addr=0x1d \
 -device ich9-usb-ehci1,id=usb1,bus=pcie.0,addr=0x1a.0x7 \
 -device ich9-usb-uhci1,masterbus=usb1.0,firstport=0,bus=pcie.0,\
 multifunction=on,addr=0x1a \
--device ich9-usb-uhci1,masterbus=usb2.0,firstport=0,bus=pci.2,multifunction=on,\
-addr=0x1 \
--device ich9-usb-uhci2,masterbus=usb2.0,firstport=2,bus=pci.2,addr=0x1.0x1 \
--device ich9-usb-uhci3,masterbus=usb2.0,firstport=4,bus=pci.2,addr=0x1.0x2 \
--device ich9-usb-ehci1,id=usb2,bus=pci.2,addr=0x1.0x7 \
--device nec-usb-xhci,id=usb3,bus=pci.2,addr=0x2 \
--device ich9-usb-uhci1,masterbus=usb4.0,firstport=0,bus=pci.2,multifunction=on,\
-addr=0x3 \
--device ich9-usb-uhci2,masterbus=usb4.0,firstport=2,bus=pci.2,addr=0x3.0x1 \
--device ich9-usb-uhci3,masterbus=usb4.0,firstport=4,bus=pci.2,addr=0x3.0x2 \
--device ich9-usb-ehci1,id=usb4,bus=pci.2,addr=0x3.0x7 \
+-device ich9-usb-uhci1,masterbus=usb2.0,firstport=0,bus=pcie.0,\
+multifunction=on,addr=0x4 \
+-device ich9-usb-uhci2,masterbus=usb2.0,firstport=2,bus=pcie.0,addr=0x4.0x1 \
+-device ich9-usb-uhci3,masterbus=usb2.0,firstport=4,bus=pcie.0,addr=0x4.0x2 \
+-device ich9-usb-ehci1,id=usb2,bus=pcie.0,addr=0x4.0x7 \
+-device nec-usb-xhci,id=usb3,bus=pcie.0,addr=0x3 \
+-device ich9-usb-uhci1,masterbus=usb4.0,firstport=0,bus=pcie.0,\
+multifunction=on,addr=0x6 \
+-device ich9-usb-uhci2,masterbus=usb4.0,firstport=2,bus=pcie.0,addr=0x6.0x1 \
+-device ich9-usb-uhci3,masterbus=usb4.0,firstport=4,bus=pcie.0,addr=0x6.0x2 \
+-device ich9-usb-ehci1,id=usb4,bus=pcie.0,addr=0x6.0x7 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
 -device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram-secure.args b/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram-secure.args
index c014254..93d62a7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram-secure.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-bios-nvram-secure.args
@@ -26,4 +26,4 @@ readonly=on \
 -device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
 drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 \
 -serial pty \
--device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x2
+-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x2
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-smm-opt.args b/tests/qemuxml2argvdata/qemuxml2argv-machine-smm-opt.args
index e49d7e9..05738c1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-machine-smm-opt.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-smm-opt.args
@@ -22,4 +22,4 @@ QEMU_AUDIO_DRV=none \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-scsi0-0-0-0 \
 -device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
 drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x2
+-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x2
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-hotpluggable.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-hotpluggable.args
index 0020bfe..c3368ae 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-q35-hotpluggable.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-hotpluggable.args
@@ -43,8 +43,8 @@ addr=0x3 \
 -vga qxl \
 -global qxl-vga.ram_size=67108864 \
 -global qxl-vga.vram_size=33554432 \
--device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x4 \
+-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x5 \
 -object rng-random,id=objrng0,filename=/dev/random \
--device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x5 \
+-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x6 \
 -object rng-random,id=objrng1,filename=/dev/random \
--device virtio-rng-pci,rng=objrng1,id=rng1,bus=pci.2,addr=0x5
+-device virtio-rng-pci,rng=objrng1,id=rng1,bus=pci.2,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable-fallback.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable-fallback.args
index deae687..31a1d71 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable-fallback.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable-fallback.args
@@ -19,5 +19,4 @@ QEMU_AUDIO_DRV=none \
 -global PIIX4_PM.disable_s4=1 \
 -boot n \
 -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
--device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x1
+-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x2
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable.args
index 871340f..f0dda09 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-pm-disable.args
@@ -19,5 +19,4 @@ QEMU_AUDIO_DRV=none \
 -global ICH9-LPC.disable_s4=1 \
 -boot n \
 -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
--device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x1
+-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x2
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args
index d465c69..9d2875d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-multi.args
@@ -28,11 +28,11 @@ addr=0x1d \
 multifunction=on,addr=0x1a \
 -device ich9-usb-uhci2,masterbus=usb1.0,firstport=2,bus=pcie.0,addr=0x1a.0x1 \
 -device ich9-usb-uhci3,masterbus=usb1.0,firstport=4,bus=pcie.0,addr=0x1a.0x2 \
--device ich9-usb-ehci1,id=usb2,bus=pci.2,addr=0x1.0x7 \
--device ich9-usb-uhci1,masterbus=usb2.0,firstport=0,bus=pci.2,multifunction=on,\
-addr=0x1 \
--device ich9-usb-uhci2,masterbus=usb2.0,firstport=2,bus=pci.2,addr=0x1.0x1 \
--device ich9-usb-uhci3,masterbus=usb2.0,firstport=4,bus=pci.2,addr=0x1.0x2 \
+-device ich9-usb-ehci1,id=usb2,bus=pcie.0,addr=0x3.0x7 \
+-device ich9-usb-uhci1,masterbus=usb2.0,firstport=0,bus=pcie.0,\
+multifunction=on,addr=0x3 \
+-device ich9-usb-uhci2,masterbus=usb2.0,firstport=2,bus=pcie.0,addr=0x3.0x1 \
+-device ich9-usb-uhci3,masterbus=usb2.0,firstport=4,bus=pcie.0,addr=0x3.0x2 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
 -device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \
 -vga qxl \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args
index 87d2ce7..a915b76 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-usb2-reorder.args
@@ -28,11 +28,11 @@ addr=0x1d \
 multifunction=on,addr=0x1a \
 -device ich9-usb-uhci3,masterbus=usb1.0,firstport=4,bus=pcie.0,addr=0x1a.0x2 \
 -device ich9-usb-uhci2,masterbus=usb1.0,firstport=2,bus=pcie.0,addr=0x1a.0x1 \
--device ich9-usb-ehci1,id=usb2,bus=pci.2,addr=0x1.0x7 \
--device ich9-usb-uhci3,masterbus=usb2.0,firstport=4,bus=pci.2,addr=0x1.0x2 \
--device ich9-usb-uhci2,masterbus=usb2.0,firstport=2,bus=pci.2,addr=0x1.0x1 \
--device ich9-usb-uhci1,masterbus=usb2.0,firstport=0,bus=pci.2,multifunction=on,\
-addr=0x1 \
+-device ich9-usb-ehci1,id=usb2,bus=pcie.0,addr=0x3.0x7 \
+-device ich9-usb-uhci3,masterbus=usb2.0,firstport=4,bus=pcie.0,addr=0x3.0x2 \
+-device ich9-usb-uhci2,masterbus=usb2.0,firstport=2,bus=pcie.0,addr=0x3.0x1 \
+-device ich9-usb-uhci1,masterbus=usb2.0,firstport=0,bus=pcie.0,\
+multifunction=on,addr=0x3 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
 -device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \
 -vga qxl \
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-autoindex.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-autoindex.xml
index 086a1cf..0502b36 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-autoindex.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-autoindex.xml
@@ -112,36 +112,36 @@
     </controller>
     <controller type='usb' index='2' model='ich9-uhci1'>
       <master startport='0'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0' multifunction='on'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0' multifunction='on'/>
     </controller>
     <controller type='usb' index='2' model='ich9-uhci2'>
       <master startport='2'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x1'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x1'/>
     </controller>
     <controller type='usb' index='2' model='ich9-uhci3'>
       <master startport='4'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x2'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x2'/>
     </controller>
     <controller type='usb' index='2' model='ich9-ehci1'>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x7'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x7'/>
     </controller>
     <controller type='usb' index='3' model='nec-xhci'>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
     </controller>
     <controller type='usb' index='4' model='ich9-uhci1'>
       <master startport='0'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0' multifunction='on'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
     </controller>
     <controller type='usb' index='4' model='ich9-uhci2'>
       <master startport='2'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x1'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
     </controller>
     <controller type='usb' index='4' model='ich9-uhci3'>
       <master startport='4'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x2'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x2'/>
     </controller>
     <controller type='usb' index='4' model='ich9-ehci1'>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x7'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x7'/>
     </controller>
     <controller type='sata' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-hotpluggable.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-hotpluggable.xml
index e771125..18ea795 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-hotpluggable.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-hotpluggable.xml
@@ -87,17 +87,17 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
     </video>
     <memballoon model='virtio'>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
     </memballoon>
     <rng model='virtio'>
       <backend model='random'>/dev/random</backend>
       <hotplug require='no'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
     </rng>
     <rng model='virtio'>
       <backend model='random'>/dev/random</backend>
       <hotplug require='yes'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
     </rng>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-usb2-multi.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-usb2-multi.xml
index 06c0699..74b345d 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-usb2-multi.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-usb2-multi.xml
@@ -60,19 +60,19 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x1a' function='0x2'/>
     </controller>
     <controller type='usb' index='2' model='ich9-ehci1'>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x7'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x7'/>
     </controller>
     <controller type='usb' index='2' model='ich9-uhci1'>
       <master startport='0'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0' multifunction='on'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/>
     </controller>
     <controller type='usb' index='2' model='ich9-uhci2'>
       <master startport='2'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x1'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/>
     </controller>
     <controller type='usb' index='2' model='ich9-uhci3'>
       <master startport='4'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x2'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/>
     </controller>
     <controller type='sata' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-usb2-reorder.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-usb2-reorder.xml
index 1007095..6ac275f 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-usb2-reorder.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-usb2-reorder.xml
@@ -60,19 +60,19 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x1a' function='0x1'/>
     </controller>
     <controller type='usb' index='2' model='ich9-ehci1'>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x7'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x7'/>
     </controller>
     <controller type='usb' index='2' model='ich9-uhci3'>
       <master startport='4'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x2'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x2'/>
     </controller>
     <controller type='usb' index='2' model='ich9-uhci2'>
       <master startport='2'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x1'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/>
     </controller>
     <controller type='usb' index='2' model='ich9-uhci1'>
       <master startport='0'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0' multifunction='on'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/>
     </controller>
     <controller type='sata' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
-- 
2.7.4




More information about the libvir-list mailing list