]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuhotplugtest: Test live data
authorMartin Kletzander <mkletzan@redhat.com>
Wed, 30 Mar 2016 07:01:11 +0000 (09:01 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 9 Jun 2016 11:23:15 +0000 (13:23 +0200)
Until now, the only hot thing in this test was the name.  That's because
we set the id to '-1' before every test.  With this change, we test the
hotplug on live domains as the name suggests and as it should be.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
tests/qemuhotplugtest.c
tests/qemuhotplugtestdata/qemuhotplug-console-compat-2-live+console-virtio.xml [new file with mode: 0644]
tests/qemuhotplugtestdata/qemuhotplug-hotplug-base-live+disk-scsi.xml [moved from tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-scsi.xml with 73% similarity]
tests/qemuhotplugtestdata/qemuhotplug-hotplug-base-live+disk-usb.xml [moved from tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml with 72% similarity]
tests/qemuhotplugtestdata/qemuhotplug-hotplug-base-live+disk-virtio.xml [moved from tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-virtio.xml with 73% similarity]
tests/qemuxml2argvdata/qemuxml2argv-console-compat-2-live.xml [moved from tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml with 80% similarity]
tests/qemuxml2argvdata/qemuxml2argv-hotplug-base-live.xml [new file with mode: 0644]

index 447fb75fd632d6d29bda8f0511d43bf57f06ef88..5eb34c04b35907c2a225e2ab39b0b8472a89e329 100644 (file)
@@ -94,6 +94,9 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
 
     (*vm)->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID;
 
+    if (qemuDomainSetPrivatePaths(&driver, *vm) < 0)
+        goto cleanup;
+
     ret = 0;
  cleanup:
     return ret;
@@ -179,7 +182,6 @@ testQemuHotplugCheckResult(virDomainObjPtr vm,
     char *actual;
     int ret;
 
-    vm->def->id = -1;
     actual = virDomainDefFormat(vm->def, driver.caps,
                                 VIR_DOMAIN_DEF_FORMAT_SECURE);
     if (!actual)
@@ -426,62 +428,62 @@ mymain(void)
     /* Strange huh? Currently, only graphics can be updated :-P */
     DO_TEST_UPDATE("disk-cdrom", "disk-cdrom-nochange", true, false, NULL);
 
-    DO_TEST_ATTACH("console-compat-2", "console-virtio", false, true,
+    DO_TEST_ATTACH("console-compat-2-live", "console-virtio", false, true,
                    "chardev-add", "{\"return\": {\"pty\": \"/dev/pts/26\"}}",
                    "device_add", QMP_OK);
 
-    DO_TEST_DETACH("console-compat-2", "console-virtio", false, false,
+    DO_TEST_DETACH("console-compat-2-live", "console-virtio", false, false,
                    "device_del", QMP_OK,
                    "chardev-remove", QMP_OK);
 
-    DO_TEST_ATTACH("hotplug-base", "disk-virtio", false, true,
+    DO_TEST_ATTACH("hotplug-base-live", "disk-virtio", false, true,
                    "human-monitor-command", HMP("OK\\r\\n"),
                    "device_add", QMP_OK);
-    DO_TEST_DETACH("hotplug-base", "disk-virtio", false, false,
+    DO_TEST_DETACH("hotplug-base-live", "disk-virtio", false, false,
                    "device_del", QMP_OK,
                    "human-monitor-command", HMP(""));
 
-    DO_TEST_ATTACH_EVENT("hotplug-base", "disk-virtio", false, true,
+    DO_TEST_ATTACH_EVENT("hotplug-base-live", "disk-virtio", false, true,
                          "human-monitor-command", HMP("OK\\r\\n"),
                          "device_add", QMP_OK);
-    DO_TEST_DETACH("hotplug-base", "disk-virtio", true, true,
+    DO_TEST_DETACH("hotplug-base-live", "disk-virtio", true, true,
                    "device_del", QMP_OK,
                    "human-monitor-command", HMP(""));
-    DO_TEST_DETACH("hotplug-base", "disk-virtio", false, false,
+    DO_TEST_DETACH("hotplug-base-live", "disk-virtio", false, false,
                    "device_del", QMP_DEVICE_DELETED("virtio-disk4") QMP_OK,
                    "human-monitor-command", HMP(""));
 
-    DO_TEST_ATTACH("hotplug-base", "disk-usb", false, true,
+    DO_TEST_ATTACH("hotplug-base-live", "disk-usb", false, true,
                    "human-monitor-command", HMP("OK\\r\\n"),
                    "device_add", QMP_OK);
-    DO_TEST_DETACH("hotplug-base", "disk-usb", false, false,
+    DO_TEST_DETACH("hotplug-base-live", "disk-usb", false, false,
                    "device_del", QMP_OK,
                    "human-monitor-command", HMP(""));
 
-    DO_TEST_ATTACH_EVENT("hotplug-base", "disk-usb", false, true,
+    DO_TEST_ATTACH_EVENT("hotplug-base-live", "disk-usb", false, true,
                          "human-monitor-command", HMP("OK\\r\\n"),
                          "device_add", QMP_OK);
-    DO_TEST_DETACH("hotplug-base", "disk-usb", true, true,
+    DO_TEST_DETACH("hotplug-base-live", "disk-usb", true, true,
                    "device_del", QMP_OK,
                    "human-monitor-command", HMP(""));
-    DO_TEST_DETACH("hotplug-base", "disk-usb", false, false,
+    DO_TEST_DETACH("hotplug-base-live", "disk-usb", false, false,
                    "device_del", QMP_DEVICE_DELETED("usb-disk16") QMP_OK,
                    "human-monitor-command", HMP(""));
 
-    DO_TEST_ATTACH("hotplug-base", "disk-scsi", false, true,
+    DO_TEST_ATTACH("hotplug-base-live", "disk-scsi", false, true,
                    "human-monitor-command", HMP("OK\\r\\n"),
                    "device_add", QMP_OK);
-    DO_TEST_DETACH("hotplug-base", "disk-scsi", false, false,
+    DO_TEST_DETACH("hotplug-base-live", "disk-scsi", false, false,
                    "device_del", QMP_OK,
                    "human-monitor-command", HMP(""));
 
-    DO_TEST_ATTACH_EVENT("hotplug-base", "disk-scsi", false, true,
+    DO_TEST_ATTACH_EVENT("hotplug-base-live", "disk-scsi", false, true,
                          "human-monitor-command", HMP("OK\\r\\n"),
                          "device_add", QMP_OK);
-    DO_TEST_DETACH("hotplug-base", "disk-scsi", true, true,
+    DO_TEST_DETACH("hotplug-base-live", "disk-scsi", true, true,
                    "device_del", QMP_OK,
                    "human-monitor-command", HMP(""));
-    DO_TEST_DETACH("hotplug-base", "disk-scsi", false, false,
+    DO_TEST_DETACH("hotplug-base-live", "disk-scsi", false, false,
                    "device_del", QMP_DEVICE_DELETED("scsi0-0-0-5") QMP_OK,
                    "human-monitor-command", HMP(""));
 
diff --git a/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2-live+console-virtio.xml b/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2-live+console-virtio.xml
new file mode 100644 (file)
index 0000000..3495ee6
--- /dev/null
@@ -0,0 +1,130 @@
+<domain type='kvm' id='7'>
+  <name>f17</name>
+  <uuid>a1cd52eb-d37f-4717-fc6e-972f0774f4c9</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <resource>
+    <partition>/machine</partition>
+  </resource>
+  <os>
+    <type arch='x86_64' machine='pc-i440fx-1.4'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <acpi/>
+    <apic/>
+    <pae/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <pm>
+    <suspend-to-mem enabled='yes'/>
+    <suspend-to-disk enabled='yes'/>
+  </pm>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none'/>
+      <source file='/var/lib/libvirt/images/f17.qcow2'/>
+      <backingStore/>
+      <target dev='vda' bus='virtio'/>
+      <alias name='virtio-disk0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+    </disk>
+    <disk type='file' device='cdrom'>
+      <driver name='qemu' type='raw' cache='none'/>
+      <source file='/home/user/tmp/Fedora-17-x86_64-Live-KDE.iso'/>
+      <backingStore/>
+      <target dev='hdc' bus='ide'/>
+      <readonly/>
+      <alias name='ide0-1-0'/>
+      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'>
+      <alias name='ide'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+    </controller>
+    <controller type='usb' index='0'>
+      <alias name='usb'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'>
+      <alias name='pci'/>
+    </controller>
+    <controller type='virtio-serial' index='0'>
+      <alias name='virtio-serial0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+    </controller>
+    <interface type='network'>
+      <mac address='52:54:00:ea:35:6f'/>
+      <source network='default'/>
+      <bandwidth>
+        <inbound average='4000' peak='8000' floor='200' burst='1024'/>
+        <outbound average='4000' peak='8000' burst='1024'/>
+      </bandwidth>
+      <model type='virtio'/>
+      <alias name='net0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+    <serial type='pty'>
+      <target type='isa-serial' port='0'/>
+      <alias name='serial0'/>
+    </serial>
+    <serial type='pty'>
+      <target port='0'/>
+      <alias name='serial1'/>
+    </serial>
+    <serial type='tcp'>
+      <source mode='bind' host='0.0.0.0' service='2445'/>
+      <protocol type='raw'/>
+      <target port='1'/>
+      <alias name='serial2'/>
+    </serial>
+    <console type='pty'>
+      <target type='serial' port='0'/>
+      <alias name='serial0'/>
+    </console>
+    <console type='pty'>
+      <source path='/dev/pts/26'/>
+      <target type='virtio' port='1'/>
+      <alias name='console1'/>
+    </console>
+    <channel type='unix'>
+      <source mode='bind' path='/var/lib/libvirt/qemu/f17x86_64.agent'/>
+      <target type='virtio' name='org.qemu.guest_agent.0'/>
+      <alias name='channel0'/>
+      <address type='virtio-serial' controller='0' bus='0' port='1'/>
+    </channel>
+    <input type='tablet' bus='usb'>
+      <alias name='input0'/>
+    </input>
+    <input type='mouse' bus='ps2'>
+      <alias name='input1'/>
+    </input>
+    <input type='keyboard' bus='ps2'>
+      <alias name='input2'/>
+    </input>
+    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
+      <listen type='address' address='0.0.0.0'/>
+    </graphics>
+    <sound model='ich6'>
+      <alias name='sound0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+    </sound>
+    <video>
+      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+      <alias name='video0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+    </video>
+    <memballoon model='virtio'>
+      <alias name='balloon0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
+    </memballoon>
+  </devices>
+  <seclabel type='static' model='dac' relabel='no'>
+    <label>root:root</label>
+  </seclabel>
+</domain>
similarity index 73%
rename from tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-scsi.xml
rename to tests/qemuhotplugtestdata/qemuhotplug-hotplug-base-live+disk-scsi.xml
index cc970e9b3e82ddfd58c2226f7d2418e244674fd7..2fbdee472f1f9b09280db81823cb5333999adc1f 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='kvm'>
+<domain type='kvm' id='7'>
   <name>hotplug</name>
   <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
   <memory unit='KiB'>4194304</memory>
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='sdf' bus='scsi'/>
       <readonly/>
       <shareable/>
+      <alias name='scsi0-0-0-5'/>
       <address type='drive' controller='0' bus='0' target='0' unit='5'/>
     </disk>
     <controller type='usb' index='0'>
+      <alias name='usb'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='ide' index='0'>
+      <alias name='ide'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
     <controller type='scsi' index='0' model='virtio-scsi'>
+      <alias name='scsi0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
     </controller>
-    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='pci' index='0' model='pci-root'>
+      <alias name='pci'/>
+    </controller>
     <controller type='virtio-serial' index='0'>
+      <alias name='virtio-serial0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
     </controller>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <memballoon model='none'/>
+    <input type='mouse' bus='ps2'>
+      <alias name='input0'/>
+    </input>
+    <input type='keyboard' bus='ps2'>
+      <alias name='input1'/>
+    </input>
+    <memballoon model='none'>
+      <alias name='balloon0'/>
+    </memballoon>
   </devices>
   <seclabel type='none' model='none'/>
 </domain>
similarity index 72%
rename from tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml
rename to tests/qemuhotplugtestdata/qemuhotplug-hotplug-base-live+disk-usb.xml
index edd04ed01bf47c7b596d8bedd2b37033f870ade7..41039a48c3d4c9d9b4ee9c5558ee4d2f751b950f 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='kvm'>
+<domain type='kvm' id='7'>
   <name>hotplug</name>
   <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
   <memory unit='KiB'>4194304</memory>
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='sdq' bus='usb'/>
       <readonly/>
       <shareable/>
+      <alias name='usb-disk16'/>
     </disk>
     <controller type='usb' index='0'>
+      <alias name='usb'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='ide' index='0'>
+      <alias name='ide'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
     <controller type='scsi' index='0' model='virtio-scsi'>
+      <alias name='scsi0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
     </controller>
-    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='pci' index='0' model='pci-root'>
+      <alias name='pci'/>
+    </controller>
     <controller type='virtio-serial' index='0'>
+      <alias name='virtio-serial0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
     </controller>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <memballoon model='none'/>
+    <input type='mouse' bus='ps2'>
+      <alias name='input0'/>
+    </input>
+    <input type='keyboard' bus='ps2'>
+      <alias name='input1'/>
+    </input>
+    <memballoon model='none'>
+      <alias name='balloon0'/>
+    </memballoon>
   </devices>
   <seclabel type='none' model='none'/>
 </domain>
similarity index 73%
rename from tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-virtio.xml
rename to tests/qemuhotplugtestdata/qemuhotplug-hotplug-base-live+disk-virtio.xml
index b8a9c58bbd188471b50b860e7cd53838202deb10..8954fb5898d3a35411b9d789249bdd7567aa17e7 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='kvm'>
+<domain type='kvm' id='7'>
   <name>hotplug</name>
   <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
   <memory unit='KiB'>4194304</memory>
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='vde' bus='virtio'/>
       <readonly/>
       <shareable/>
+      <alias name='virtio-disk4'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
     </disk>
     <controller type='usb' index='0'>
+      <alias name='usb'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='ide' index='0'>
+      <alias name='ide'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
     <controller type='scsi' index='0' model='virtio-scsi'>
+      <alias name='scsi0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
     </controller>
-    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='pci' index='0' model='pci-root'>
+      <alias name='pci'/>
+    </controller>
     <controller type='virtio-serial' index='0'>
+      <alias name='virtio-serial0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
     </controller>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <memballoon model='none'/>
+    <input type='mouse' bus='ps2'>
+      <alias name='input0'/>
+    </input>
+    <input type='keyboard' bus='ps2'>
+      <alias name='input1'/>
+    </input>
+    <memballoon model='none'>
+      <alias name='balloon0'/>
+    </memballoon>
   </devices>
   <seclabel type='none' model='none'/>
 </domain>
similarity index 80%
rename from tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml
rename to tests/qemuxml2argvdata/qemuxml2argv-console-compat-2-live.xml
index a2796ecdbb33561b8a086e536f6ff2ddd8fb8c59..b36af270c3ff3c88a84ef6937c70f6e0664a38fa 100644 (file)
@@ -1,4 +1,4 @@
-<domain type='kvm'>
+<domain type='kvm' id='7'>
   <name>f17</name>
   <uuid>a1cd52eb-d37f-4717-fc6e-972f0774f4c9</uuid>
   <memory unit='KiB'>1048576</memory>
     <disk type='file' device='disk'>
       <driver name='qemu' type='qcow2' cache='none'/>
       <source file='/var/lib/libvirt/images/f17.qcow2'/>
+      <backingStore/>
       <target dev='vda' bus='virtio'/>
+      <alias name='virtio-disk0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
     </disk>
     <disk type='file' device='cdrom'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/home/user/tmp/Fedora-17-x86_64-Live-KDE.iso'/>
+      <backingStore/>
       <target dev='hdc' bus='ide'/>
       <readonly/>
+      <alias name='ide0-1-0'/>
       <address type='drive' controller='0' bus='1' target='0' unit='0'/>
     </disk>
     <controller type='ide' index='0'>
+      <alias name='ide'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
     <controller type='usb' index='0'>
+      <alias name='usb'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
-    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='pci' index='0' model='pci-root'>
+      <alias name='pci'/>
+    </controller>
     <controller type='virtio-serial' index='0'>
+      <alias name='virtio-serial0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
     </controller>
     <interface type='network'>
         <outbound average='4000' peak='8000' burst='1024'/>
       </bandwidth>
       <model type='virtio'/>
+      <alias name='net0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
     </interface>
     <serial type='pty'>
       <target type='isa-serial' port='0'/>
+      <alias name='serial0'/>
     </serial>
     <serial type='pty'>
       <target port='0'/>
+      <alias name='serial1'/>
     </serial>
     <serial type='tcp'>
       <source mode='bind' host='0.0.0.0' service='2445'/>
       <protocol type='raw'/>
       <target port='1'/>
+      <alias name='serial2'/>
     </serial>
     <console type='pty'>
       <target type='serial' port='0'/>
-    </console>
-    <console type='pty'>
-      <target type='virtio' port='1'/>
+      <alias name='serial0'/>
     </console>
     <channel type='unix'>
       <source mode='bind' path='/var/lib/libvirt/qemu/f17x86_64.agent'/>
       <target type='virtio' name='org.qemu.guest_agent.0'/>
+      <alias name='channel0'/>
       <address type='virtio-serial' controller='0' bus='0' port='1'/>
     </channel>
-    <input type='tablet' bus='usb'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
+    <input type='tablet' bus='usb'>
+      <alias name='input0'/>
+    </input>
+    <input type='mouse' bus='ps2'>
+      <alias name='input1'/>
+    </input>
+    <input type='keyboard' bus='ps2'>
+      <alias name='input2'/>
+    </input>
     <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
       <listen type='address' address='0.0.0.0'/>
     </graphics>
     <sound model='ich6'>
+      <alias name='sound0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
     </sound>
     <video>
       <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+      <alias name='video0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
     </video>
     <memballoon model='virtio'>
+      <alias name='balloon0'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
     </memballoon>
   </devices>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hotplug-base-live.xml b/tests/qemuxml2argvdata/qemuxml2argv-hotplug-base-live.xml
new file mode 100644 (file)
index 0000000..3f14e70
--- /dev/null
@@ -0,0 +1,52 @@
+<domain type='kvm' id='7'>
+  <name>hotplug</name>
+  <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+  <memory unit='KiB'>4194304</memory>
+  <currentMemory unit='KiB'>4194304</currentMemory>
+  <vcpu placement='static'>4</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <acpi/>
+    <apic/>
+    <pae/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <devices>
+    <emulator>/usr/libexec/qemu-kvm</emulator>
+    <controller type='usb' index='0'>
+      <alias name='usb'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+    </controller>
+    <controller type='ide' index='0'>
+      <alias name='ide'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+    </controller>
+    <controller type='scsi' index='0' model='virtio-scsi'>
+      <alias name='scsi0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'>
+      <alias name='pci'/>
+    </controller>
+    <controller type='virtio-serial' index='0'>
+      <alias name='virtio-serial0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+    </controller>
+    <input type='mouse' bus='ps2'>
+      <alias name='input0'/>
+    </input>
+    <input type='keyboard' bus='ps2'>
+      <alias name='input1'/>
+    </input>
+    <memballoon model='none'>
+      <alias name='balloon0'/>
+    </memballoon>
+  </devices>
+  <seclabel type='none' model='none'/>
+</domain>