Martin Polednik has posted comments on this change. Change subject: hostdev: add dynamic udev rule creation for iommu groups ......................................................................
Patch Set 4: (2 comments) http://gerrit.ovirt.org/#/c/36268/4/vdsm/hostdev.py File vdsm/hostdev.py: Line 132: 'udev': supervdsm.getProxy(). Line 133: vfioAppropriateDevice}, Line 134: _REATTACH: {'libvirt': libvirt_device.reAttach, Line 135: 'udev': supervdsm.getProxy(). Line 136: vfioRmAppropriateDevices}} > I wonder if code becomes a little cleaner without this top-level dictionary but then I would need two separate blocks for every action (do we detach or reattach?) with duplicates as far as I understand Line 137: Line 138: iommu_group = device_params['iommu_group'] Line 139: Line 140: if device_params['capability'] in _DETACH_REQUIRING_UDEV: Line 144: if device_params['capability'] in _DETACH_REQUIRING_CAPS: Line 145: if action == _DETACH: Line 146: # Unfortunately, we need to pass None (to use the default driver) Line 147: # to detachFlags and nothing to reAttach Line 148: function_mapping[action]['libvirt'](None) > you could use functools.partial and/or a lambda/helper if you think that di let me see... :) Line 149: else: Line 150: function_mapping[action]['libvirt']() Line 151: Line 152: -- To view, visit http://gerrit.ovirt.org/36268 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieac8d58e01d7277e535a2101d522961816ea88eb Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Martin Polednik <[email protected]> Gerrit-Reviewer: Michal Skrivanek <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
