diff mbox

[4/9] tests: qemuxml2argv: remove some QEMU_CAPS_DEVICE problem cases

Message ID d7cac3e12008ceaf5d8d8d66ba9e60e0de578b5c.1454011611.git.crobinso@redhat.com
State New
Headers show

Commit Message

Cole Robinson Jan. 28, 2016, 8:30 p.m. UTC
When we unconditionally enable QEMU_CAPS_DEVICE, these tests need
some massaging, so do it ahead of time to not mix it in with the
big test refresh.

- minimal-s390 is not a real world working config, so drop it
- disk-usb was testing for an old code path that will be removed.
  instead use it to test lack of USB disk support, and rename it
  to disk-usb-nosupport. Switch xml2xml to use disk-usb-device for
  input.
- cputune-numatune was needlessly using q35, switch it to an older
  machine type
---
 .../qemuxml2argv-cputune-numatune.args             |  7 +--
 .../qemuxml2argv-cputune-numatune.xml              | 12 +---
 .../qemuxml2argv-disk-usb-nosupport.xml}           |  0
 tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args  | 23 --------
 .../qemuxml2argv-minimal-s390.args                 | 21 -------
 .../qemuxml2argvdata/qemuxml2argv-minimal-s390.xml | 21 -------
 tests/qemuxml2argvtest.c                           |  5 +-
 .../qemuxml2xmlout-cputune-numatune.xml            | 14 +----
 .../qemuxml2xmlout-disk-cdrom-empty.xml            | 36 ++++++++++++
 .../qemuxml2xmlout-disk-drive-boot-cdrom.xml       | 37 +++++++++++++
 .../qemuxml2xmlout-disk-drive-boot-disk.xml        | 37 +++++++++++++
 .../qemuxml2xmlout-disk-drive-cache-directsync.xml | 37 +++++++++++++
 .../qemuxml2xmlout-disk-drive-cache-unsafe.xml     | 37 +++++++++++++
 .../qemuxml2xmlout-disk-drive-cache-v2-none.xml    | 37 +++++++++++++
 .../qemuxml2xmlout-disk-drive-cache-v2-wb.xml      | 37 +++++++++++++
 .../qemuxml2xmlout-disk-drive-cache-v2-wt.xml      | 37 +++++++++++++
 ...xml2xmlout-disk-drive-error-policy-enospace.xml | 37 +++++++++++++
 ...qemuxml2xmlout-disk-drive-error-policy-stop.xml | 37 +++++++++++++
 ...out-disk-drive-error-policy-wreport-rignore.xml | 37 +++++++++++++
 .../qemuxml2xmlout-disk-drive-network-gluster.xml  | 37 +++++++++++++
 .../qemuxml2xmlout-disk-drive-network-rbd-auth.xml | 42 ++++++++++++++
 ...uxml2xmlout-disk-drive-network-rbd-ceph-env.xml | 39 +++++++++++++
 .../qemuxml2xmlout-disk-drive-network-rbd-ipv6.xml | 40 ++++++++++++++
 .../qemuxml2xmlout-disk-drive-network-rbd.xml      | 64 ++++++++++++++++++++++
 .../qemuxml2xmlout-disk-drive-network-sheepdog.xml | 37 +++++++++++++
 .../qemuxml2xmlout-disk-usb-device.xml}            |  6 +-
 .../qemuxml2xmloutdata/qemuxml2xmlout-migrate.xml  | 30 ++++++++++
 .../qemuxml2xmlout-misc-uuid.xml                   | 33 +++++++++++
 .../qemuxml2xmlout-nographics-vga.xml              | 30 ++++++++++
 .../qemuxml2xmlout-qemu-ns-no-env.xml              | 34 ++++++++++++
 .../qemuxml2xmlout-restore-v2.xml                  | 30 ++++++++++
 .../qemuxml2xmloutdata/qemuxml2xmlout-watchdog.xml | 31 +++++++++++
 tests/qemuxml2xmltest.c                            |  2 +-
 33 files changed, 865 insertions(+), 99 deletions(-)
 rename tests/{qemuxml2xmloutdata/qemuxml2xmlout-disk-usb.xml => qemuxml2argvdata/qemuxml2argv-disk-usb-nosupport.xml} (100%)
 delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args
 delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args
 delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-cdrom-empty.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-boot-cdrom.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-boot-disk.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-directsync.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-unsafe.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-none.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-wb.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-wt.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-enospace.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-stop.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-wreport-rignore.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-gluster.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-auth.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-ceph-env.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-ipv6.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-sheepdog.xml
 rename tests/{qemuxml2argvdata/qemuxml2argv-disk-usb.xml => qemuxml2xmloutdata/qemuxml2xmlout-disk-usb-device.xml} (90%)
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-migrate.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-misc-uuid.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-nographics-vga.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-qemu-ns-no-env.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-restore-v2.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-watchdog.xml

-- 
2.5.0

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

Comments

Cole Robinson Feb. 5, 2016, 8:22 p.m. UTC | #1
On 01/28/2016 03:30 PM, Cole Robinson wrote:
> When we unconditionally enable QEMU_CAPS_DEVICE, these tests need

> some massaging, so do it ahead of time to not mix it in with the

> big test refresh.

> 

> - minimal-s390 is not a real world working config, so drop it

> - disk-usb was testing for an old code path that will be removed.

>   instead use it to test lack of USB disk support, and rename it

>   to disk-usb-nosupport. Switch xml2xml to use disk-usb-device for

>   input.

> - cputune-numatune was needlessly using q35, switch it to an older

>   machine type

> ---

>  .../qemuxml2argv-cputune-numatune.args             |  7 +--

>  .../qemuxml2argv-cputune-numatune.xml              | 12 +---

>  .../qemuxml2argv-disk-usb-nosupport.xml}           |  0

>  tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args  | 23 --------

>  .../qemuxml2argv-minimal-s390.args                 | 21 -------

>  .../qemuxml2argvdata/qemuxml2argv-minimal-s390.xml | 21 -------

>  tests/qemuxml2argvtest.c                           |  5 +-

>  .../qemuxml2xmlout-cputune-numatune.xml            | 14 +----

>  .../qemuxml2xmlout-disk-cdrom-empty.xml            | 36 ++++++++++++

>  .../qemuxml2xmlout-disk-drive-boot-cdrom.xml       | 37 +++++++++++++

>  .../qemuxml2xmlout-disk-drive-boot-disk.xml        | 37 +++++++++++++

>  .../qemuxml2xmlout-disk-drive-cache-directsync.xml | 37 +++++++++++++

>  .../qemuxml2xmlout-disk-drive-cache-unsafe.xml     | 37 +++++++++++++

>  .../qemuxml2xmlout-disk-drive-cache-v2-none.xml    | 37 +++++++++++++

>  .../qemuxml2xmlout-disk-drive-cache-v2-wb.xml      | 37 +++++++++++++

>  .../qemuxml2xmlout-disk-drive-cache-v2-wt.xml      | 37 +++++++++++++

>  ...xml2xmlout-disk-drive-error-policy-enospace.xml | 37 +++++++++++++

>  ...qemuxml2xmlout-disk-drive-error-policy-stop.xml | 37 +++++++++++++

>  ...out-disk-drive-error-policy-wreport-rignore.xml | 37 +++++++++++++

>  .../qemuxml2xmlout-disk-drive-network-gluster.xml  | 37 +++++++++++++

>  .../qemuxml2xmlout-disk-drive-network-rbd-auth.xml | 42 ++++++++++++++

>  ...uxml2xmlout-disk-drive-network-rbd-ceph-env.xml | 39 +++++++++++++

>  .../qemuxml2xmlout-disk-drive-network-rbd-ipv6.xml | 40 ++++++++++++++

>  .../qemuxml2xmlout-disk-drive-network-rbd.xml      | 64 ++++++++++++++++++++++

>  .../qemuxml2xmlout-disk-drive-network-sheepdog.xml | 37 +++++++++++++

>  .../qemuxml2xmlout-disk-usb-device.xml}            |  6 +-

>  .../qemuxml2xmloutdata/qemuxml2xmlout-migrate.xml  | 30 ++++++++++

>  .../qemuxml2xmlout-misc-uuid.xml                   | 33 +++++++++++

>  .../qemuxml2xmlout-nographics-vga.xml              | 30 ++++++++++

>  .../qemuxml2xmlout-qemu-ns-no-env.xml              | 34 ++++++++++++

>  .../qemuxml2xmlout-restore-v2.xml                  | 30 ++++++++++

>  .../qemuxml2xmloutdata/qemuxml2xmlout-watchdog.xml | 31 +++++++++++

>  tests/qemuxml2xmltest.c                            |  2 +-

>  33 files changed, 865 insertions(+), 99 deletions(-)

>  rename tests/{qemuxml2xmloutdata/qemuxml2xmlout-disk-usb.xml => qemuxml2argvdata/qemuxml2argv-disk-usb-nosupport.xml} (100%)

>  delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args

>  delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args

>  delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-cdrom-empty.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-boot-cdrom.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-boot-disk.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-directsync.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-unsafe.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-none.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-wb.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-wt.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-enospace.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-stop.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-wreport-rignore.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-gluster.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-auth.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-ceph-env.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-ipv6.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-sheepdog.xml

>  rename tests/{qemuxml2argvdata/qemuxml2argv-disk-usb.xml => qemuxml2xmloutdata/qemuxml2xmlout-disk-usb-device.xml} (90%)

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-migrate.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-misc-uuid.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-nographics-vga.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-qemu-ns-no-env.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-restore-v2.xml

>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-watchdog.xml


All these created files were from a bad rebase. They belong to patch #2. I've
fixed locally. Please only review the changes and files mentioned in the
commit message.

Thanks,
Cole

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

Patch

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args
index 7e5678d..bde6338 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args
@@ -7,16 +7,15 @@  QEMU_AUDIO_DRV=none \
 /usr/bin/qemu-system-x86_64 \
 -name dummy2 \
 -S \
--M pc-q35-2.3 \
+-M pc-0.11 \
 -m 128 \
 -smp 2,maxcpus=6,sockets=6,cores=1,threads=1 \
 -object iothread,id=iothread1 \
 -object iothread,id=iothread2 \
 -uuid 4d92ec27-9ebf-400b-ae91-20c71c647c19 \
 -nographic \
+-nodefaults \
 -monitor unix:/tmp/test-monitor,server,nowait \
 -no-acpi \
 -boot c \
--net none \
--serial none \
--parallel none
+-usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml
index 855e084..2258e96 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml
@@ -13,7 +13,7 @@ 
     <memory mode='strict' placement='auto'/>
   </numatune>
   <os>
-    <type arch='x86_64' machine='pc-q35-2.3'>hvm</type>
+    <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
   <clock offset='utc'/>
@@ -22,16 +22,6 @@ 
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <controller type='sata' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
-    </controller>
-    <controller type='pci' index='0' model='pcie-root'/>
-    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
-    </controller>
-    <controller type='pci' index='2' model='pci-bridge'>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
-    </controller>
     <input type='mouse' bus='ps2'/>
     <input type='keyboard' bus='ps2'/>
     <memballoon model='none'/>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-usb.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb-nosupport.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-usb.xml
rename to tests/qemuxml2argvdata/qemuxml2argv-disk-usb-nosupport.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args
deleted file mode 100644
index f41f8b4..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args
+++ /dev/null
@@ -1,23 +0,0 @@ 
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu \
--name QEMUGuest1 \
--S \
--M pc \
--m 214 \
--smp 1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--nographic \
--monitor unix:/tmp/test-monitor,server,nowait \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=ide,bus=0,unit=0 \
--usbdevice disk:/tmp/usbdisk.img \
--net none \
--serial none \
--parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args b/tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args
deleted file mode 100644
index a51d1f0..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.args
+++ /dev/null
@@ -1,21 +0,0 @@ 
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu \
--name QEMUGuest1 \
--S \
--M s390-virtio \
--m 214 \
--smp 1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--nographic \
--monitor unix:/tmp/test-monitor,server,nowait \
--no-acpi \
--boot c \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=virtio \
--net none \
--serial none \
--parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.xml b/tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.xml
deleted file mode 100644
index 7378bd4..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-minimal-s390.xml
+++ /dev/null
@@ -1,21 +0,0 @@ 
-<domain type='qemu'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory>219100</memory>
-  <currentMemory>219100</currentMemory>
-  <os>
-    <type arch='s390x' machine='s390-virtio'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu</emulator>
-    <disk type='block' device='disk'>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='virtio'/>
-    </disk>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index a5d4722..a298c42 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -593,7 +593,6 @@  mymain(void)
     DO_TEST("minimal", NONE);
     DO_TEST_PARSE_ERROR("minimal-no-memory", NONE);
     DO_TEST("minimal-msg-timestamp", QEMU_CAPS_MSG_TIMESTAMP);
-    DO_TEST("minimal-s390", NONE);
     DO_TEST("machine-aliases1", NONE);
     DO_TEST("machine-aliases2", QEMU_CAPS_KVM);
     DO_TEST("machine-core-on", QEMU_CAPS_MACHINE_OPT,
@@ -809,7 +808,7 @@  mymain(void)
             QEMU_CAPS_DEVICE, QEMU_CAPS_BOOTINDEX);
     DO_TEST_PARSE_ERROR("disk-device-lun-type-invalid",
                     QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_SCSI);
-    DO_TEST("disk-usb",  NONE);
+    DO_TEST_FAILURE("disk-usb-nosupport", QEMU_CAPS_DEVICE);
     DO_TEST("disk-usb-device",
             QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_USB_STORAGE,
             QEMU_CAPS_NODEFCONFIG);
@@ -1327,7 +1326,7 @@  mymain(void)
     DO_TEST_PARSE_ERROR("cputune-iothreadsched-toomuch", NONE);
     DO_TEST_PARSE_ERROR("cputune-vcpusched-overlap", NONE);
     DO_TEST("cputune-numatune", QEMU_CAPS_SMP_TOPOLOGY,
-            QEMU_CAPS_KVM,
+            QEMU_CAPS_KVM, QEMU_CAPS_DEVICE,
             QEMU_CAPS_OBJECT_IOTHREAD,
             QEMU_CAPS_OBJECT_MEMORY_RAM,
             QEMU_CAPS_OBJECT_MEMORY_FILE);
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml
index 855e084..1278b00 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cputune-numatune.xml
@@ -13,7 +13,7 @@ 
     <memory mode='strict' placement='auto'/>
   </numatune>
   <os>
-    <type arch='x86_64' machine='pc-q35-2.3'>hvm</type>
+    <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
   <clock offset='utc'/>
@@ -22,16 +22,8 @@ 
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <controller type='sata' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
-    </controller>
-    <controller type='pci' index='0' model='pcie-root'/>
-    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
-    </controller>
-    <controller type='pci' index='2' model='pci-bridge'>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
-    </controller>
+    <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
     <input type='mouse' bus='ps2'/>
     <input type='keyboard' bus='ps2'/>
     <memballoon model='none'/>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-cdrom-empty.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-cdrom-empty.xml
new file mode 100644
index 0000000..705c493
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-cdrom-empty.xml
@@ -0,0 +1,36 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='file' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-boot-cdrom.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-boot-cdrom.xml
new file mode 100644
index 0000000..80a6978
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-boot-cdrom.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='cdrom'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest2'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-boot-disk.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-boot-disk.xml
new file mode 100644
index 0000000..809eb80
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-boot-disk.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest2'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-directsync.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-directsync.xml
new file mode 100644
index 0000000..497014f
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-directsync.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='qcow2' cache='directsync'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest2'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-unsafe.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-unsafe.xml
new file mode 100644
index 0000000..e247651
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-unsafe.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='qcow2' cache='unsafe'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest2'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-none.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-none.xml
new file mode 100644
index 0000000..2ee3118
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-none.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest2'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-wb.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-wb.xml
new file mode 100644
index 0000000..95800b6
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-wb.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='qcow2' cache='writeback'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest2'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-wt.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-wt.xml
new file mode 100644
index 0000000..d0364ba
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-cache-v2-wt.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='qcow2' cache='writethrough'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest2'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-enospace.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-enospace.xml
new file mode 100644
index 0000000..1b9557c
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-enospace.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none' error_policy='enospace'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest2'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-stop.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-stop.xml
new file mode 100644
index 0000000..824740d
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-stop.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none' error_policy='stop'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest2'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-wreport-rignore.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-wreport-rignore.xml
new file mode 100644
index 0000000..ba3ee29
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-error-policy-wreport-rignore.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none' error_policy='report' rerror_policy='ignore'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest2'/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-gluster.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-gluster.xml
new file mode 100644
index 0000000..0c66e7f
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-gluster.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='gluster' name='Volume1/Image'>
+        <host name='example.org' port='6000'/>
+      </source>
+      <target dev='vda' bus='virtio'/>
+    </disk>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='gluster' name='Volume2/Image'>
+        <host transport='unix' socket='/path/to/sock'/>
+      </source>
+      <target dev='vdb' bus='virtio'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-auth.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-auth.xml
new file mode 100644
index 0000000..ac2e942
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-auth.xml
@@ -0,0 +1,42 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <auth username='myname'>
+        <secret type='ceph' usage='mycluster_myname'/>
+      </auth>
+      <source protocol='rbd' name='pool/image'>
+        <host name='mon1.example.org' port='6321'/>
+        <host name='mon2.example.org' port='6322'/>
+        <host name='mon3.example.org' port='6322'/>
+      </source>
+      <target dev='vda' bus='virtio'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-ceph-env.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-ceph-env.xml
new file mode 100644
index 0000000..2924969
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-ceph-env.xml
@@ -0,0 +1,39 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='rbd' name='pool/image'>
+        <host name='mon1.example.org' port='6321'/>
+        <host name='mon2.example.org' port='6322'/>
+        <host name='mon3.example.org' port='6322'/>
+      </source>
+      <target dev='vda' bus='virtio'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-ipv6.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-ipv6.xml
new file mode 100644
index 0000000..ac023ab
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd-ipv6.xml
@@ -0,0 +1,40 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='rbd' name='pool/image'>
+        <host name='::1' port='6321'/>
+        <host name='example.org' port='6789'/>
+        <host name='ffff:1234:567:abc::0f' port='6322'/>
+        <host name='2001:db8::ff00:42:8329' port='6322'/>
+      </source>
+      <target dev='vda' bus='virtio'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd.xml
new file mode 100644
index 0000000..b3783db
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-rbd.xml
@@ -0,0 +1,64 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='rbd' name='pool/image'>
+        <host name='mon1.example.org' port='6321'/>
+        <host name='mon2.example.org' port='6322'/>
+        <host name='mon3.example.org' port='6322'/>
+      </source>
+      <target dev='vda' bus='virtio'/>
+    </disk>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='rbd' name='pool/image'>
+        <snapshot name='asdf'/>
+      </source>
+      <target dev='vdb' bus='virtio'/>
+    </disk>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='rbd' name='pool/image'>
+        <host name='mon1.example.org' port='6321'/>
+        <host name='mon2.example.org' port='6322'/>
+        <host name='mon3.example.org' port='6322'/>
+        <snapshot name='foo'/>
+      </source>
+      <target dev='vdc' bus='virtio'/>
+    </disk>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='rbd' name='pool/image'>
+        <snapshot name='foo'/>
+        <config file='/blah/test.conf'/>
+      </source>
+      <target dev='vdd' bus='virtio'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-sheepdog.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-sheepdog.xml
new file mode 100644
index 0000000..001b0cd
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-network-sheepdog.xml
@@ -0,0 +1,37 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMU,Guest,,1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='sheepdog' name='image,with,commas'>
+        <host name='example.org' port='6000'/>
+      </source>
+      <target dev='vda' bus='virtio'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-usb-device.xml
similarity index 90%
rename from tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml
rename to tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-usb-device.xml
index 06d75aa..6e132cb 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-usb-device.xml
@@ -15,21 +15,19 @@ 
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <disk type='block' device='disk'>
-      <driver name='qemu' type='raw'/>
       <source dev='/dev/HostVG/QEMUGuest1'/>
       <target dev='hda' bus='ide'/>
       <address type='drive' controller='0' bus='0' target='0' unit='0'/>
     </disk>
     <disk type='file' device='disk'>
-      <driver name='qemu' type='raw'/>
       <source file='/tmp/usbdisk.img'/>
       <target dev='sda' bus='usb'/>
     </disk>
     <controller type='usb' index='0'/>
-    <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
+    <controller type='ide' index='0'/>
     <input type='mouse' bus='ps2'/>
     <input type='keyboard' bus='ps2'/>
-    <memballoon model='none'/>
+    <memballoon model='virtio'/>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-migrate.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-migrate.xml
new file mode 100644
index 0000000..23fc792
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-migrate.xml
@@ -0,0 +1,30 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-misc-uuid.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-misc-uuid.xml
new file mode 100644
index 0000000..800a0a9
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-misc-uuid.xml
@@ -0,0 +1,33 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <acpi/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-nographics-vga.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-nographics-vga.xml
new file mode 100644
index 0000000..23fc792
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-nographics-vga.xml
@@ -0,0 +1,30 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-qemu-ns-no-env.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-qemu-ns-no-env.xml
new file mode 100644
index 0000000..44c9064
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-qemu-ns-no-env.xml
@@ -0,0 +1,34 @@ 
+<domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+  <qemu:commandline>
+    <qemu:arg value='-unknown'/>
+    <qemu:arg value='parameter'/>
+  </qemu:commandline>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-restore-v2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-restore-v2.xml
new file mode 100644
index 0000000..23fc792
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-restore-v2.xml
@@ -0,0 +1,30 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-watchdog.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-watchdog.xml
new file mode 100644
index 0000000..eb7ed99
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-watchdog.xml
@@ -0,0 +1,31 @@ 
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <watchdog model='ib700' action='poweroff'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index fa6ca73..85b2e4e 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -339,7 +339,7 @@  mymain(void)
     DO_TEST("disk-floppy");
     DO_TEST("disk-many");
     DO_TEST("disk-xenvbd");
-    DO_TEST("disk-usb");
+    DO_TEST("disk-usb-device");
     DO_TEST("disk-virtio");
     DO_TEST("floppy-drive-fat");
     DO_TEST("disk-drive-boot-disk");