]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainDetachShmemDevice: Don't release shmem address twice
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 23 May 2018 16:19:16 +0000 (18:19 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 28 May 2018 11:08:44 +0000 (13:08 +0200)
On shmem unplug, when qemu doesn't support DEVICE_DELETED event
(or couple of other reasons) we do two things:

1) release shmem device address,
2) call qemuDomainRemoveShmemDevice() 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 cddd700af833d467fd8ed3090e40cdd6cca58975..dba4bc9a6ede25391bf08455c89d7abcbbf878af 100644 (file)
@@ -5291,10 +5291,8 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
         ret = -1;
 
     if (ret == 0) {
-        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1) {
-            qemuDomainReleaseDeviceAddress(vm, &shmem->info, NULL);
+        if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
             ret = qemuDomainRemoveShmemDevice(driver, vm, shmem);
-        }
     }
     qemuDomainResetDeviceRemoval(vm);