[PATCH v3 08/12] qemu: hotplug: update device list on device deleted event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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 e5594835c4..cd913385f5 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4715,6 +4715,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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux