Francesco Romani has posted comments on this change.

Change subject: hostdev: add support for usb devices
......................................................................


Patch Set 4:

(3 comments)

one minor stylistic issue, which is not very important; two questions inside. 
-1 for visibility only.

https://gerrit.ovirt.org/#/c/39715/4/vdsm/hostdev.py
File vdsm/hostdev.py:

Line 34: 
Line 35: 
Line 36: def address_to_name(device_type, address):
Line 37:     return {'pci': pci_address_to_name,
Line 38:             'usb': usb_address_to_name}[device_type](**address)
very dense. Plase consider to sparsify it a bit:

  def address_to_name(device_type, address):
    translators = {
      'pci': pci_address_to_name,
      'usb': usb_address_to_name
    }
    to_name = translators[device_type]
    return to_name(**address)
Line 39: 
Line 40: 
Line 41: def pci_address_to_name(domain, bus, slot, function):
Line 42:     """


https://gerrit.ovirt.org/#/c/39715/4/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 3808:             # both addresses and determine the correct one.
Line 3809:             if hostdev.address_to_name(device_type, address) == 
device:
Line 3810:                 try:
Line 3811:                     address = self._getUnderlyingDeviceAddress(x, 1)
Line 3812:                 except IndexError:
why this didn't raise before?
Line 3813:                     address = None
Line 3814: 
Line 3815:             known_device = False
Line 3816:             for dev in self.conf['devices']:


https://gerrit.ovirt.org/#/c/39715/4/vdsm/virt/vmdevices/hostdevice.py
File vdsm/virt/vmdevices/hostdevice.py:

Line 61
Line 62
Line 63
Line 64
Line 65
why is this if gone?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibf9b4f302353f3006e1f945dd342d351039ba387
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: Ido Barkan <[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

Reply via email to