Change in vdsm[master]: vdsm: introduce hostdev module

danken at redhat.com danken at redhat.com
Tue Sep 2 17:55:20 UTC 2014


Dan Kenigsberg has posted comments on this change.

Change subject: vdsm: introduce hostdev module
......................................................................


Patch Set 4: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/32313/4/vdsm/hostdev.py
File vdsm/hostdev.py:

Line 91:                               'product_id': '', 'iommu_group': ''},
Line 92:                    'vmId': vmId]}
Line 93:     """
Line 94:     # device configuration may have changed: repopulate the map
Line 95:     devices = getDevicesFromLibvirt(vmContainer)
It would be simpler to iterate over VMs and build one devname->vmId mapping.

Then, call listAllDevices(), convert their xml to our dict output, filter out devices with non-matching caps, and add vmId "assignment".

Also, please add unit test per functions, so it's easier to understand expected input/output.
Line 96: 
Line 97:     for device_name, assignment in devices.items():
Line 98:         devices[device_name] = {
Line 99:             'params': parseDeviceParams(assignment[0].XMLDesc()),


-- 
To view, visit http://gerrit.ovirt.org/32313
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2bba96db5be180d00cb74fb89b10c5b09e5bd180
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list