Martin Polednik has uploaded a new change for review.

Change subject: virt: allow a single dev from IOMMU group to be passed through
......................................................................

virt: allow a single dev from IOMMU group to be passed through

This patch introduces new spec param for hostdev, indicating that the
device should not be passed to host, but only detached and reattached.

When assigning host device, engine still needs to send the whole group
in vmCreate command, but devices that should not be present need to
have this tag set.

Change-Id: Ic266e74b5ffc4ae5c4627b004ade55a19c969511
Signed-off-by: Martin Polednik <[email protected]>
---
M vdsm/rpc/vdsmapi-schema.json
M vdsm/virt/vmdevices/hostdevice.py
2 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/41508/1

diff --git a/vdsm/rpc/vdsmapi-schema.json b/vdsm/rpc/vdsmapi-schema.json
index ee7b2bd..1b0db62 100644
--- a/vdsm/rpc/vdsmapi-schema.json
+++ b/vdsm/rpc/vdsmapi-schema.json
@@ -3431,10 +3431,15 @@
 #
 # Additional VM host device parameters.
 #
+# @iommu_placeholder:       Flag identifying that the device should not be
+#                           passed through, but needs to be detached and
+#                           reattached in order not to violate IOMMU group
+#                           restrictions.
+#
 # Since: 4.17.0
 ##
 {'type': 'VmHostDeviceSpecParams',
- 'data': {}}
+ 'data': {'iommuPlaceholder': 'bool'}}
 
 ##
 # @VmHostDevice:
diff --git a/vdsm/virt/vmdevices/hostdevice.py 
b/vdsm/virt/vmdevices/hostdevice.py
index a4ecb24..904e958 100644
--- a/vdsm/virt/vmdevices/hostdevice.py
+++ b/vdsm/virt/vmdevices/hostdevice.py
@@ -69,6 +69,10 @@
                 </hostdev>
             </devices>
             """
+
+        if self.specParams.get('iommuPlaceholder', None):
+            return ''
+
         hostdev = self.createXmlElem(hwclass.HOSTDEV, None)
         hostdev.setAttrs(managed='no', mode='subsystem',
                          type=self._deviceParams['capability'])


-- 
To view, visit https://gerrit.ovirt.org/41508
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic266e74b5ffc4ae5c4627b004ade55a19c969511
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to