Change in vdsm[master]: hostdev: expose 'driver' attribute

mpolednik at redhat.com mpolednik at redhat.com
Tue Mar 22 10:17:11 UTC 2016


Martin Polednik has uploaded a new change for review.

Change subject: hostdev: expose 'driver' attribute
......................................................................

hostdev: expose 'driver' attribute

Device drivers are exposed via sysfs file, and those values are exposed
in libvirt's virNodeDevice XML. Exposing driver further allows us to do
some nice things such as displaying it to the user, who can then verify

*) that GPU is correctly bound to pci-stub,
*) used devices are bound to vfio-pci or
*) kernel cmdline settings.

Additionally, since host devices are not reattached (since
2bdcf4f99e47) it is important to propagate the value further, allowing
user to reattach devices that manually if one wishes.

Change-Id: I81463100dd07a2bc4fb241f89581db2060b8982e
Signed-off-by: Martin Polednik <mpolednik at redhat.com>
---
M lib/vdsm/hostdev.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/55044/1

diff --git a/lib/vdsm/hostdev.py b/lib/vdsm/hostdev.py
index 48933b6..151cd26 100644
--- a/lib/vdsm/hostdev.py
+++ b/lib/vdsm/hostdev.py
@@ -124,6 +124,12 @@
     if name != 'computer':
         params['parent'] = devXML.find('parent').text
 
+    try:
+        params['driver'] = devXML.find('./driver/name').text
+    except AttributeError:
+        # No driver exposed by libvirt/sysfs.
+        pass
+
     caps = devXML.find('capability')
     params['capability'] = caps.attrib['type']
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81463100dd07a2bc4fb241f89581db2060b8982e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik at redhat.com>


More information about the vdsm-patches mailing list