diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index b7edc2091a..1df80fcab6 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3280,9 +3280,6 @@ qemuDomainAttachWatchdog(virQEMUDriverPtr driver, if (qemuAssignDeviceWatchdogAlias(watchdog) < 0) return -1; - if (!(watchdogstr = qemuBuildWatchdogDevStr(vm->def, watchdog, priv->qemuCaps))) - return -1; - if (watchdog->model == VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB) { if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0) goto cleanup; @@ -3294,6 +3291,9 @@ qemuDomainAttachWatchdog(virQEMUDriverPtr driver, goto cleanup; } + if (!(watchdogstr = qemuBuildWatchdogDevStr(vm->def, watchdog, priv->qemuCaps))) + goto cleanup; + /* 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 */