[PATCH v3 4/5] qemu: auto-add pci-root controller for pc machine types

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

 



<controller type='pci' index='0' model='pci-root'/>
is auto-added to pc* machine types.
Without this controller PCI bus 0 is not available and
no PCI addresses are assigned by default.

Since older libvirt supported PCI bus 0 even without
this controller, it is removed from the XML when migrating.
---
 src/conf/domain_conf.c                             |  2 +-
 src/conf/domain_conf.h                             |  6 ++
 src/libvirt_private.syms                           |  1 +
 src/qemu/qemu_command.c                            | 57 ++++++++++++------
 src/qemu/qemu_command.h                            |  3 +-
 src/qemu/qemu_domain.c                             | 67 +++++++++++++++++++++-
 tests/domainsnapshotxml2xmlout/disk_snapshot.xml   |  1 +
 tests/domainsnapshotxml2xmlout/external_vm.xml     |  1 +
 tests/domainsnapshotxml2xmlout/full_domain.xml     |  1 +
 tests/domainsnapshotxml2xmlout/metadata.xml        |  1 +
 .../qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml |  1 +
 .../qemuxml2argv-blkiotune-device.xml              |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-blkiotune.xml  |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml |  1 +
 .../qemuxml2argvdata/qemuxml2argv-boot-floppy.xml  |  1 +
 .../qemuxml2argv-boot-menu-disable.xml             |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml |  1 +
 .../qemuxml2argvdata/qemuxml2argv-boot-network.xml |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml |  1 +
 .../qemuxml2argv-channel-guestfwd.xml              |  1 +
 .../qemuxml2argv-channel-virtio.xml                |  1 +
 .../qemuxml2argv-clock-localtime.xml               |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml  |  1 +
 .../qemuxml2argv-console-compat.xml                |  1 +
 .../qemuxml2argv-console-virtio-many.xml           |  1 +
 .../qemuxml2argv-cpu-eoi-disabled.xml              |  1 +
 .../qemuxml2argv-cpu-eoi-enabled.xml               |  1 +
 .../qemuxml2argv-cpu-host-kvmclock.xml             |  1 +
 .../qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-cputune.xml    |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-disk-aio.xml   |  1 +
 .../qemuxml2argv-disk-cdrom-empty.xml              |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml |  1 +
 .../qemuxml2argv-disk-drive-boot-cdrom.xml         |  1 +
 .../qemuxml2argv-disk-drive-boot-disk.xml          |  1 +
 .../qemuxml2argv-disk-drive-cache-directsync.xml   |  1 +
 .../qemuxml2argv-disk-drive-cache-unsafe.xml       |  1 +
 .../qemuxml2argv-disk-drive-cache-v1-none.xml      |  1 +
 .../qemuxml2argv-disk-drive-cache-v1-wb.xml        |  1 +
 .../qemuxml2argv-disk-drive-cache-v1-wt.xml        |  1 +
 .../qemuxml2argv-disk-drive-cache-v2-none.xml      |  1 +
 .../qemuxml2argv-disk-drive-cache-v2-wb.xml        |  1 +
 .../qemuxml2argv-disk-drive-cache-v2-wt.xml        |  1 +
 ...muxml2argv-disk-drive-error-policy-enospace.xml |  1 +
 .../qemuxml2argv-disk-drive-error-policy-stop.xml  |  1 +
 ...rgv-disk-drive-error-policy-wreport-rignore.xml |  1 +
 .../qemuxml2argv-disk-drive-fat.xml                |  1 +
 .../qemuxml2argv-disk-drive-fmt-qcow.xml           |  1 +
 .../qemuxml2argv-disk-drive-network-gluster.xml    |  1 +
 .../qemuxml2argv-disk-drive-network-iscsi-auth.xml |  1 +
 .../qemuxml2argv-disk-drive-network-iscsi.xml      |  1 +
 .../qemuxml2argv-disk-drive-network-nbd-export.xml |  1 +
 ...xml2argv-disk-drive-network-nbd-ipv6-export.xml |  1 +
 .../qemuxml2argv-disk-drive-network-nbd-ipv6.xml   |  1 +
 .../qemuxml2argv-disk-drive-network-nbd-unix.xml   |  1 +
 .../qemuxml2argv-disk-drive-network-nbd.xml        |  1 +
 ...emuxml2argv-disk-drive-network-rbd-ceph-env.xml |  1 +
 .../qemuxml2argv-disk-drive-network-rbd-ipv6.xml   |  1 +
 .../qemuxml2argv-disk-drive-network-rbd.xml        |  1 +
 .../qemuxml2argv-disk-drive-network-sheepdog.xml   |  1 +
 .../qemuxml2argvdata/qemuxml2argv-disk-floppy.xml  |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml  |  1 +
 .../qemuxml2argvdata/qemuxml2argv-disk-mirror.xml  |  1 +
 .../qemuxml2argv-disk-scsi-device.xml              |  1 +
 .../qemuxml2argv-disk-scsi-disk-vpd.xml            |  1 +
 ...qemuxml2argv-disk-scsi-lun-passthrough-sgio.xml |  1 +
 .../qemuxml2argv-disk-scsi-megasas.xml             |  1 +
 .../qemuxml2argv-disk-scsi-virtio-scsi.xml         |  1 +
 .../qemuxml2argv-disk-scsi-vscsi.xml               |  1 +
 .../qemuxml2argv-disk-source-pool.xml              |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml   |  1 +
 .../qemuxml2argv-disk-virtio-scsi-num_queues.xml   |  1 +
 .../qemuxml2argvdata/qemuxml2argv-disk-virtio.xml  |  1 +
 .../qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml  |  1 +
 .../qemuxml2argv-encrypted-disk.xml                |  1 +
 .../qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml |  1 +
 .../qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml  |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml  |  1 +
 .../qemuxml2argv-floppy-drive-fat.xml              |  1 +
 .../qemuxml2argv-graphics-listen-network.xml       |  1 +
 .../qemuxml2argv-graphics-sdl-fullscreen.xml       |  1 +
 .../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml |  1 +
 .../qemuxml2argv-graphics-spice-compression.xml    |  1 +
 .../qemuxml2argv-graphics-spice-qxl-vga.xml        |  1 +
 .../qemuxml2argv-graphics-spice.xml                |  1 +
 .../qemuxml2argv-graphics-vnc-sasl.xml             |  1 +
 .../qemuxml2argv-graphics-vnc-socket.xml           |  1 +
 .../qemuxml2argv-graphics-vnc-tls.xml              |  1 +
 .../qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml |  1 +
 .../qemuxml2argv-hostdev-pci-address.xml           |  1 +
 .../qemuxml2argv-hostdev-usb-address.xml           |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml  |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-hyperv.xml     |  1 +
 .../qemuxml2argv-input-usbmouse.xml                |  1 +
 .../qemuxml2argv-input-usbtablet.xml               |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml   |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-lease.xml      |  1 +
 .../qemuxml2argv-machine-core-off.xml              |  1 +
 .../qemuxml2argv-machine-core-on.xml               |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-migrate.xml    |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-minimal.xml    |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml  |  1 +
 .../qemuxml2argv-misc-disable-s3.xml               |  1 +
 .../qemuxml2argv-misc-disable-suspends.xml         |  1 +
 .../qemuxml2argv-misc-enable-s4.xml                |  1 +
 .../qemuxml2argv-misc-no-reboot.xml                |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml  |  1 +
 .../qemuxml2argv-net-bandwidth.xml                 |  1 +
 .../qemuxml2argv-net-eth-ifname.xml                |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-net-eth.xml    |  1 +
 .../qemuxml2argvdata/qemuxml2argv-net-hostdev.xml  |  1 +
 .../qemuxml2argv-net-openvswitch.xml               |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-net-user.xml   |  1 +
 .../qemuxml2argv-net-virtio-device.xml             |  1 +
 .../qemuxml2argv-net-virtio-network-portgroup.xml  |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml |  1 +
 .../qemuxml2argv-nographics-vga.xml                |  1 +
 .../qemuxml2argv-numad-static-vcpu-no-numatune.xml |  1 +
 .../qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml    |  1 +
 .../qemuxml2argv-qemu-ns-no-env.xml                |  1 +
 .../qemuxml2argv-reboot-timeout-disabled.xml       |  1 +
 .../qemuxml2argv-reboot-timeout-enabled.xml        |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml |  1 +
 .../qemuxml2argv-seclabel-dynamic-baselabel.xml    |  1 +
 .../qemuxml2argv-seclabel-dynamic-override.xml     |  1 +
 .../qemuxml2argv-seclabel-none.xml                 |  1 +
 .../qemuxml2argv-seclabel-static.xml               |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml |  1 +
 .../qemuxml2argvdata/qemuxml2argv-serial-file.xml  |  1 +
 .../qemuxml2argvdata/qemuxml2argv-serial-many.xml  |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml |  1 +
 .../qemuxml2argv-serial-tcp-telnet.xml             |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml |  1 +
 .../qemuxml2argvdata/qemuxml2argv-serial-unix.xml  |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml  |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-smp.xml        |  1 +
 .../qemuxml2argvdata/qemuxml2argv-sound-device.xml |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-sound.xml      |  1 +
 .../qemuxml2argv-tpm-passthrough.xml               |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-usb-redir.xml  |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-virtio-lun.xml |  1 +
 .../qemuxml2argv-virtio-rng-egd.xml                |  1 +
 .../qemuxml2argv-virtio-rng-random.xml             |  1 +
 tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml   |  1 +
 .../qemuxml2xmlout-balloon-device-auto.xml         |  1 +
 .../qemuxml2xmlout-channel-virtio-auto.xml         |  1 +
 .../qemuxml2xmlout-console-compat-auto.xml         |  1 +
 .../qemuxml2xmlout-console-virtio.xml              |  1 +
 .../qemuxml2xmlout-disk-mirror.xml                 |  1 +
 .../qemuxml2xmlout-disk-scsi-device-auto.xml       |  1 +
 .../qemuxml2xmlout-graphics-listen-network2.xml    |  1 +
 .../qemuxml2xmlout-graphics-spice-timeout.xml      |  1 +
 .../qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml  |  1 +
 .../qemuxml2xmloutdata/qemuxml2xmlout-metadata.xml |  1 +
 ...emuxml2xmlout-numad-auto-memory-vcpu-cpuset.xml |  1 +
 ...ad-auto-memory-vcpu-no-cpuset-and-placement.xml |  1 +
 .../qemuxml2xmlout-numad-auto-vcpu-no-numatune.xml |  1 +
 .../qemuxml2xmlout-serial-target-port-auto.xml     |  1 +
 .../qemuxml2xmlout-usb-ich9-ehci-addr.xml          |  1 +
 162 files changed, 269 insertions(+), 23 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 1e7de52..5740009 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9762,7 +9762,7 @@ virDomainLookupVcpuPin(virDomainDefPtr def,
     return NULL;
 }
 
-static int
+int
 virDomainDefMaybeAddController(virDomainDefPtr def,
                                int type,
                                int idx,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 3cb626b..565f0f8 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2553,6 +2553,12 @@ int virDomainObjListExport(virDomainObjListPtr doms,
 virDomainVcpuPinDefPtr virDomainLookupVcpuPin(virDomainDefPtr def,
                                               int vcpuid);
 
+int
+virDomainDefMaybeAddController(virDomainDefPtr def,
+                               int type,
+                               int idx,
+                               int model);
+
 char *virDomainDefGetDefaultEmulator(virDomainDefPtr def, virCapsPtr caps);
 
 #endif /* __DOMAIN_CONF_H */
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 32b4ae8..ca324de 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -116,6 +116,7 @@ virDomainDefFree;
 virDomainDefGenSecurityLabelDef;
 virDomainDefGetDefaultEmulator;
 virDomainDefGetSecurityLabelDef;
+virDomainDefMaybeAddController;
 virDomainDefParseFile;
 virDomainDefParseNode;
 virDomainDefParseString;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f052a91..3787ff1 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1196,6 +1196,7 @@ typedef uint8_t qemuDomainPCIAddressBus[QEMU_PCI_ADDRESS_SLOT_LAST];
 struct _qemuDomainPCIAddressSet {
     qemuDomainPCIAddressBus *used;
     virDevicePCIAddress lastaddr;
+    size_t nbuses;        /* allocation of 'used' */
 };
 
 
@@ -1206,6 +1207,10 @@ struct _qemuDomainPCIAddressSet {
 static bool qemuPCIAddressValidate(qemuDomainPCIAddressSetPtr addrs ATTRIBUTE_UNUSED,
                                    virDevicePCIAddressPtr addr)
 {
+    if (addrs->nbuses == 0) {
+        virReportError(VIR_ERR_XML_ERROR, "%s", _("No PCI buses available"));
+        return false;
+    }
     if (addr->domain != 0) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
                        _("Only PCI domain 0 is available"));
@@ -1321,7 +1326,15 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
     qemuDomainObjPrivatePtr priv = NULL;
 
     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
-        if (!(addrs = qemuDomainPCIAddressSetCreate(def)))
+        int nbuses = 0;
+        int i;
+
+        for (i = 0; i < def->ncontrollers; i++) {
+            if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI)
+                nbuses++;
+        }
+
+        if (!(addrs = qemuDomainPCIAddressSetCreate(def, nbuses)))
             goto cleanup;
 
         if (qemuAssignDevicePCISlots(def, qemuCaps, addrs) < 0)
@@ -1366,16 +1379,25 @@ int qemuDomainAssignAddresses(virDomainDefPtr def,
     return qemuDomainAssignPCIAddresses(def, qemuCaps, obj);
 }
 
-qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def)
+qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def,
+                                                         unsigned int nbuses)
 {
     qemuDomainPCIAddressSetPtr addrs;
+    int i;
 
     if (VIR_ALLOC(addrs) < 0)
         goto no_memory;
 
-    if (VIR_ALLOC_N(addrs->used, 1) < 0)
+    if (VIR_ALLOC_N(addrs->used, nbuses) < 0)
         goto no_memory;
 
+    addrs->nbuses = nbuses;
+
+    /* reserve slot 0 in every bus - it's used by the host bridge on bus 0
+     * and unusable on PCI bridges */
+    for (i = 0; i < nbuses; i++)
+        addrs->used[i][0] = 0xFF;
+
     if (virDomainDeviceInfoIterate(def, qemuCollectPCIAddress, addrs) < 0)
         goto error;
 
@@ -1604,12 +1626,6 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
     virDevicePCIAddressPtr addrptr;
     unsigned int *func = &tmp_addr.function;
 
-
-    /* Reserve slot 0 for the host bridge */
-    memset(&tmp_addr, 0, sizeof(tmp_addr));
-    if (qemuDomainPCIAddressReserveSlot(addrs, &tmp_addr) < 0)
-        goto error;
-
     /* Verify that first IDE and USB controllers (if any) is on the PIIX3, fn 1 */
     for (i = 0; i < def->ncontrollers ; i++) {
         /* First IDE controller lives on the PIIX3 at slot=1, function=1 */
@@ -1661,16 +1677,18 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
     /* PIIX3 (ISA bridge, IDE controller, something else unknown, USB controller)
      * hardcoded slot=1, multifunction device
      */
-    memset(&tmp_addr, 0, sizeof(tmp_addr));
-    tmp_addr.slot = 1;
-    for (*func = 0; *func < QEMU_PCI_ADDRESS_FUNCTION_LAST; (*func)++) {
-        if ((*func == 1 && reservedIDE) ||
-            (*func == 2 && reservedUSB))
-            /* we have reserved this pci address */
-            continue;
+    if (addrs->nbuses) {
+        memset(&tmp_addr, 0, sizeof(tmp_addr));
+        tmp_addr.slot = 1;
+        for (*func = 0; *func < QEMU_PCI_ADDRESS_FUNCTION_LAST; (*func)++) {
+            if ((*func == 1 && reservedIDE) ||
+                (*func == 2 && reservedUSB))
+                /* we have reserved this pci address */
+                continue;
 
-        if (qemuDomainPCIAddressReserveAddr(addrs, &tmp_addr) < 0)
-            goto error;
+            if (qemuDomainPCIAddressReserveAddr(addrs, &tmp_addr) < 0)
+                goto error;
+        }
     }
 
     if (def->nvideos > 0) {
@@ -1762,6 +1780,9 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
 
     /* Device controllers (SCSI, USB, but not IDE, FDC or CCID) */
     for (i = 0; i < def->ncontrollers ; i++) {
+        /* PCI root has no address */
+        if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI)
+            continue;
         /* FDC lives behind the ISA bridge; CCID is a usb device */
         if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_FDC ||
             def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_CCID)
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 1789c20..b05510b 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -196,7 +196,8 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def,
 int qemuDomainAssignPCIAddresses(virDomainDefPtr def,
                                  virQEMUCapsPtr qemuCaps,
                                  virDomainObjPtr obj);
-qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def);
+qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def,
+                                                         unsigned int nbuses);
 int qemuDomainPCIAddressReserveSlot(qemuDomainPCIAddressSetPtr addrs,
                                     virDevicePCIAddressPtr addr);
 int qemuDomainPCIAddressReserveAddr(qemuDomainPCIAddressSetPtr addrs,
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index a7aabdf..ab99538 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -673,6 +673,37 @@ qemuDomainDefPostParse(virDomainDefPtr def,
         !(def->emulator = virDomainDefGetDefaultEmulator(def, caps)))
         return -1;
 
+    /* Add implicit PCI root controller if the machine has one */
+    switch (def->os.arch) {
+    case VIR_ARCH_I686:
+    case VIR_ARCH_X86_64:
+        if (!def->os.machine)
+            break;
+        if (STRPREFIX(def->os.machine, "pc-q35") ||
+            STREQ(def->os.machine, "q35") ||
+            STREQ(def->os.machine, "isapc"))
+            break;
+        if (!STRPREFIX(def->os.machine, "pc-0.") &&
+            !STRPREFIX(def->os.machine, "pc-1.") &&
+            !STREQ(def->os.machine, "pc") &&
+            !STRPREFIX(def->os.machine, "rhel"))
+            break;
+
+    case VIR_ARCH_ALPHA:
+    case VIR_ARCH_PPC:
+    case VIR_ARCH_PPC64:
+    case VIR_ARCH_PPCEMB:
+    case VIR_ARCH_SH4:
+    case VIR_ARCH_SH4EB:
+        if (virDomainDefMaybeAddController(
+                def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 0,
+                VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) < 0)
+            return -1;
+        break;
+    default:
+        break;
+    }
+
     return 0;
 }
 
@@ -1255,7 +1286,8 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
 
     if ((flags & VIR_DOMAIN_XML_MIGRATABLE)) {
         int i;
-        virDomainControllerDefPtr usb = NULL;
+        int remove = 0;
+        virDomainControllerDefPtr usb = NULL, pci = NULL;
 
         /* If only the default USB controller is present, we can remove it
          * and make the XML compatible with older versions of libvirt which
@@ -1274,9 +1306,36 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
         if (usb && usb->idx == 0 && usb->model == -1) {
             VIR_DEBUG("Removing default USB controller from domain '%s'"
                       " for migration compatibility", def->name);
+            remove++;
+        } else {
+            usb = NULL;
+        }
+
+        /* Remove the default PCI controller if there is only one present
+         * and its model is pci-root */
+        for (i = 0; i < def->ncontrollers; i++) {
+            if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) {
+                if (pci) {
+                    pci = NULL;
+                    break;
+                }
+                pci = def->controllers[i];
+            }
+        }
+
+        if (pci && pci->idx == 0 &&
+            pci->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) {
+            VIR_DEBUG("Removing default 'pci-root' from domain '%s'"
+                      " for migration compatibility", def->name);
+            remove++;
+        } else {
+            pci = NULL;
+        }
+
+        if (remove) {
             controllers = def->controllers;
             ncontrollers = def->ncontrollers;
-            if (VIR_ALLOC_N(def->controllers, ncontrollers - 1) < 0) {
+            if (VIR_ALLOC_N(def->controllers, ncontrollers - remove) < 0) {
                 controllers = NULL;
                 virReportOOMError();
                 goto cleanup;
@@ -1284,10 +1343,12 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
 
             def->ncontrollers = 0;
             for (i = 0; i < ncontrollers; i++) {
-                if (controllers[i] != usb)
+                if (controllers[i] != usb && controllers[i] != pci)
                     def->controllers[def->ncontrollers++] = controllers[i];
             }
         }
+
+
     }
 
     ret = virDomainDefFormatInternal(def, flags, buf);
diff --git a/tests/domainsnapshotxml2xmlout/disk_snapshot.xml b/tests/domainsnapshotxml2xmlout/disk_snapshot.xml
index 57aef16..5f42bf5 100644
--- a/tests/domainsnapshotxml2xmlout/disk_snapshot.xml
+++ b/tests/domainsnapshotxml2xmlout/disk_snapshot.xml
@@ -72,6 +72,7 @@
       </disk>
       <controller type='usb' index='0'/>
       <controller type='ide' index='0'/>
+      <controller type='pci' index='0' model='pci-root'/>
       <memballoon model='virtio'/>
     </devices>
   </domain>
diff --git a/tests/domainsnapshotxml2xmlout/external_vm.xml b/tests/domainsnapshotxml2xmlout/external_vm.xml
index 8814bce..5a87ba6 100644
--- a/tests/domainsnapshotxml2xmlout/external_vm.xml
+++ b/tests/domainsnapshotxml2xmlout/external_vm.xml
@@ -37,6 +37,7 @@
       </disk>
       <controller type='usb' index='0'/>
       <controller type='ide' index='0'/>
+      <controller type='pci' index='0' model='pci-root'/>
       <memballoon model='virtio'/>
     </devices>
   </domain>
diff --git a/tests/domainsnapshotxml2xmlout/full_domain.xml b/tests/domainsnapshotxml2xmlout/full_domain.xml
index 65d1469..3a9e24d 100644
--- a/tests/domainsnapshotxml2xmlout/full_domain.xml
+++ b/tests/domainsnapshotxml2xmlout/full_domain.xml
@@ -30,6 +30,7 @@
       </disk>
       <controller type='usb' index='0'/>
       <controller type='ide' index='0'/>
+      <controller type='pci' index='0' model='pci-root'/>
       <memballoon model='virtio'/>
     </devices>
   </domain>
diff --git a/tests/domainsnapshotxml2xmlout/metadata.xml b/tests/domainsnapshotxml2xmlout/metadata.xml
index f961458..b385141 100644
--- a/tests/domainsnapshotxml2xmlout/metadata.xml
+++ b/tests/domainsnapshotxml2xmlout/metadata.xml
@@ -34,6 +34,7 @@
       </disk>
       <controller type='usb' index='0'/>
       <controller type='ide' index='0'/>
+      <controller type='pci' index='0' model='pci-root'/>
       <memballoon model='virtio'/>
     </devices>
   </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
index 0f48917..5d61b72 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
@@ -37,6 +37,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkiotune-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-blkiotune-device.xml
index f21e68a..743cf29 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-blkiotune-device.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkiotune-device.xml
@@ -32,6 +32,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkiotune.xml b/tests/qemuxml2argvdata/qemuxml2argv-blkiotune.xml
index a0445bb..87c6e50 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-blkiotune.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkiotune.xml
@@ -24,6 +24,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml
index 775101d..c9fcfbb 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml
@@ -23,6 +23,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml
index c877adf..f662990 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml
@@ -29,6 +29,7 @@
     <controller type='usb' index='0'/>
     <controller type='fdc' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.xml
index 38df8fe..62f562d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-disable.xml
@@ -23,6 +23,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml
index 0cd2a1b..bfae80e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml
@@ -26,6 +26,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml
index e7dad41..9230816 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml
index 3ac8517..c54ee52 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml
@@ -43,6 +43,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='fdc' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='user'>
       <mac address='00:11:22:33:44:55'/>
       <model type='virtio'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-guestfwd.xml b/tests/qemuxml2argvdata/qemuxml2argv-channel-guestfwd.xml
index 60e853c..2aea70a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-channel-guestfwd.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-guestfwd.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <channel type='pipe'>
       <source path='/tmp/guestfwd'/>
       <target type='guestfwd' address='10.0.2.1' port='4600'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml
index a280842..0d15ed5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml
@@ -24,6 +24,7 @@
     <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'/>
     <channel type='pty'>
       <target type='virtio' name='org.linux-kvm.port.foo'/>
       <address type='virtio-serial' controller='1' bus='0' port='3'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml
index 79336db..b4e7424 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml b/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml
index 37dc45a..1d7cc95 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
index a531df5..a767eea 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='pty'>
       <target port='0'/>
     </serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml
index 6028a2c..6d5a917 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml
@@ -22,6 +22,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='virtio-serial' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='pty'>
       <target port='0'/>
     </serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml
index 5e5bc04..ed6a2eb 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-disabled.xml
@@ -23,6 +23,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml
index ecc542e..dc43def 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-eoi-enabled.xml
@@ -23,6 +23,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.xml
index 16d71a3..89153a5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-kvmclock.xml
@@ -19,6 +19,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml
index 0bbe8e0..7d66eb0 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml
@@ -20,6 +20,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune.xml b/tests/qemuxml2argvdata/qemuxml2argv-cputune.xml
index 593e650..813d201 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cputune.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-aio.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-aio.xml
index 1f43938..ce4ef93 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-aio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-aio.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.xml
index 1aabfe2..a90be1c 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.xml
@@ -28,6 +28,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml
index 58cf0c7..259ea1f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml
index c4b7aff..8683233 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml
@@ -28,6 +28,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml
index 055bcb2..32e511e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml
@@ -28,6 +28,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-directsync.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-directsync.xml
index 55e84fb..0b85fb1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-directsync.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-directsync.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-unsafe.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-unsafe.xml
index d56dab6..4bd8e24 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-unsafe.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-unsafe.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-none.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-none.xml
index 82ba249..7fe9082 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-none.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-none.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wb.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wb.xml
index 7c16352..f0e7df4 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wb.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wb.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wt.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wt.xml
index 9358e19..5e0896a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wt.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wt.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.xml
index 69e9c24..0beda48 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.xml
index 6915798..00730f7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.xml
index 4c6b2b3..6ee75aa 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-enospace.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-enospace.xml
index d7cf3d0..92fcd8a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-enospace.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-enospace.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-stop.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-stop.xml
index ae85d04..83d5dd0 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-stop.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-stop.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-wreport-rignore.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-wreport-rignore.xml
index db0391a..ded9cd1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-wreport-rignore.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-policy-wreport-rignore.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml
index ecdc2ed..9cfa44f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml
@@ -23,6 +23,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.xml
index 38cb230..85fe2a9 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.xml
index e509b1b..7c1fdb1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-gluster.xml
@@ -29,6 +29,7 @@
       <target dev='vdb' bus='virtio'/>
     </disk>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.xml
index acaa503..ee87bdf 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi-auth.xml
@@ -26,6 +26,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml
index 7db3426..a6b13ab 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml
@@ -29,6 +29,7 @@
       <target dev='vdb' bus='virtio'/>
     </disk>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-export.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-export.xml
index 7a84604..dd52c39 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-export.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-export.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6-export.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6-export.xml
index c063db8..c3bfa34 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6-export.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6-export.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6.xml
index 540aa02..8087f90 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-ipv6.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-unix.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-unix.xml
index a4126f5..0955fee 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-unix.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd-unix.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd.xml
index 36301a9..e74b95f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-nbd.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ceph-env.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ceph-env.xml
index fa4328c..f1840d0 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ceph-env.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ceph-env.xml
@@ -31,6 +31,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ipv6.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ipv6.xml
index be4edbf..06e852d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ipv6.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-ipv6.xml
@@ -32,6 +32,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd.xml
index 081f9a6..bba512e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd.xml
@@ -31,6 +31,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-sheepdog.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-sheepdog.xml
index ac89dd7..d20ca3e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-sheepdog.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-sheepdog.xml
@@ -29,6 +29,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml
index cdad2cd..0d47dfa 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml
@@ -35,6 +35,7 @@
     <controller type='usb' index='0'/>
     <controller type='fdc' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml
index 84f96c3..d91b783 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml
@@ -40,6 +40,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml
index bec18f2..aa16a7e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml
@@ -37,6 +37,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device.xml
index 1285811..d3d8892 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-device.xml
@@ -27,6 +27,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='scsi' index='0' model='lsilogic'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-vpd.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-vpd.xml
index 96786e3..a0e1105 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-vpd.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-vpd.xml
@@ -33,6 +33,7 @@
     <controller type='usb' index='0'/>
     <controller type='scsi' index='0' model='virtio-scsi'/>
     <controller type='scsi' index='1' model='lsilogic'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-lun-passthrough-sgio.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-lun-passthrough-sgio.xml
index eecf609..7cf57ec 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-lun-passthrough-sgio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-lun-passthrough-sgio.xml
@@ -27,6 +27,7 @@
     <controller type='scsi' index='0' model='virtio-scsi'/>
     <controller type='scsi' index='1' model='lsilogic'/>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.xml
index 9a496ae..801207d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.xml
@@ -27,6 +27,7 @@
     <controller type='ide' index='0'/>
     <controller type='scsi' index='0' model='lsisas1078'/>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-virtio-scsi.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-virtio-scsi.xml
index 1cb5cb2..2d8df2f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-virtio-scsi.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-virtio-scsi.xml
@@ -27,6 +27,7 @@
     <controller type='ide' index='0'/>
     <controller type='scsi' index='0' model='virtio-scsi'/>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.xml
index d9ca230..a175b2d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.xml
@@ -27,6 +27,7 @@
     <controller type='ide' index='0'/>
     <controller type='scsi' index='0' model='ibmvscsi'/>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml
index acf9753..465a539 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml
@@ -32,6 +32,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='ide' index='1'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml
index 455cd87..5f8b8e0 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml
@@ -27,6 +27,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-num_queues.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-num_queues.xml
index dfa9cf1..0b0b656 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-num_queues.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-num_queues.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='scsi' index='0' model='virtio-scsi' num_queues='8'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
index 10214df..2ca305a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
@@ -39,6 +39,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml
index d3cbd0b..af3a4b7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml
@@ -39,6 +39,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.xml b/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.xml
index edea441..60fecb8 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.xml
@@ -24,6 +24,7 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
     </disk>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml
index 3173a41..10a8843 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-disabled.xml
@@ -20,6 +20,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml
index 22f0803..5d1e9dc 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-eoi-enabled.xml
@@ -20,6 +20,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml b/tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml
index 22e388f..b3b7e89 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml
@@ -34,6 +34,7 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
     </controller>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='user'>
       <mac address='52:54:00:e5:48:58'/>
       <model type='virtio'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml b/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
index 0c8ae45..360a7fd 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
@@ -24,6 +24,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='fdc' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml
index d17bda8..b005440 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5903' autoport='no'>
       <listen type='network' network='Bobsnetwork'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml
index 5f08b6c..64f173e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='sdl' display=':0.1' xauth='/root/.Xauthority' fullscreen='yes'/>
     <video>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml
index 5779e48..99d13a5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='sdl' display=':0.1' xauth='/root/.Xauthority'/>
     <video>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml
index a8c4ad8..5da94c2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1'>
       <listen type='address' address='127.0.0.1'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml
index 563d371..99d2996 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1'>
       <listen type='address' address='127.0.0.1'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml
index 9a36660..b22fbcc 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1' defaultMode='secure'>
       <listen type='address' address='127.0.0.1'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml
index 0892198..4fe20c3 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5903' autoport='no' listen='127.0.0.1'>
       <listen type='address' address='127.0.0.1'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml
index 1b2c5ed..b3214fd 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' socket='/tmp/foo.socket'/>
     <video>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml
index 0892198..4fe20c3 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5903' autoport='no' listen='127.0.0.1'>
       <listen type='address' address='127.0.0.1'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml
index 509c0a4..65f990b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5903' autoport='no' listen='2001:1:2:3:4:5:1234:1234'>
       <listen type='address' address='2001:1:2:3:4:5:1234:1234'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
index 0e44a48..63a0d2a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <hostdev mode='subsystem' type='pci' managed='yes'>
       <source>
         <address domain='0x0000' bus='0x06' slot='0x12' function='0x5'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
index 714b66c..26e8b42 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <hostdev mode='subsystem' type='usb' managed='no'>
       <source>
         <address bus='14' device='6'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml b/tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml
index b5a9816..0822b57 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml
@@ -24,6 +24,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hyperv.xml b/tests/qemuxml2argvdata/qemuxml2argv-hyperv.xml
index 9b7d8f2..0d5d0c7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hyperv.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hyperv.xml
@@ -21,6 +21,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml
index 3abdaea..c4534c4 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='usb'/>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml b/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml
index 2f8baee..208e2b7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='tablet' bus='usb'/>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml b/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml
index 8abcb51..a187aaa 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml
@@ -20,6 +20,7 @@
   <devices>
     <emulator>/usr/bin/kvm</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-lease.xml b/tests/qemuxml2argvdata/qemuxml2argv-lease.xml
index a9b311d..564f0b4 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-lease.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-lease.xml
@@ -27,6 +27,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <lease>
       <lockspace>somearea</lockspace>
       <key>thequickbrownfoxjumpedoverthelazydog</key>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.xml b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.xml
index 3fdb674..ab17e56 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-off.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.xml b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.xml
index 89482a8..7294ebb 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-core-on.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-migrate.xml b/tests/qemuxml2argvdata/qemuxml2argv-migrate.xml
index 9e2f162..742a553 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-migrate.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-migrate.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-minimal.xml b/tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
index 26fdf0d..4a938b3 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
@@ -26,6 +26,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml b/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml
index 8494e80..4997e5b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml
@@ -25,6 +25,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-s3.xml b/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-s3.xml
index 802bc09..5f5690d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-s3.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-s3.xml
@@ -25,6 +25,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-suspends.xml b/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-suspends.xml
index a12867d..a81f3c4 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-suspends.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-disable-suspends.xml
@@ -26,6 +26,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-enable-s4.xml b/tests/qemuxml2argvdata/qemuxml2argv-misc-enable-s4.xml
index e181c01..42ad266 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-enable-s4.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-enable-s4.xml
@@ -25,6 +25,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml b/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml
index 6561537..f066c13 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml b/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml
index 8494e80..4997e5b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml
@@ -25,6 +25,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml
index 885e854..4b8646d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml
@@ -41,6 +41,7 @@
     <controller type='virtio-serial' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
     </controller>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='network'>
       <mac address='52:54:00:24:a5:9f'/>
       <source network='default'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.xml
index 1f5317e..e8c2bf7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='ethernet'>
       <mac address='00:11:22:33:44:55'/>
       <script path='/etc/qemu-ifup'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-eth.xml
index aacc8a6..4bc79ce 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='ethernet'>
       <mac address='00:11:22:33:44:55'/>
       <script path='/etc/qemu-ifup'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.xml
index 9be0d2d..d65ef87 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='hostdev' managed='yes'>
       <mac address='00:11:22:33:44:55'/>
       <source>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-openvswitch.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-openvswitch.xml
index 9c2c5dc..e90de23 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-openvswitch.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-openvswitch.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='network'>
       <mac address='00:11:22:33:44:55'/>
       <source network='ovs-net'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-user.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-user.xml
index e99b9a1..e1d3046 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-user.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-user.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='user'>
       <mac address='00:11:22:33:44:55'/>
       <model type='rtl8139'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.xml
index 9b37f2f..1782831 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='user'>
       <mac address='00:11:22:33:44:55'/>
       <model type='virtio'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-network-portgroup.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-network-portgroup.xml
index 0fb9b2c..950a9db 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-network-portgroup.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-network-portgroup.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='network'>
       <mac address='00:11:22:33:44:55'/>
       <source network='rednet' portgroup='bob'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml
index 1bcffdf..a699f6e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='user'>
       <mac address='00:11:22:33:44:55'/>
       <model type='virtio'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.xml
index 9e2f162..742a553 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-numad-static-vcpu-no-numatune.xml b/tests/qemuxml2argvdata/qemuxml2argv-numad-static-vcpu-no-numatune.xml
index 71c1497..6e9720f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-numad-static-vcpu-no-numatune.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-numad-static-vcpu-no-numatune.xml
@@ -24,6 +24,7 @@
     </disk>
     <controller type='ide' index='0'/>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
index 855836c..53381fb 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <parallel type='tcp'>
       <source mode='bind' host='127.0.0.1' service='9999'/>
       <protocol type='raw'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml
index 371835d..a5e59b2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='user'>
       <mac address='52:54:00:24:a5:9f'/>
       <model type='virtio'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-no-env.xml b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-no-env.xml
index 7151b54..45ede22 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-no-env.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-no-env.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
   <qemu:commandline>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-disabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-disabled.xml
index 38a0f52..883a804 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-disabled.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-disabled.xml
@@ -16,6 +16,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-enabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-enabled.xml
index 3a9cd6f..a298b9d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-enabled.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-reboot-timeout-enabled.xml
@@ -16,6 +16,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml b/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml
index 37dc45a..1d7cc95 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml b/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml
index 9e2f162..742a553 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-baselabel.xml b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-baselabel.xml
index 98362a7..a80e781 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-baselabel.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-baselabel.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
   <seclabel type='dynamic' model='selinux' relabel='yes'>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.xml b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.xml
index 426b663..b790d07 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.xml
@@ -33,6 +33,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
   <seclabel type='dynamic' model='selinux' relabel='yes'>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.xml b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.xml
index 1a6878c..cbeae50 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
   <seclabel type='none'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static.xml b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static.xml
index 31d5f58..c1e4392 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-static.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
   <seclabel type='static' model='selinux' relabel='no'>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
index 1f7ee97..cde9718 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='dev'>
       <source path='/dev/ttyS2'/>
       <target port='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
index 1542f00..f7da73e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='file'>
       <source path='/tmp/serial.log'/>
       <target port='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
index 1eecfb7..f5215bb 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='pty'>
       <target port='0'/>
     </serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
index be71132..b5be682 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='pty'>
       <target port='0'/>
     </serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
index 9598df3..4c4a131 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='tcp'>
       <source mode='bind' host='127.0.0.1' service='9999'/>
       <protocol type='telnet'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
index 3144fe9..64361cc 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='tcp'>
       <source mode='connect' host='127.0.0.1' service='9999'/>
       <protocol type='raw'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
index 27d4170..b8895c2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='udp'>
       <source mode='bind' host='127.0.0.1' service='9999'/>
       <source mode='connect' host='127.0.0.1' service='9998'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
index c5f4dc5..b24269b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='unix'>
       <source mode='connect' path='/tmp/serial.sock'/>
       <target port='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
index 202478d..e63ff57 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='vc'>
       <target port='0'/>
     </serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-smp.xml b/tests/qemuxml2argvdata/qemuxml2argv-smp.xml
index 03daef6..83ddcb3 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-smp.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-smp.xml
@@ -25,6 +25,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-sound-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-sound-device.xml
index c588a24..7bf9ff9 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-sound-device.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-sound-device.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <sound model='pcspk'/>
     <sound model='es1370'/>
     <sound model='sb16'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-sound.xml b/tests/qemuxml2argvdata/qemuxml2argv-sound.xml
index 8e8078e..21db704 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-sound.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-sound.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <sound model='pcspk'/>
     <sound model='es1370'/>
     <sound model='sb16'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.xml b/tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.xml
index c7656b6..05b991f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-tpm-passthrough.xml
@@ -19,6 +19,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <tpm model='tpm-tis'>
       <backend type='passthrough'>
         <device path='/dev/tpm0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-redir.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-redir.xml
index 1b8b7ed..1ea66f5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-usb-redir.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-redir.xml
@@ -29,6 +29,7 @@
       <master startport='4'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x2'/>
     </controller>
+    <controller type='pci' index='0' model='pci-root'/>
     <redirdev bus='usb' type='tcp'>
       <source mode='connect' host='localhost' service='4000'/>
       <protocol type='raw'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-lun.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-lun.xml
index c4f0079..077ca92 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-lun.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-lun.xml
@@ -33,6 +33,7 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
     </controller>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='user'>
       <mac address='52:54:00:e5:48:58'/>
       <model type='virtio'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd.xml
index 4e52a32..c44dc7d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-egd.xml
@@ -15,6 +15,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
     <rng model='virtio'>
       <backend model='egd' type='tcp'>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml
index 354ae42..fc2be1e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml
@@ -15,6 +15,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
     <rng model='virtio'>
       <rate bytes='123' period='1234'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml b/tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml
index 52b4624..31c0152 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml
@@ -22,6 +22,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <watchdog model='ib700' action='poweroff'/>
     <memballoon model='virtio'/>
   </devices>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml
index c4d483a..6aed326 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml
index c257292..0175272 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml
@@ -26,6 +26,7 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
     </controller>
     <controller type='virtio-serial' index='2'/>
+    <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/qemuxml2xmlout-console-compat-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml
index e3821cd..1eca2a9 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat-auto.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='pty'>
       <target port='0'/>
     </serial>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml
index 031f821..3c865c3 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml
@@ -22,6 +22,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='virtio-serial' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <console type='pty'>
       <target type='virtio' port='0'/>
     </console>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml
index 29f406e..b3d8c59 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml
@@ -35,6 +35,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml
index 26e5547..7d152bc 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml
@@ -27,6 +27,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='scsi' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml
index fae1e6f..3f7c383 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='-1' autoport='yes' listen='1.2.3.4'>
       <listen type='address' address='1.2.3.4'/>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml
index 54b68fa..f793f62 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml
@@ -59,6 +59,7 @@
       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
     </controller>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <interface type='ethernet'>
       <mac address='52:54:00:71:70:89'/>
       <script path='/etc/qemu-ifup'/>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml
index 34ec18f..92dcacf 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml
@@ -26,6 +26,7 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata.xml
index c3a55cf..e32fb67 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata.xml
@@ -25,6 +25,7 @@
     </disk>
     <controller type='ide' index='0'/>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-memory-vcpu-cpuset.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-memory-vcpu-cpuset.xml
index ffca2a9..a5fef3d 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-memory-vcpu-cpuset.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-memory-vcpu-cpuset.xml
@@ -27,6 +27,7 @@
     </disk>
     <controller type='ide' index='0'/>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-memory-vcpu-no-cpuset-and-placement.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-memory-vcpu-no-cpuset-and-placement.xml
index 28ec59f..97aa619 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-memory-vcpu-no-cpuset-and-placement.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-memory-vcpu-no-cpuset-and-placement.xml
@@ -27,6 +27,7 @@
     </disk>
     <controller type='ide' index='0'/>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-vcpu-no-numatune.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-vcpu-no-numatune.xml
index 26de1b2..8fa7a05 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-vcpu-no-numatune.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-vcpu-no-numatune.xml
@@ -27,6 +27,7 @@
     </disk>
     <controller type='ide' index='0'/>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml
index 430d131..2254851 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-target-port-auto.xml
@@ -21,6 +21,7 @@
     </disk>
     <controller type='ide' index='0'/>
     <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <serial type='pty'>
       <target port='0'/>
     </serial>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-usb-ich9-ehci-addr.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-usb-ich9-ehci-addr.xml
index e7592e9..8119564 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-usb-ich9-ehci-addr.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-usb-ich9-ehci-addr.xml
@@ -44,6 +44,7 @@
     <controller type='usb' index='2' model='ich9-uhci2'>
       <master startport='2'/>
     </controller>
+    <controller type='pci' index='0' model='pci-root'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
-- 
1.8.1.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]