]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Fix race condition when detaching a device
authorPierre LIBEAU <pierre.libeau@corp.ovh.com>
Wed, 31 Aug 2022 12:22:51 +0000 (14:22 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 12 Oct 2022 12:08:42 +0000 (14:08 +0200)
commitf30843142aa0836423f5e3ff7a45707eb13ce553
tree79b5155afc76220fdfb68e17913dede5cb8b4764
parentc4dcec13189281f66aea013aa60b9a0fa51ccf33
qemu: Fix race condition when detaching a device

If QEMU replies to device_del command with "DeviceNotFound"
error, then libvirt doesn't clean the device from the live
configuration.

This is because qemuMonitorDelDevice() returns -2 to
qemuDomainDeleteDevice() and instead of calling
qemuDomainRemoveDevice() the qemuDomainDetachDeviceLive() jumps
right onto cleanup label.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/359
Signed-off-by: Pierre LIBEAU <pierre.libeau@corp.ovh.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_hotplug.c