Existing applications using libvirt are not aware of the disk
controller concept. Thus, after parsing the <disk> definitions
in the XML, it is neccessary to create <controller> elements
to satisfy all requested disks, as per their defined drive
addresses
* src/conf/domain_conf.c, src/conf/domain_conf.h,
src/libvirt_private.syms: Add virDomainDefAddDiskControllers()
method for populating disk controllers, and call it after
parsing disk definitions.
* src/qemu/qemu_conf.c: Call virDomainDefAddDiskControllers()
when doing ARGV -> XML conversion
* tests/qemuxml2argvdata/qemuxml2argv*.xml: Add disk controller
data to all data files which don't have it already
---
src/conf/domain_conf.c | 96 ++++++++++++++++++++
src/conf/domain_conf.h | 2 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_conf.c | 3 +
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-boot-floppy.xml | 2 +
.../qemuxml2argvdata/qemuxml2argv-boot-network.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-bootloader.xml | 1 +
.../qemuxml2argv-channel-guestfwd.xml | 1 +
.../qemuxml2argv-clock-localtime.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml | 1 +
.../qemuxml2argv-console-compat-chardev.xml | 1 +
.../qemuxml2argv-console-compat.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-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 +
.../qemuxml2argv-disk-drive-fat.xml | 1 +
.../qemuxml2argv-disk-drive-fmt-qcow.xml | 1 +
.../qemuxml2argv-disk-drive-shared.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-disk-floppy.xml | 2 +
tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-disk-virtio.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml | 1 +
.../qemuxml2argv-floppy-drive-fat.xml | 2 +
.../qemuxml2argv-graphics-sdl-fullscreen.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 1 +
.../qemuxml2argv-graphics-vnc-sasl.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 +
.../qemuxml2argv-hostdev-usb-product.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml | 1 +
.../qemuxml2argv-input-usbmouse.xml | 1 +
.../qemuxml2argv-input-usbtablet.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml | 1 +
.../qemuxml2argv-machine-aliases1.xml | 1 +
.../qemuxml2argv-machine-aliases2.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-migrate.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-minimal.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml | 1 +
.../qemuxml2argv-misc-no-reboot.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml | 1 +
.../qemuxml2argv-net-eth-ifname.xml | 1 +
.../qemuxml2argv-net-eth-names.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-net-eth.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-net-user.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml | 1 +
.../qemuxml2argv-parallel-tcp-chardev.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml | 1 +
.../qemuxml2argv-serial-dev-chardev.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml | 1 +
.../qemuxml2argv-serial-file-chardev.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-serial-file.xml | 1 +
.../qemuxml2argv-serial-many-chardev.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-serial-many.xml | 1 +
.../qemuxml2argv-serial-pty-chardev.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml | 1 +
.../qemuxml2argv-serial-tcp-chardev.xml | 1 +
.../qemuxml2argv-serial-tcp-telnet-chardev.xml | 1 +
.../qemuxml2argv-serial-tcp-telnet.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml | 1 +
.../qemuxml2argv-serial-udp-chardev.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml | 1 +
.../qemuxml2argv-serial-unix-chardev.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-serial-unix.xml | 1 +
.../qemuxml2argv-serial-vc-chardev.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-sound.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml | 1 +
80 files changed, 181 insertions(+), 0 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5caf2ca..5edd060 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3539,6 +3539,12 @@ static virDomainDefPtr virDomainDefParseXML(virConnectPtr conn,
}
VIR_FREE(nodes);
+ /* Auto-add any further disk controllers implied by declared <disk>
+ * elements, but not present as <controller> elements
+ */
+ if (virDomainDefAddDiskControllers(def) < 0)
+ goto error;
+
/* analysis of the filesystems */
if ((n = virXPathNodeSet(conn, "./devices/filesystem", ctxt, &nodes))
< 0) {
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
@@ -4139,6 +4145,96 @@ cleanup:
return obj;
}
+static int virDomainDefMaybeAddDiskController(virDomainDefPtr def,
+ int type,
+ int idx)
+{
+ int found = 0;
+ int i;
+ virDomainControllerDefPtr cont;
+
+ for (i = 0 ; (i < def->ncontrollers) && !found; i++) {
+ if (def->controllers[i]->type == type &&
+ def->controllers[i]->idx == idx)
+ found = 1;
+ }
+
+ if (found)
+ return 0;
+
+ if (VIR_ALLOC(cont) < 0) {
+ virReportOOMError(NULL);
+ return -1;
+ }
+
+ cont->type = type;
+ cont->idx = idx;
+
+ if (VIR_REALLOC_N(def->controllers, def->ncontrollers+1) < 0) {
+ VIR_FREE(cont);
+ virReportOOMError(NULL);
+ return -1;
+ }
+ def->controllers[def->ncontrollers] = cont;
+ def->ncontrollers++;
+
+ return 0;
+}
+
+static int virDomainDefAddDiskControllersForType(virDomainDefPtr def,
+ int controllerType,
+ int diskBus)
+{
+ int i;
+ int maxController = -1;
+
+ for (i = 0 ; i < def->ndisks ; i++) {
+ if (def->disks[i]->bus != diskBus)
+ continue;
+
+ if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE)
+ continue;
+
+ if ((int)def->disks[i]->info.addr.drive.controller > maxController)
+ maxController = def->disks[i]->info.addr.drive.controller;
+ }
+
+ for (i = 0 ; i <= maxController ; i++) {
+ if (virDomainDefMaybeAddDiskController(def, controllerType, i) < 0)
+ return -1;
+ }
+
+ return 0;
+}
+
+
+/*
+ * Based on the declared <address type=drive> info for any disks,
+ * add neccessary drive controllers which are not already present
+ * in the XML. This is for compat with existing apps which will
+ * not know/care about <controller> info in the XML
+ */
+int virDomainDefAddDiskControllers(virDomainDefPtr def)
+{
+ if (virDomainDefAddDiskControllersForType(def,
+ VIR_DOMAIN_CONTROLLER_TYPE_SCSI,
+ VIR_DOMAIN_DISK_BUS_SCSI) < 0)
+ return -1;
+
+ if (virDomainDefAddDiskControllersForType(def,
+ VIR_DOMAIN_CONTROLLER_TYPE_FDC,
+ VIR_DOMAIN_DISK_BUS_FDC) < 0)
+ return -1;
+
+ if (virDomainDefAddDiskControllersForType(def,
+ VIR_DOMAIN_CONTROLLER_TYPE_IDE,
+ VIR_DOMAIN_DISK_BUS_IDE) < 0)
+ return -1;
+
+ return 0;
+}
+
+
#endif /* ! PROXY */
/************************************************************************
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 9f2271c..1831d17 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -776,6 +776,8 @@ virDomainObjPtr virDomainObjParseNode(virConnectPtr conn,
xmlDocPtr xml,
xmlNodePtr root);
+int virDomainDefAddDiskControllers(virDomainDefPtr def);
+
#endif
char *virDomainDefFormat(virConnectPtr conn,
virDomainDefPtr def,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index ad57c49..a4a02e7 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -186,6 +186,7 @@ virDomainDeviceAddressClear;
virDomainControllerTypeToString;
virDomainControllerDefFree;
virDomainDeviceAddressTypeToString;
+virDomainDefAddDiskControllers;
# domain_event.h
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 26baece..ae9147d 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -4449,6 +4449,9 @@ virDomainDefPtr qemuParseCommandLine(virConnectPtr conn,
goto no_memory;
}
+ if (virDomainDefAddDiskControllers(def) < 0)
+ goto error;
+
return def;
no_memory:
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml
b/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml
index 6915145..cf0d3df 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml
@@ -20,5 +20,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml
b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml
index 0b6b084..cf3c5a8 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml
@@ -24,5 +24,7 @@
<target dev='fda' bus='fdc'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='fdc' index='0'/>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml
b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml
index 4de216e..a28372d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml
@@ -19,5 +19,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-bootloader.xml
b/tests/qemuxml2argvdata/qemuxml2argv-bootloader.xml
index 0501fd4..4af280c 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-bootloader.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-bootloader.xml
@@ -20,5 +20,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-channel-guestfwd.xml
b/tests/qemuxml2argvdata/qemuxml2argv-channel-guestfwd.xml
index aeba5be..8963350 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-channel-guestfwd.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-channel-guestfwd.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<channel type='pipe'>
<source path='/tmp/guestfwd'/>
<target type='guestfwd' address='10.0.2.1'
port='4600'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml
b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml
index 1db0d02..345ae22 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml
@@ -19,5 +19,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml
b/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml
index 9e9153f..533ea59 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml
@@ -19,5 +19,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-console-compat-chardev.xml
index 1f8f126..df694c7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='pty'>
<target port='0'/>
</serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
index 1f8f126..df694c7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='pty'>
<target port='0'/>
</serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.xml
index ff315e1..addbbf1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.xml
@@ -24,5 +24,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml
index 097d3dd..9c10551 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml
@@ -25,5 +25,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml
index 743e996..736e189 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-cdrom.xml
@@ -24,5 +24,6 @@
<target dev='hdc' bus='ide'/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml
index c1d3f4a..c379f31 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-boot-disk.xml
@@ -24,5 +24,6 @@
<target dev='hdc' bus='ide'/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</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 706b6e2..e689d9c 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-none.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-none.xml
@@ -27,5 +27,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</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 4d3fb0c..be00c4c 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wb.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wb.xml
@@ -27,5 +27,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</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 b81f1a4..edf776a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wt.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v1-wt.xml
@@ -27,5 +27,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</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 706b6e2..e689d9c 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-none.xml
@@ -27,5 +27,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</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 4d3fb0c..be00c4c 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wb.xml
@@ -27,5 +27,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</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 b81f1a4..edf776a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-v2-wt.xml
@@ -27,5 +27,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml
index 0a13d19..b2b1b4e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml
@@ -21,5 +21,6 @@
<readonly/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.xml
index 5c1d456..0b04e69 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fmt-qcow.xml
@@ -27,5 +27,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml
index 774decd..47afcd7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml
@@ -29,5 +29,6 @@
<readonly/>
<address type='drive' controller='0' bus='1'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml
index 37d178d..35474be 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml
@@ -29,5 +29,7 @@
<target dev='fdb' bus='fdc'/>
<address type='drive' controller='0' bus='0'
unit='1'/>
</disk>
+ <controller type='fdc' index='0'/>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml
index 6f9b705..467fa5d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml
@@ -34,5 +34,6 @@
<target dev='hdd' bus='ide'/>
<address type='drive' controller='0' bus='1'
unit='1'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml
index 3b86a11..8148626 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml
@@ -23,5 +23,6 @@
<source file='/tmp/usbdisk.img'/>
<target dev='sda' bus='usb'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
index c6cf300..2393073 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
@@ -33,5 +33,6 @@
<source file='/tmp/logs.img'/>
<target dev='vdb' bus='virtio'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml
index 17cc408..0c36457 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml
@@ -33,5 +33,6 @@
<source file='/tmp/logs.img'/>
<target dev='xvdg' bus='xen'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
b/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
index 7bc09fa..6da210d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
@@ -21,5 +21,7 @@
<readonly/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
+ <controller type='fdc' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml
b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml
index 8508be5..dcecd47 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<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 c83587b..f691bfe 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<input type='mouse' bus='ps2'/>
<graphics type='sdl' display=':0.1'
xauth='/root/.Xauthority'/>
<video>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml
b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml
index 15b561f..da0f3c6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5903' autoport='no'
listen='127.0.0.1'/>
<video>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml
b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml
index 15b561f..da0f3c6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5903' autoport='no'
listen='127.0.0.1'/>
<video>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml
b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml
index 15b561f..da0f3c6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5903' autoport='no'
listen='127.0.0.1'/>
<video>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
index 7c7e548..cb039af 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<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 08d78e6..c7d0d91 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<hostdev mode='subsystem' type='usb' managed='no'>
<source>
<address bus='14' device='6'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml
index 85a822b..3dc8eeb 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<hostdev mode='subsystem' type='usb' managed='no'>
<source>
<vendor id='0x0204'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml
b/tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml
index 92f2c47..2e4b75f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml
@@ -22,5 +22,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml
b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml
index d036eb4..8603d1b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<input type='mouse' bus='usb'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml
b/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml
index 82fd363..6c2a41b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<input type='tablet' bus='usb'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml
b/tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml
index 9976a56..91dd795 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='5903' autoport='no'
listen='127.0.0.1'/>
<video>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases1.xml
b/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases1.xml
index eca3a6f..268954d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases1.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases1.xml
@@ -19,5 +19,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml
b/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml
index b50e409..354b1d5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml
@@ -19,5 +19,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-migrate.xml
b/tests/qemuxml2argvdata/qemuxml2argv-migrate.xml
index 9e9153f..533ea59 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-migrate.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-migrate.xml
@@ -19,5 +19,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
b/tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
index 78b578b..334a9f9 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
@@ -19,5 +19,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml
b/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml
index fe0a00e..474832d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml
@@ -22,5 +22,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml
b/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml
index 2c53078..f75722f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml
@@ -19,5 +19,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml
b/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml
index fe0a00e..474832d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml
@@ -22,5 +22,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.xml
b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.xml
index 08aaa35..e24cd99 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-ifname.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<interface type='ethernet'>
<mac address='00:11:22:33:44:55'/>
<script path='/etc/qemu-ifup'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.xml
b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.xml
index c52d55b..105d3f6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<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 9aba26e..27238fc 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-eth.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-eth.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<interface type='ethernet'>
<mac address='00:11:22:33:44:55'/>
<script path='/etc/qemu-ifup'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-user.xml
b/tests/qemuxml2argvdata/qemuxml2argv-net-user.xml
index 3abda1c..525593d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-user.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-user.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<interface type='user'>
<mac address='00:11:22:33:44:55'/>
</interface>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml
b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml
index 4eac686..f8d9acf 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<interface type='user'>
<mac address='00:11:22:33:44:55'/>
<model type='virtio'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp-chardev.xml
index ab675b6..96a1ca5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<parallel type='tcp'>
<source mode='bind' host='127.0.0.1'
service='9999'/>
<protocol type='raw'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
index ab675b6..96a1ca5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<parallel type='tcp'>
<source mode='bind' host='127.0.0.1'
service='9999'/>
<protocol type='raw'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml
b/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml
index 9e9153f..533ea59 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml
@@ -19,5 +19,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml
b/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml
index 9e9153f..533ea59 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml
@@ -19,5 +19,6 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev-chardev.xml
index 06c40e8..ae906c2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='dev'>
<source path='/dev/ttyS2'/>
<target port='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
index 06c40e8..ae906c2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='dev'>
<source path='/dev/ttyS2'/>
<target port='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-file-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-file-chardev.xml
index 7c2cc03..bdc483f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-file-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-file-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='file'>
<source path='/tmp/serial.log'/>
<target port='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
index 7c2cc03..bdc483f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='file'>
<source path='/tmp/serial.log'/>
<target port='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-many-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-many-chardev.xml
index 4021129..38a9498 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-many-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-many-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='pty'>
<target port='0'/>
</serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
index 4021129..38a9498 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='pty'>
<target port='0'/>
</serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty-chardev.xml
index 1f8f126..df694c7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='pty'>
<target port='0'/>
</serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
index 1f8f126..df694c7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='pty'>
<target port='0'/>
</serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-chardev.xml
index 5d14515..a8a3526 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='tcp'>
<source mode='connect' host='127.0.0.1'
service='9999'/>
<protocol type='raw'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet-chardev.xml
index 1f940db..fb80042 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='tcp'>
<source mode='bind' host='127.0.0.1'
service='9999'/>
<protocol type='telnet'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
index 1f940db..fb80042 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<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 5d14515..a8a3526 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='tcp'>
<source mode='connect' host='127.0.0.1'
service='9999'/>
<protocol type='raw'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp-chardev.xml
index addf093..01dba47 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<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-udp.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
index addf093..01dba47 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<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-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix-chardev.xml
index 81884a1..7b90d7b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='unix'>
<source mode='connect' path='/tmp/serial.sock'/>
<target port='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
index 81884a1..7b90d7b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='unix'>
<source mode='connect' path='/tmp/serial.sock'/>
<target port='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc-chardev.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc-chardev.xml
index 0a1980c..76b3e2a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc-chardev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc-chardev.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='vc'>
<target port='0'/>
</serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
index 0a1980c..76b3e2a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<serial type='vc'>
<target port='0'/>
</serial>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-sound.xml
b/tests/qemuxml2argvdata/qemuxml2argv-sound.xml
index 3327c19..85f81ce 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-sound.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-sound.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<sound model='pcspk'/>
<sound model='es1370'/>
<sound model='sb16'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml
b/tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml
index 52ff117..07d2c14 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml
@@ -19,6 +19,7 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
+ <controller type='ide' index='0'/>
<watchdog model='ib700' action='poweroff'/>
</devices>
</domain>
--
1.6.5.2