[libvirt] [PATCH] Update documentation of watchdog dump option and add test data for it

Hu Tao hutao at cn.fujitsu.com
Fri Dec 10 05:52:11 UTC 2010


The xml watchdog dump option is converted to qemu watchdog pause arg
but it is not reasonable to convert it back from qemu watchdog pause
arg since there already is a xml watchdog pause option, so a test for
the dump option to convert it from arg to xml is not added.

---
I assume the dump option will appear in 0.8.7 and mark it since 0.8.7.

 docs/formatdomain.html.in                          |    8 +++++-
 docs/schemas/domain.rng                            |    1 +
 .../qemuxml2argv-watchdog-dump.args                |    1 +
 .../qemuxml2argv-watchdog-dump.xml                 |   26 ++++++++++++++++++++
 tests/qemuxml2argvtest.c                           |    1 +
 5 files changed, 36 insertions(+), 1 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.xml

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 8db8b52..305bcb1 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1687,14 +1687,20 @@ qemu-kvm -net nic,model=? /dev/null
           <li>'poweroff' — forcefully power off the guest</li>
           <li>'pause' — pause the guest</li>
           <li>'none' — do nothing</li>
+          <li>'dump' — automatic dump the guest
+            <span class="since">Since 0.8.7</span></li>
         </ul>
         <p>
-        Note that the 'shutdown' action requires that the guest
+        Note 1: the 'shutdown' action requires that the guest
         is responsive to ACPI signals.  In the sort of situations
         where the watchdog has expired, guests are usually unable
         to respond to ACPI signals.  Therefore using 'shutdown'
         is not recommended.
         </p>
+        <p>
+        Note 2: the directory to save dump files can be configured
+        by <code>auto_dump_path</code> in file /etc/libvirt/qemu.conf.
+        </p>
       </dd>
     </dl>
 
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 811d559..650ed7d 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -1472,6 +1472,7 @@
             <value>poweroff</value>
             <value>pause</value>
             <value>none</value>
+            <value>dump</value>
           </choice>
         </attribute>
       </optional>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.args b/tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.args
new file mode 100644
index 0000000..50b26f8
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.args
@@ -0,0 +1 @@
+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 -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -watchdog ib700 -watchdog-action pause
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.xml b/tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.xml
new file mode 100644
index 0000000..4314ec4
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-watchdog-dump.xml
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory>219200</memory>
+  <currentMemory>219200</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'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'/>
+    <watchdog model='ib700' action='dump'/>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 662f7bb..8328d65 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -399,6 +399,7 @@ mymain(int argc, char **argv)
     DO_TEST("watchdog", 0, false);
     DO_TEST("watchdog-device", QEMUD_CMD_FLAG_DEVICE |
             QEMUD_CMD_FLAG_NODEFCONFIG, false);
+    DO_TEST("watchdog-dump", 0, false);
     DO_TEST("balloon-device", QEMUD_CMD_FLAG_DEVICE |
             QEMUD_CMD_FLAG_NODEFCONFIG, false);
     DO_TEST("balloon-device-auto", QEMUD_CMD_FLAG_DEVICE |
-- 
1.7.3


-- 
Thanks,
Hu Tao




More information about the libvir-list mailing list