From: Michal Privoznik Date: Wed, 23 May 2018 16:35:52 +0000 (+0200) Subject: qemuDomainDetachWatchdog: Don't release watchdog address twice X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ee87e5de3662d4f58d1a9cc69eca70580f649aa3;p=libvirt.git qemuDomainDetachWatchdog: Don't release watchdog address twice On watchdog unplug, when qemu doesn't support DEVICE_DELETED event (or couple of other reasons) we do two things: 1) release watchdog device address, 2) call qemuDomainRemoveWatchdog() which does 1) again. This is potentially dangerous. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index dba4bc9a6e..0062e27a3b 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -5344,10 +5344,8 @@ qemuDomainDetachWatchdog(virQEMUDriverPtr driver, ret = -1; if (ret == 0) { - if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1) { - qemuDomainReleaseDeviceAddress(vm, &watchdog->info, NULL); + if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1) ret = qemuDomainRemoveWatchdog(driver, vm, watchdog); - } } qemuDomainResetDeviceRemoval(vm);