[libvirt] [PATCH 3/3] qemu: Testcase for Disk Geometry Override

Viktor Mihajlovski mihajlov at linux.vnet.ibm.com
Fri Jul 13 08:45:30 UTC 2012


From: J.B. Joret <jb at linux.vnet.ibm.com>

Adding qemuxml2arg test for disk geometry in drive specification.

Signed-off-by: J.B. Joret <jb at linux.vnet.ibm.com>
Signed-off-by: Viktor Mihajlovski <mihajlov at linux.vnet.ibm.com>
---
 .../qemuxml2argv-disk-geometry.args                |    4 +++
 .../qemuxml2argv-disk-geometry.xml                 |   26 ++++++++++++++++++++
 tests/qemuxml2argvtest.c                           |    2 +
 3 files changed, 32 insertions(+), 0 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args
new file mode 100644
index 0000000..7cd6650
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.args
@@ -0,0 +1,4 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,bus=0,unit=0,cyls=16383,heads=16,secs=63,trans=lba \
+-net none -serial none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.xml
new file mode 100644
index 0000000..f0cf4ae
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-geometry.xml
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory>219136</memory>
+  <currentMemory>219136</currentMemory>
+  <vcpu>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'>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <geometry cyls='16383' heads='16' secs='63' trans='lba'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'/>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index a4fa8fe..1a49c7c 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -776,6 +776,8 @@ mymain(void)
             QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_IDE_CD);
 
+    DO_TEST("disk-geometry", false, QEMU_CAPS_DRIVE);
+
     VIR_FREE(driver.stateDir);
     virCapabilitiesFree(driver.caps);
     VIR_FREE(map);
-- 
1.7.0.4




More information about the libvir-list mailing list