[libvirt] [PATCH v3 04/10] Add 'period' for Memballoon statistics gathering capability

John Ferlan jferlan at redhat.com
Fri Jul 12 14:16:20 UTC 2013


On 07/12/2013 08:35 AM, Daniel P. Berrange wrote:
> ps, forgot to mention last time that you need to add a test case
> for this new XML - or just add the XML to 

1. Copied qemuxml2argv-balloon-device.xml to
qemuxml2argv-balloon-device-period.xml, adding 
<stats period='10'/>

2. Copied qemuxml2argv-balloon-device.arg to
qemuxml2argv-balloon-device-period.arg - made no changes
since the period is not part of the command

3. Added the "balloon-device-period"

I will squash in the following:

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-period.args b/te
new file mode 100644
index 0000000..48af1c4
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-period.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 -nographic -nodefconfig -nodefaults -monitor \
+unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -hda \
+/dev/HostVG/QEMUGuest1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,\
+addr=0x12
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-period.xml b/tes
new file mode 100644
index 0000000..c47c9bf
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-device-period.xml
@@ -0,0 +1,26 @@
+<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'>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+    </disk>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0' bus='0' slot='18' function='0'/>
+      <stats period='10'/>
+    </memballoon>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 7d7332f..0f96eef 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -837,6 +837,7 @@ mymain(void)
     DO_TEST("balloon-device", QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
     DO_TEST("balloon-device-auto",
             QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
+    DO_TEST("balloon-device-period", QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
     DO_TEST("sound", NONE);
     DO_TEST("sound-device",
             QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,


John




More information about the libvir-list mailing list