]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainDetachWatchdog: Don't release watchdog address twice
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 23 May 2018 16:35:52 +0000 (18:35 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 28 May 2018 11:08:45 +0000 (13:08 +0200)
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_hotplug.c

index dba4bc9a6ede25391bf08455c89d7abcbbf878af..0062e27a3ba6e56ca57b3d3de2cb63018e708da0 100644 (file)
@@ -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);