mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-28 08:35:22 +00:00
qemuDomainDetachShmemDevice: Don't release shmem address twice
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>
This commit is contained in:
parent
aac088d998
commit
c2fa7e7ffc
@ -5291,10 +5291,8 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver,
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1) {
|
if ((ret = qemuDomainWaitForDeviceRemoval(vm)) == 1)
|
||||||
qemuDomainReleaseDeviceAddress(vm, &shmem->info, NULL);
|
|
||||||
ret = qemuDomainRemoveShmemDevice(driver, vm, shmem);
|
ret = qemuDomainRemoveShmemDevice(driver, vm, shmem);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
qemuDomainResetDeviceRemoval(vm);
|
qemuDomainResetDeviceRemoval(vm);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user