From 886cfe71ae732f2b5987599e3dbf3c045893f1d9 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 13 Apr 2016 11:20:19 -0400 Subject: [PATCH] qemu: command: don't overwrite watchdog dump action 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. (cherry picked from commit a91177c8f7b432e67d2e232650d7debbbfc694da) --- src/qemu/qemu_command.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9001d064ca..03f9a6c092 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3354,6 +3354,7 @@ qemuBuildWatchdogCommandLine(virCommandPtr cmd, virDomainWatchdogDefPtr watchdog = def->watchdog; char *optstr; const char *action; + int actualAction; if (!def->watchdog) return 0; @@ -3380,10 +3381,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"));