Nir Soffer has posted comments on this change.
Change subject: hostdev: add udev rules for USB devices
......................................................................
Patch Set 3: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/44679/3/vdsm/supervdsmServer
File vdsm/supervdsmServer:
Line 296: raise OSError(errno.EINVAL, "Could not trigger change for
device \
Line 297: %s, out %s\nerr %s" % (guid, out, err))
Line 298:
Line 299: @logDecorator
Line 300: def udevTriggerUSB(self, bus, device):
We should not have such apis.
We should change the udevTrigger api to be more generic, accepting the required options
that "udevadm trigger" accepts, so different code can use the same api to
trigger events.
For example, the guid parameter to udevTrigger does not make sense, and should be replaced
with the proper generic option like:
def udevTrigger(self, properties_match=()):
...
To trigger a device with guid, the caller should do:
udevTrigger(properties_match=["DM_NAME=xxxyyy"])
Which will generate this command line option:
--property-match="DM_NAME=xxxyyy"
Line 301: self.__udevReloadRules('usb_' + '_'.join((bus,
device)))
Line 302: cmd = [EXT_UDEVADM, 'trigger', '--verbose',
'--action', 'change',
Line 303: '--attr-match=busnum={}'.format(bus),
Line 304: '--attr-match=devnum={}'.format(device)]
--
To view, visit
https://gerrit.ovirt.org/44679
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f72f63186187254cd4aded0a2e6c396001ca28b
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes