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 030fe8a6c4..e268e2fd1e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4646,6 +4646,9 @@ processDeviceDeletedEvent(virQEMUDriverPtr driver,
if (STRPREFIX(devAlias, "vcpu")) {
qemuDomainRemoveVcpuAlias(driver, vm, devAlias);
} else {
+ if (qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)
+ goto cleanup;
+
if (virDomainDefFindDevice(vm->def, devAlias, &dev, true) < 0)
goto endjob;
--
2.23.0