Re: [libvirt] [PATCH 8/8] Add tests for blkdeviotune

2011-11-23 Thread Eric Blake
On 11/15/2011 02:02 AM, Lei Li wrote:
 Signed-off-by: Lei Li li...@linux.vnet.ibm.com
 Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com
 ---
  .../qemuxml2argv-blkdeviotune.args |4 ++
  .../qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml |   36 
 
  tests/qemuxml2argvtest.c   |1 +
  tests/qemuxml2xmltest.c|1 +
  4 files changed, 42 insertions(+), 0 deletions(-)
  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml

Yay - my favorite part of a good series - tests that prove it works.

Alas, these tests _didn't_ work, but caused 3 failures in 'make check'.
 Are you sure you tested these before submitting?

 
 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args 
 b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
 new file mode 100644
 index 000..6f34698
 --- /dev/null
 +++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.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 -name QEMUGuest1 -nographic -monitor 
 unix:/tmp/test-monitor, \
 +server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial 
 \
 +none -parallel none -usb

Where are the new iotune command line parameters?  Ah - they only show
up if qemu advertises -drive capability (hmm, wonder if that means we
should tweak something in qemu_command.c to error out if any non-zero
limits appear in pre-'-drive' qemu, or if we also need qemu_capabilities
to set a bit according to whether this feature works, to get a better
error message than what old qemu would give us).

 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml 
 b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
 new file mode 100644
 index 000..1fceef8
 --- /dev/null
 +++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
 @@ -0,0 +1,36 @@
 +domain type='qemu'

 +disk type='block' device='disk' snapshot='internal'

Let's just focus on iotune, and leave snapshot to other tests.

 +  driver name='qemu' type='qcow2' cache='none'/
 +  source dev='/dev/HostVG/QEMUGuest1'/
 +  target dev='hda' bus='ide'/
 +  iotune
 +total_bytes_sec5000/total_bytes_sec
 +total_iops_sec6000/total_iops_sec
 +  address type='drive' controller='0' bus='0' unit='0'/

Missing an /iotune.  I also realized that my tweak for 6/8 didn't
quite put the interleave in the rng in the right place, since I got a
verify failure for address being after instead of before iotune.

Here's what I'm squashing, once the rng stuff is fixed:

diff --git i/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
w/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
index 6f34698..9615290 100644
--- i/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
+++ w/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
@@ -1,4 +1,7 @@
 LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu
-S -M \
-pc -m 214 -smp 1 -name QEMUGuest1 -nographic -monitor
unix:/tmp/test-monitor, \
-server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none
-serial \
-none -parallel none -usb
+pc -m 214 -smp 1 -name QEMUGuest1 -nographic -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
+-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-0,cache=off,\
+bps=5000,iops=6000 -device \
+ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -usb \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git i/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
w/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
index 1fceef8..48553e4 100644
--- i/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
+++ w/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
@@ -14,22 +14,16 @@
   on_crashdestroy/on_crash
   devices
 emulator/usr/bin/qemu/emulator
-disk type='block' device='disk' snapshot='internal'
+disk type='block' device='disk'
   driver name='qemu' type='qcow2' cache='none'/
   source dev='/dev/HostVG/QEMUGuest1'/
   target dev='hda' bus='ide'/
   iotune
 total_bytes_sec5000/total_bytes_sec
 total_iops_sec6000/total_iops_sec
+  /iotune
   address type='drive' controller='0' bus='0' unit='0'/
 /disk
-disk type='block' device='cdrom' snapshot='no'
-  driver name='qemu' type='raw'/
-  source dev='/dev/HostVG/QEMUGuest2'/
-  target dev='hdc' bus='ide'/
-  readonly/
-  address type='drive' controller='0' bus='1' unit='0'/
-/disk
 controller type='ide' index='0'/
 memballoon model='virtio'/
   /devices
diff --git i/tests/qemuxml2argvtest.c w/tests/qemuxml2argvtest.c
index 27e8619..40ce00c 100644
--- i/tests/qemuxml2argvtest.c
+++ w/tests/qemuxml2argvtest.c
@@ -645,7 +645,8 @@ mymain(void)
 DO_TEST(blkiotune, false, 

[libvirt] [PATCH 8/8] Add tests for blkdeviotune

2011-11-15 Thread Lei Li

Signed-off-by: Lei Li li...@linux.vnet.ibm.com
Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com
---
 .../qemuxml2argv-blkdeviotune.args |4 ++
 .../qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml |   36 
 tests/qemuxml2argvtest.c   |1 +
 tests/qemuxml2xmltest.c|1 +
 4 files changed, 42 insertions(+), 0 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args 
b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
new file mode 100644
index 000..6f34698
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.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 -name QEMUGuest1 -nographic -monitor unix:/tmp/test-monitor, \
+server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial \
+none -parallel none -usb
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
new file mode 100644
index 000..1fceef8
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
@@ -0,0 +1,36 @@
+domain type='qemu'
+  nameQEMUGuest1/name
+  uuidc7a5fdbd-edaf-9455-926a-d65c16db1809/uuid
+  memory219100/memory
+  currentMemory219100/currentMemory
+  vcpu1/vcpu
+  os
+type arch='i686' machine='pc'hvm/type
+boot dev='hd'/
+  /os
+  clock offset='utc'/
+  on_poweroffdestroy/on_poweroff
+  on_rebootrestart/on_reboot
+  on_crashdestroy/on_crash
+  devices
+emulator/usr/bin/qemu/emulator
+disk type='block' device='disk' snapshot='internal'
+  driver name='qemu' type='qcow2' cache='none'/
+  source dev='/dev/HostVG/QEMUGuest1'/
+  target dev='hda' bus='ide'/
+  iotune
+total_bytes_sec5000/total_bytes_sec
+total_iops_sec6000/total_iops_sec
+  address type='drive' controller='0' bus='0' unit='0'/
+/disk
+disk type='block' device='cdrom' snapshot='no'
+  driver name='qemu' type='raw'/
+  source dev='/dev/HostVG/QEMUGuest2'/
+  target dev='hdc' bus='ide'/
+  readonly/
+  address type='drive' controller='0' bus='1' unit='0'/
+/disk
+controller type='ide' index='0'/
+memballoon model='virtio'/
+  /devices
+/domain
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index d9a6e8d..1ebb950 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -585,6 +585,7 @@ mymain(void)
 DO_TEST(blkiotune, false, QEMU_CAPS_NAME);
 DO_TEST(cputune, false, QEMU_CAPS_NAME);
 DO_TEST(numatune-memory, false, NONE);
+DO_TEST(blkdeviotune, false, QEMU_CAPS_NAME);
 
 DO_TEST(multifunction-pci-device, false,
 QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 3f37520..2e6b5c7 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -191,6 +191,7 @@ mymain(void)
 DO_TEST(event_idx);
 
 DO_TEST(usb-redir);
+DO_TEST(blkdeviotune);
 
 /* These tests generate different XML */
 DO_TEST_DIFFERENT(balloon-device-auto);
-- 
1.7.1

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


[libvirt] [PATCH 8/8] Add tests for blkdeviotune

2011-11-14 Thread Lei Li

Signed-off-by: Lei Li li...@linux.vnet.ibm.com
Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com
---
 .../qemuxml2argv-blkdeviotune.args |5 +++
 .../qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml |   37 
 tests/qemuxml2argvtest.c   |1 +
 tests/qemuxml2xmltest.c|1 +
 4 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args 
b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
new file mode 100644
index 000..9db8aff
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
@@ -0,0 +1,5 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -name QEMUGuest1 -nographic -monitor unix:/tmp/test-monitor, \
+server,nowait -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial \
+none -parallel none -usb
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
new file mode 100644
index 000..0cabb90
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
@@ -0,0 +1,37 @@
+domain type='qemu'
+  nameQEMUGuest1/name
+  uuidc7a5fdbd-edaf-9455-926a-d65c16db1809/uuid
+  memory219100/memory
+  currentMemory219100/currentMemory
+  vcpu1/vcpu
+  os
+type arch='i686' machine='pc'hvm/type
+boot dev='hd'/
+  /os
+  clock offset='utc'/
+  on_poweroffdestroy/on_poweroff
+  on_rebootrestart/on_reboot
+  on_crashdestroy/on_crash
+  devices
+emulator/usr/bin/qemu/emulator
+disk type='block' device='disk' snapshot='internal'
+  driver name='qemu' type='qcow2' cache='none'/
+  source dev='/dev/HostVG/QEMUGuest1'/
+  target dev='hda' bus='ide'/
+  iotune
+total_bytes_sec5000/total_bytes_sec
+total_iops_sec6000/total_iops_sec
+  address type='drive' controller='0' bus='0' unit='0'/
+/disk
+disk type='block' device='cdrom' snapshot='no'
+  driver name='qemu' type='raw'/
+  source dev='/dev/HostVG/QEMUGuest2'/
+  target dev='hdc' bus='ide'/
+  readonly/
+  address type='drive' controller='0' bus='1' unit='0'/
+/disk
+controller type='ide' index='0'/
+memballoon model='virtio'/
+  /devices
+/domain
+
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index d9a6e8d..1ebb950 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -585,6 +585,7 @@ mymain(void)
 DO_TEST(blkiotune, false, QEMU_CAPS_NAME);
 DO_TEST(cputune, false, QEMU_CAPS_NAME);
 DO_TEST(numatune-memory, false, NONE);
+DO_TEST(blkdeviotune, false, QEMU_CAPS_NAME);
 
 DO_TEST(multifunction-pci-device, false,
 QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 3f37520..2e6b5c7 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -191,6 +191,7 @@ mymain(void)
 DO_TEST(event_idx);
 
 DO_TEST(usb-redir);
+DO_TEST(blkdeviotune);
 
 /* These tests generate different XML */
 DO_TEST_DIFFERENT(balloon-device-auto);
-- 
1.7.1

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