qemu: cold-plug of watchdog

https://bugzilla.redhat.com/show_bug.cgi?id=1447169

With this patch users can cold plug a watchdog. Things are pretty
simple because a domain can have at most one watchdog device.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2017-09-05 09:51:46 +02:00
parent 891b3c119e
commit 50c1dbafae

View File

@ -7995,10 +7995,18 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
dev->data.shmem = NULL;
break;
case VIR_DOMAIN_DEVICE_WATCHDOG:
if (vmdef->watchdog) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("domain already has a watchdog"));
return -1;
}
VIR_STEAL_PTR(vmdef->watchdog, dev->data.watchdog);
break;
case VIR_DOMAIN_DEVICE_INPUT:
case VIR_DOMAIN_DEVICE_SOUND:
case VIR_DOMAIN_DEVICE_VIDEO:
case VIR_DOMAIN_DEVICE_WATCHDOG:
case VIR_DOMAIN_DEVICE_GRAPHICS:
case VIR_DOMAIN_DEVICE_HUB:
case VIR_DOMAIN_DEVICE_SMARTCARD: