Martin Polednik has uploaded a new change for review. Change subject: hostdev: move driver processing to device processor ......................................................................
hostdev: move driver processing to device processor Change-Id: I73cfe4e2a2f655d066b4ce233ab3e4df42c3f010 Signed-off-by: Martin Polednik <[email protected]> --- M lib/vdsm/hostdev.py 1 file changed, 11 insertions(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/58052/5 diff --git a/lib/vdsm/hostdev.py b/lib/vdsm/hostdev.py index 187a30f..8962fca 100644 --- a/lib/vdsm/hostdev.py +++ b/lib/vdsm/hostdev.py @@ -216,6 +216,17 @@ return {'is_assignable': is_assignable} +@_data_processor() +def _process_driver(device_xml): + try: + driver_name = device_xml.find('./driver/name').text + except AttributeError: + # No driver exposed by libvirt/sysfs. + return {} + else: + return {'driver': driver_name} + + def _process_storage(caps, params): try: model = caps.find('model').text @@ -283,14 +294,6 @@ name = devXML.find('name').text if name != 'computer': params['parent'] = devXML.find('parent').text - - try: - driver_name = devXML.find('./driver/name').text - except AttributeError: - # No driver exposed by libvirt/sysfs. - pass - else: - params['driver'] = driver_name caps = devXML.find('capability') params['capability'] = caps.attrib['type'] -- To view, visit https://gerrit.ovirt.org/58052 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73cfe4e2a2f655d066b4ce233ab3e4df42c3f010 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik <[email protected]> Gerrit-Reviewer: gerrit-hooks <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/admin/lists/[email protected]
