mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
qemu_hotplug: Remove iommufd object if no longer needed
When removing last host device using IOMMUFD remove the iommufd object as well. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
1 parent
b21b6dcc72
commit
300ebf01b8
1 file changed
+8
@@ -4997,6 +4997,14 @@ qemuDomainRemoveHostDevice(virQEMUDriver *driver,
|
||||
}
|
||||
}
|
||||
|
||||
if (priv->iommufdState &&
|
||||
!virDomainDefHasPCIHostdevWithIOMMUFD(vm->def)) {
|
||||
qemuDomainObjEnterMonitor(vm);
|
||||
ignore_value(qemuMonitorDelObject(priv->mon, "iommufd0", false));
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
priv->iommufdState = false;
|
||||
}
|
||||
|
||||
virDomainAuditHostdev(vm, hostdev, "detach", true);
|
||||
|
||||
if (!virHostdevIsPCIDevice(hostdev) &&
|
||||
|
||||
Reference in new issue
Block a user