I guess this is the missing piece for [1]. It did not hurt before (like
we didn't even see any errors/warns in logs) because in
qemuProcessUpdateDevices function virDomainDefFindDevice does not find
device deleted from libvirt config. But now in case of unpluggind usb
device from host we leave device in config and thus needlessly try to
call qemuDomainRemoveDevice second time.
[1] 0dfb8a1b9: qemu: Unplug devices that disappeared when libvirtd was down
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/qemu/qemu_driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 1a5bf449bf..9e35427354 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4534,6 +4534,9 @@ processDeviceDeletedEvent(virQEMUDriverPtr driver,
if (STRPREFIX(devAlias, "vcpu")) {
qemuDomainRemoveVcpuAlias(driver, vm, devAlias);
} else {
+ if (qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
+ goto endjob;
+
if (virDomainDefFindDevice(vm->def, devAlias, &dev, true) < 0)
goto endjob;
--
2.23.0