]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
xen: add QED format test
authorCédric Bosdonnat <cbosdonnat@suse.com>
Mon, 19 Dec 2016 09:13:35 +0000 (10:13 +0100)
committerCédric Bosdonnat <cbosdonnat@suse.com>
Wed, 21 Dec 2016 14:06:40 +0000 (15:06 +0100)
Follow up of commit 340bb6b7 to add unit tests for the QED format
support. Also add missing QED case in xenFormatXLDisk()

src/xenconfig/xen_xl.c
tests/xlconfigdata/test-disk-qed.cfg [new file with mode: 0644]
tests/xlconfigdata/test-disk-qed.xml [new file with mode: 0644]
tests/xlconfigtest.c

index 048ecd579c466f29ef4236f305e11d86990ebcec..18d9fe369b31bedfe5ac9a9aeafae4915d0f9543 100644 (file)
@@ -1050,6 +1050,9 @@ xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk)
         case VIR_STORAGE_FILE_QCOW2:
             virBufferAddLit(&buf, "qcow2");
             break;
+        case VIR_STORAGE_FILE_QED:
+            virBufferAddLit(&buf, "qed");
+            break;
       /* set default */
         default:
             virBufferAddLit(&buf, "raw");
diff --git a/tests/xlconfigdata/test-disk-qed.cfg b/tests/xlconfigdata/test-disk-qed.cfg
new file mode 100644 (file)
index 0000000..ee904e0
--- /dev/null
@@ -0,0 +1,25 @@
+name = "XenGuest2"
+uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
+maxmem = 579
+memory = 394
+vcpus = 1
+pae = 1
+acpi = 1
+apic = 1
+viridian = 0
+rtc_timeoffset = 0
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+device_model = "/usr/lib/xen/bin/qemu-system-i386"
+sdl = 0
+vnc = 1
+vncunused = 1
+vnclisten = "127.0.0.1"
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000" ]
+parallel = "none"
+serial = "none"
+builder = "hvm"
+boot = "d"
+disk = [ "target=/var/lib/libvirt/images/XenGuest2,format=qed,backendtype=qdisk,vdev=hda,access=rw" ]
diff --git a/tests/xlconfigdata/test-disk-qed.xml b/tests/xlconfigdata/test-disk-qed.xml
new file mode 100644 (file)
index 0000000..230382d
--- /dev/null
@@ -0,0 +1,45 @@
+<domain type='xen'>
+  <name>XenGuest2</name>
+  <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>592896</memory>
+  <currentMemory unit='KiB'>403456</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='xenfv'>hvm</type>
+    <loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
+    <boot dev='cdrom'/>
+  </os>
+  <features>
+    <acpi/>
+    <apic/>
+    <pae/>
+  </features>
+  <clock offset='variable' adjustment='0' basis='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <devices>
+    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qed'/>
+      <source file='/var/lib/libvirt/images/XenGuest2'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'/>
+    <interface type='bridge'>
+      <mac address='00:16:3e:66:92:9c'/>
+      <source bridge='xenbr1'/>
+      <script path='vif-bridge'/>
+      <model type='e1000'/>
+    </interface>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
+      <listen type='address' address='127.0.0.1'/>
+    </graphics>
+    <video>
+      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+    </video>
+  </devices>
+</domain>
index 31892da699293bf41e478e512a3e280ef47d2a16..cab0c0d478e0433c6edbc86a4397f63c135f3bb1 100644 (file)
@@ -258,6 +258,9 @@ mymain(void)
     DO_TEST("new-disk");
     DO_TEST_FORMAT("disk-positional-parms-full", false);
     DO_TEST_FORMAT("disk-positional-parms-partial", false);
+#ifdef LIBXL_HAVE_QED
+    DO_TEST_FORMAT("disk-qed", false);
+#endif
     DO_TEST("spice");
     DO_TEST("spice-features");
     DO_TEST("vif-rate");