[libvirt] [PATCH] qemu: command: don't overwrite watchdog dump action

Cole Robinson crobinso at redhat.com
Wed Apr 13 15:33:13 UTC 2016


The watchdog cli refactoring in 4666b762 dropped the temporary variable
we use to convert to action=dump to action=pause for the qemu cli, and
stored the converted value in the domain structure. Our other watchdog
handling code then treated it as though the user requested action=pause,
which broke action=dump handling.

Revive the temporary variable to fix things.
---
 src/qemu/qemu_command.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 21f505b..434c731 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3350,6 +3350,7 @@ qemuBuildWatchdogCommandLine(virCommandPtr cmd,
     virDomainWatchdogDefPtr watchdog = def->watchdog;
     char *optstr;
     const char *action;
+    int action_id;
 
     if (!def->watchdog)
         return 0;
@@ -3376,10 +3377,12 @@ qemuBuildWatchdogCommandLine(virCommandPtr cmd,
     virCommandAddArg(cmd, optstr);
     VIR_FREE(optstr);
 
+    /* 'dump' action tells qemu to pause, then we handle the dump ourselves */
+    action_id = watchdog->action;
     if (watchdog->action == VIR_DOMAIN_WATCHDOG_ACTION_DUMP)
-        watchdog->action = VIR_DOMAIN_WATCHDOG_ACTION_PAUSE;
+        action_id = VIR_DOMAIN_WATCHDOG_ACTION_PAUSE;
 
-    action = virDomainWatchdogActionTypeToString(watchdog->action);
+    action = virDomainWatchdogActionTypeToString(action_id);
     if (!action) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        "%s", _("invalid watchdog action"));
-- 
2.7.3




More information about the libvir-list mailing list