]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: command: don't overwrite watchdog dump action
authorCole Robinson <crobinso@redhat.com>
Wed, 13 Apr 2016 15:20:19 +0000 (11:20 -0400)
committerCole Robinson <crobinso@redhat.com>
Thu, 14 Apr 2016 16:28:04 +0000 (12:28 -0400)
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

index 31e54088c8562e429302b78c018259b08994d621..bdc87c7c2ed0e157d3e4e7cb290e8ec33b26f0a2 100644 (file)
@@ -3350,6 +3350,7 @@ qemuBuildWatchdogCommandLine(virCommandPtr cmd,
     virDomainWatchdogDefPtr watchdog = def->watchdog;
     char *optstr;
     const char *action;
+    int actualAction;
 
     if (!def->watchdog)
         return 0;
@@ -3376,10 +3377,14 @@ qemuBuildWatchdogCommandLine(virCommandPtr cmd,
     virCommandAddArg(cmd, optstr);
     VIR_FREE(optstr);
 
+    /* qemu doesn't have a 'dump' action; we tell qemu to 'pause', then
+       libvirt listens for the watchdog event, and we perform the dump
+       ourselves. so convert 'dump' to 'pause' for the qemu cli */
+    actualAction = watchdog->action;
     if (watchdog->action == VIR_DOMAIN_WATCHDOG_ACTION_DUMP)
-        watchdog->action = VIR_DOMAIN_WATCHDOG_ACTION_PAUSE;
+        actualAction = VIR_DOMAIN_WATCHDOG_ACTION_PAUSE;
 
-    action = virDomainWatchdogActionTypeToString(watchdog->action);
+    action = virDomainWatchdogActionTypeToString(actualAction);
     if (!action) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        "%s", _("invalid watchdog action"));