Change in vdsm[master]: hostdev: add udev rules for USB devices

nsoffer at redhat.com nsoffer at redhat.com
Tue Aug 11 16:05:59 UTC 2015


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 at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list