[RFC PATCH v2 14/18] qemu: namespace: Hook up the discovery of mdevs into the namespace code

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

 



Again, as for all the other hostdev device types, make sure that the
/dev/vfio/<mdev_iommu_group> device will be added to the qemu namespace.

Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index c4d7a47..eb86385 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6852,10 +6852,12 @@ qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev,
     virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci;
     virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi;
     virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host;
+    virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev;
     virPCIDevicePtr pci = NULL;
     virUSBDevicePtr usb = NULL;
     virSCSIDevicePtr scsi = NULL;
     virSCSIVHostDevicePtr host = NULL;
+    virMediatedDevicePtr mdev = NULL;
     char *tmpPath = NULL;
     bool freeTmpPath = false;
 
@@ -6930,6 +6932,14 @@ qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev,
         }
 
         case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
+            if (!(mdev = virMediatedDeviceNew(mdevsrc->uuidstr)))
+                goto cleanup;
+
+            if (!(tmpPath = virMediatedDeviceGetIOMMUGroupDev(mdev)))
+                goto cleanup;
+
+            freeTmpPath = true;
+            break;
         case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
             break;
         }
@@ -6950,6 +6960,7 @@ qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev,
     virUSBDeviceFree(usb);
     virSCSIDeviceFree(scsi);
     virSCSIVHostDeviceFree(host);
+    virMediatedDeviceFree(mdev);
     if (freeTmpPath)
         VIR_FREE(tmpPath);
     return ret;
-- 
2.10.2

--
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