[PATCH v2 3/3] qemuDomainDetachDeviceLive: Handle hostevs with unassigned type of address

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

 



A <hostdev/> can have <address type='unassigned'/> which means
libvirt manages the device detach from/reattach to the host but
the device is never exposed to the guest. This means that we have
to take a shortcut during hotunplug (e.g. never ask QEMU on the
monitor to detach the device, or never wait for DEVICE_DELETED
event).

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_hotplug.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index b998b51f5a..31141cf7df 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -6219,6 +6219,10 @@ qemuDomainDetachDeviceLive(virDomainObj *vm,
                            info->addr.pci.slot, info->addr.pci.function);
             return -1;
         }
+    } else if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_UNASSIGNED) {
+        /* Unassigned devices are not exposed to QEMU, so remove the device
+         * explicitly, just like if we received DEVICE_DELETED event.*/
+        return qemuDomainRemoveDevice(driver, vm, &detach);
     }
 
     /*
-- 
2.34.1




[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