Change in vdsm[master]: vdsm: introduce hostdev module
Dan Kenigsberg has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 15: Code-Review+2 -- 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: 15 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: Piotr Kliczewski piotr.kliczew...@gmail.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Dan Kenigsberg has submitted this change and it was merged. Change subject: vdsm: introduce hostdev module .. vdsm: introduce hostdev module Hostdev module serves the purpose of encapsulating functions related to reporting, acquiring and releasing host devices (nodeDevices in libvirt terms) Change-Id: I2bba96db5be180d00cb74fb89b10c5b09e5bd180 Signed-off-by: Martin Polednik mpoled...@redhat.com Reviewed-on: http://gerrit.ovirt.org/32313 Reviewed-by: Piotr Kliczewski piotr.kliczew...@gmail.com Reviewed-by: Dan Kenigsberg dan...@redhat.com --- M debian/vdsm.install M tests/Makefile.am A tests/hostdevTests.py M tests/vmfakelib.py M vdsm.spec.in M vdsm/API.py M vdsm/Makefile.am A vdsm/hostdev.py M vdsm/rpc/BindingXMLRPC.py M vdsm/rpc/Bridge.py M vdsm/rpc/vdsmapi-schema.json 11 files changed, 631 insertions(+), 0 deletions(-) Approvals: Piotr Kliczewski: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved Martin Polednik: Verified -- To view, visit http://gerrit.ovirt.org/32313 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2bba96db5be180d00cb74fb89b10c5b09e5bd180 Gerrit-PatchSet: 16 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: Piotr Kliczewski piotr.kliczew...@gmail.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 16: Build Successful http://jenkins.ovirt.org/job/vdsm_master_unit-tests_merged/4075/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_create-rpms-fc21-x86_64_merged/61/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_create-rpms-el6-x86_64_merged/88/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_create-rpms_merged_test_debug/283/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_verify-error-codes_merged/5915/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_create-rpms-el7-x86_64_merged/85/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_create-rpms-fc20-x86_64_merged/81/ : SUCCESS -- 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: 16 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: Piotr Kliczewski piotr.kliczew...@gmail.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Martin Polednik has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 15: Verified+1 Verified by - running ./run_tests_local hostdevTests.py - make check - in combination with http://gerrit.ovirt.org/#/c/32316/ (manually on the host) Haven't verified jsonrpc due to lack of tools -- 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: 15 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: Piotr Kliczewski piotr.kliczew...@gmail.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Martin Polednik has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 14: Verified+1 -- 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: 14 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 15: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12806/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11858/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/449/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/432/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12649/ : SUCCESS -- 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: 15 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: Piotr Kliczewski piotr.kliczew...@gmail.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Francesco Romani has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 13: Code-Review-1 (7 comments) quite good, almost there. A few minor notes inside, nothing big. -1 for visibility Do Bridge.py needs to be updated - read: does this work with json-rpc? Not sure, just asking. http://gerrit.ovirt.org/#/c/32313/13/tests/hostdevTests.py File tests/hostdevTests.py: Line 138: u'usb_1_1': Line 139: {'params': DEVICES_PARSED['usb_1_1']}}} Line 140: Line 141: Line 142: class ConfStub(object): in a later patch: let's move them in a common module (vmfakelib?) Line 143: Line 144: def __init__(self, conf): Line 145: self.conf = conf Line 146: Line 148: VirNodeDeviceStub in a later patch: let's move them in a common module (vmfakelib?) Line 443: def testListByCaps(self, caps): Line 444: devices = hostdev.list_by_caps(ConnectionStub.VMCONTAINER, caps) Line 445: Line 446: for cap in caps: Line 447: print DEVICES_BY_CAPS[cap].keys() please no prints... Line 448: print devices.keys() Line 449: self.assertTrue(set(DEVICES_BY_CAPS[cap].keys()). http://gerrit.ovirt.org/#/c/32313/13/vdsm/rpc/vdsmapi-schema.json File vdsm/rpc/vdsmapi-schema.json: Line 3740: # @vendor_id: Hexadecimal representation of the vendor Line 3741: # Line 3742: # @vendor: String representation of the vendor Line 3743: # Line 3744: # Since: 4.16.0 4.17.0? Line 3745: ## Line 3746: {'type': 'HostDeviceParams', Line 3747: 'data': {'capability': 'str', 'iommu_group': 'uint', Line 3748: 'parent': 'str', 'product_id': 'str', 'product': 'str', Line 3756: # @vmId:The VM UUID Line 3757: # Line 3758: # @params: Properties of the device Line 3759: # Line 3760: # Since: 4.16.0 ditto Line 3761: ## Line 3762: {'type': 'HostDevice', Line 3763: 'data': {'vmId': 'UUID', 'params': 'HostDeviceParams'}} Line 3764: Line 3768: # Mapping of devices to their assignments Line 3769: # Line 3770: # @deviceName: Name of the device Line 3771: # Line 3772: # Since: 4.16.0 ditto Line 3773: ## Line 3774: {'type': 'HostDevices', Line 3775: 'data': {'deviceName': 'HostDevice'}} Line 3776: Line 3784: # Returns: Line 3785: # A list of devices on the host Line 3786: # Line 3787: # Since: 4.16.0 Line 3788: ## ditto Line 3789: {'command': {'class': 'Host', 'name': 'hostdevListByCaps'}, Line 3790: 'data': {'caps': ['str']}, Line 3791: 'returns': ['HostDevices']} Line 3792: -- 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: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 14: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12792/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11844/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/447/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/430/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12635/ : SUCCESS -- 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: 14 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Francesco Romani has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 14: Code-Review+1 seems ok assuming Bridge.py does not needs intervention. -- 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: 14 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: Vitor de Lima vdel...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 13: Build Failed http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/417/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/434/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11778/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12724/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12567/ : SUCCESS -- 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: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Martin Polednik has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 13: Verified+1 removed deprecated logic in tests -- 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: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 11: Build Failed http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/404/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/421/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11731/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12675/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12520/ : SUCCESS -- 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: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 12: Build Failed http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/405/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/422/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11732/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12676/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12521/ : SUCCESS -- 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: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Dan Kenigsberg has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 10: (1 comment) http://gerrit.ovirt.org/#/c/32313/10/vdsm/hostdev.py File vdsm/hostdev.py: Line 106: for name, params in libvirt_devices.items(): Line 107: if caps and params['capability'] not in caps: Line 108: continue Line 109: Line 110: devices[name] = {'params': params} if name in device_to_vm: devices[name]['vmId'] = device_to_vm[name] Line 111: try: Line 112: devices[name]['vmId'] = device_to_vm[name] Line 113: except KeyError: Line 114: pass -- 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: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Dan Kenigsberg has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 12: Code-Review+2 -- 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: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Martin Polednik has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 12: Verified+1 verified by * running ./run_tests_local hostdevTests.py * make check * in combination with http://gerrit.ovirt.org/#/c/32316/ (manually on the host) - works as expected -- 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: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Martin Polednik has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 10: Verified+1 -- 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: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 9: Build Failed http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/387/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/404/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11665/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12609/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12454/ : SUCCESS -- 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: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 10: Build Failed http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/388/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/405/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11666/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12610/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12455/ : SUCCESS -- 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: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Dan Kenigsberg has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 10: Code-Review-1 (2 comments) http://gerrit.ovirt.org/#/c/32313/10/vdsm/hostdev.py File vdsm/hostdev.py: Line 70: Line 71: for device in VM.conf['devices']: Line 72: if device['device'] == 'hostdev': Line 73: try: Line 74: devices[device['name']] = vmId PS8 was clearer in my opinion. Line 75: except KeyError: Line 76: raise logging.warn('Vm %s has hostdev without mandatory ' Line 77:'name attribute!', vmId) Line 78: Line 72: if device['device'] == 'hostdev': Line 73: try: Line 74: devices[device['name']] = vmId Line 75: except KeyError: Line 76: raise logging.warn('Vm %s has hostdev without mandatory ' warn() return None, and this is what you raise here - I suppose it's a typo? Line 77:'name attribute!', vmId) Line 78: Line 79: return devices Line 80: -- 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: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Dan Kenigsberg has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 10: (1 comment) http://gerrit.ovirt.org/#/c/32313/10/vdsm/hostdev.py File vdsm/hostdev.py: Line 70: Line 71: for device in VM.conf['devices']: Line 72: if device['device'] == 'hostdev': Line 73: try: Line 74: devices[device['name']] = vmId PS8 was clearer in my opinion. More importantly - is there any possibility to have a hostdev with no name? If so, our code does not support it (we do not report its assignment properly). If nameless hostdevs are impossible, finding one is not a warning, it is an error (which I'd rather not swallow). Line 75: except KeyError: Line 76: raise logging.warn('Vm %s has hostdev without mandatory ' Line 77:'name attribute!', vmId) Line 78: -- 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: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Martin Polednik has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 10: (1 comment) http://gerrit.ovirt.org/#/c/32313/10/vdsm/hostdev.py File vdsm/hostdev.py: Line 72: if device['device'] == 'hostdev': Line 73: try: Line 74: devices[device['name']] = vmId Line 75: except KeyError: Line 76: raise logging.warn('Vm %s has hostdev without mandatory ' warn() return None, and this is what you raise here - I suppose it's a typo Yep, typo detected. To the code above: nameless hostdevs are impossible (as the name is used to obtain virNodeDevice object), error sounds fine. Line 77:'name attribute!', vmId) Line 78: Line 79: return devices Line 80: -- 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: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 8: Build Failed http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/355/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/372/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11555/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12499/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12344/ : SUCCESS -- 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: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Dan Kenigsberg has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 8: Code-Review-1 (2 comments) http://gerrit.ovirt.org/#/c/32313/8/vdsm/hostdev.py File vdsm/hostdev.py: Line 69: continue Line 70: Line 71: for device in VM.conf['devices']: Line 72: try: Line 73: name = device['name'] How can we have a device without a 'name'? Is it common? Why do we swallow this silently? It's fine to answer these questions in a comment just above continue. Line 74: except KeyError: Line 75: continue Line 76: Line 77: if device['device'] == 'hostdev': Line 77: if device['device'] == 'hostdev': Line 78: try: Line 79: devices[name] = vmId Line 80: except KeyError: Line 81: # VM has device which is no (longer) present Only now do I notice the problem here: the current code cannot raise KeyError ever, as it is an assignment, not a lookup. The error handling here is useless. Line 82: # on the host - althought this should be handled by Line 83: # user, warning can help debugging libvirt errors Line 84: logging.warning('VM %s has device %s which is not ' Line 85: 'available!', vmId, device['name']) -- 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: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Martin Polednik has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 8: (2 comments) http://gerrit.ovirt.org/#/c/32313/8/vdsm/hostdev.py File vdsm/hostdev.py: Line 69: continue Line 70: Line 71: for device in VM.conf['devices']: Line 72: try: Line 73: name = device['name'] How can we have a device without a 'name'? Is it common? Why do we swallow Some devices might not have this attribute, rng device and smartcard being an example. The warning logged below needs a bit more thinking, it should be simple continue afaik (simply ignoring unnamed devices as these are irrelevant) -- this is leftover from old code Line 74: except KeyError: Line 75: continue Line 76: Line 77: if device['device'] == 'hostdev': Line 77: if device['device'] == 'hostdev': Line 78: try: Line 79: devices[name] = vmId Line 80: except KeyError: Line 81: # VM has device which is no (longer) present Only now do I notice the problem here: the current code cannot raise KeyErr Well the way before seemed perfect :) Line 82: # on the host - althought this should be handled by Line 83: # user, warning can help debugging libvirt errors Line 84: logging.warning('VM %s has device %s which is not ' Line 85: 'available!', vmId, device['name']) -- 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: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Dan Kenigsberg has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 7: (2 comments) http://gerrit.ovirt.org/#/c/32313/7/vdsm/hostdev.py File vdsm/hostdev.py: Line 64: if device['device'] == 'hostdev': Line 65: try: Line 66: devices[device['name']] = vmId Line 67: except KeyError: Line 68: # VM has device which is no (longer) present We have two dictionary lookup inside the try-block. It's safer two have only one. Line 69: # on the host - althought this should be handled by Line 70: # user, warning can help debugging libvirt errors Line 71: logging.warning('VM %s has device %s which is not ' Line 72: 'available!', vmId, device['name']) Line 84: for device in libvirtconnection.get().listAllDevices(0)) Line 85: Line 86: Line 87: def list_by_caps(vmContainer, caps=None): Line 88: please explain what is the expected value of caps. Line 89: Returns devices that have specified capability in format Line 90: {device_name: {'params': {'capability': '', 'vendor': '', Line 91: 'vendor_id': '', 'product': '', Line 92: 'product_id': '', 'iommu_group': ''}, -- 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: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 7: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11374/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/318/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12318/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12163/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/334/ : FAILURE -- 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: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Dan Kenigsberg has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 6: (9 comments) please add a unit test for each new function. http://gerrit.ovirt.org/#/c/32313/6/vdsm/hostdev.py File vdsm/hostdev.py: Line 53: def _get_devices_from_vms(vmContainer): Line 54: devices = {} Line 55: Line 56: # loop through VMs and find their host devices Line 57: for vmId, params in vmContainer.items(): vmContainer is a mapping of vmId - Vm object. not params. Line 58: try: Line 59: for device in params.conf['devices']: Line 60: if device['device'] == 'hostdev': Line 61: try: Line 59: for device in params.conf['devices']: Line 60: if device['device'] == 'hostdev': Line 61: try: Line 62: devices[device['name']] = vmId Line 63: except KeyError: We have two dictionary lookup inside the try-block. It's safer two have only one. Line 64: # VM has device which is no (longer) present Line 65: # on the host - althought this should be handled by Line 66: # user, warning can help debugging libvirt errors Line 67: logging.warning('VM %s has device %s which is not ' Line 67: logging.warning('VM %s has device %s which is not ' Line 68: 'available!', vmId, device['name']) Line 69: # BC: ignore old VM's without conf['devices'] section, no handling Line 70: # needed as hostdev was not supported Line 71: except KeyError: KeyError can be raised by all sort of funny mistakes in the try-block. When you would like to catch a specific error, make sure that you catch it *alone*. In this case, if 'devices' not in params.conf: continue would do. Line 72: pass Line 73: Line 74: return devices Line 75: Line 73: Line 74: return devices Line 75: Line 76: Line 77: def _get_devices_from_libvirt(vmContainer): no need for the arg Line 78: Line 79: Method that scans all VMs in supported vmContainer, locates node Line 80: devices and pairs them with VM in internal mapping, removing VMs or Line 81: devices that no longer exist Line 84: host_devices = [(dev.name(), dev) for dev Line 85: in libvirtconnection.get().listAllDevices(0)] Line 86: Line 87: for (device_name, device) in host_devices: Line 88: devices[device_name] = _parse_device_params(device.XMLDesc()) device_name is used only once. The code would be much simpler if you evaluate it right here. I suspect that all you need is return dict(device.name(), _parse_device_params(device.XMLDesc()) for device in libvirtconnection.get().listAllDevices(0)) Line 89: Line 90: return devices Line 91: Line 92: Line 103: libvirt_devices = _get_devices_from_libvirt(vmContainer) Line 104: device_to_vm = _get_devices_from_vms(vmContainer) Line 105: Line 106: for name, params in libvirt_devices.items(): Line 107: devices[name] = {'params': params, 'vmId': ''} if the device is not owned by any vm, a nicer API is to leave vmId out of the dictionary. Line 108: try: Line 109: devices[name]['vmId'] = device_to_vm[name] Line 110: except KeyError: Line 111: pass Line 108: try: Line 109: devices[name]['vmId'] = device_to_vm[name] Line 110: except KeyError: Line 111: pass Line 112: logging.info('DBG: %s', devices) debug time leftover? Line 113: Line 114: for device_name, assignment in devices.items(): Line 115: if caps and assignment['params']['capability'] not in caps: Line 116: del(devices[device_name]) Line 110: except KeyError: Line 111: pass Line 112: logging.info('DBG: %s', devices) Line 113: Line 114: for device_name, assignment in devices.items(): assignment is still a bad name. it's a dictionary that has both params and owning vmId. Line 115: if caps and assignment['params']['capability'] not in caps: Line 116: del(devices[device_name]) Line 117: Line 112: logging.info('DBG: %s', devices) Line 113: Line 114: for device_name, assignment in devices.items(): Line 115: if caps and assignment['params']['capability'] not in caps: Line 116: del(devices[device_name]) It's wasteful to add the devince_name to the dictionary, and now delete it. If it does not have the right caps - do not add it. Line 117: -- 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: 6 Gerrit-Project:
Change in vdsm[master]: vdsm: introduce hostdev module
Dan Kenigsberg has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 6: Code-Review-1 -- 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: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Martin Polednik has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 5: tests are kept in http://gerrit.ovirt.org/#/c/31766/ in order to keep the patch relatively small -- 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: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 5: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11277/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/305/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12219/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc19_created/339/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12066/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/320/ : SUCCESS -- 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: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 6: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11282/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/306/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12224/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc19_created/340/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12071/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/321/ : SUCCESS -- 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: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Martin Polednik has uploaded a new change for review. Change subject: vdsm: introduce hostdev module .. vdsm: introduce hostdev module Hostdev module serves the purpose of encapsulating functions related to reporting, acquiring and releasing host devices (nodeDevices in libvirt terms) Change-Id: I2bba96db5be180d00cb74fb89b10c5b09e5bd180 Signed-off-by: Martin Polednik mpoled...@redhat.com --- M debian/vdsm.install M vdsm.spec.in M vdsm/API.py M vdsm/Makefile.am A vdsm/hostdev.py M vdsm/rpc/vdsmapi-schema.json 6 files changed, 185 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/32313/1 diff --git a/debian/vdsm.install b/debian/vdsm.install index b1840ec..b913b3d 100644 --- a/debian/vdsm.install +++ b/debian/vdsm.install @@ -52,6 +52,7 @@ ./usr/share/vdsm/gluster/hostname.py ./usr/share/vdsm/hooking.py ./usr/share/vdsm/hooks.py +./usr/share/vdsm/hostdev.py ./usr/share/vdsm/kaxmlrpclib.py ./usr/share/vdsm/ksm.py ./usr/share/vdsm/logUtils.py diff --git a/vdsm.spec.in b/vdsm.spec.in index 323b586..2d09962 100644 --- a/vdsm.spec.in +++ b/vdsm.spec.in @@ -940,6 +940,7 @@ %{_datadir}/%{vdsm_name}/API.py* %{_datadir}/%{vdsm_name}/hooking.py* %{_datadir}/%{vdsm_name}/hooks.py* +%{_datadir}/%{vdsm_name}/hostdev.py* %{_datadir}/%{vdsm_name}/mk_sysprep_floppy %{_datadir}/%{vdsm_name}/parted_utils.py* %{_datadir}/%{vdsm_name}/mkimage.py* diff --git a/vdsm/API.py b/vdsm/API.py index 585923e..14f9fbc 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -52,6 +52,7 @@ from vdsm.config import config import ksm import hooks +import hostdev from caps import PAGE_SIZE_BYTES import supervdsm @@ -1287,6 +1288,10 @@ statsList = hooks.after_get_all_vm_stats(statsList) return {'status': doneCode, 'statsList': statsList} +def hostdevListByCaps(self, caps): +devices = hostdev.listByCaps(self._cif.vmContainer) +return {'status': doneCode, 'deviceList': devices} + def getStats(self): Report host statistics. diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am index 2afdd00..64653f1 100644 --- a/vdsm/Makefile.am +++ b/vdsm/Makefile.am @@ -32,6 +32,7 @@ dmidecodeUtil.py \ hooking.py \ hooks.py \ + hostdev.py \ kaxmlrpclib.py \ ksm.py \ logUtils.py \ diff --git a/vdsm/hostdev.py b/vdsm/hostdev.py new file mode 100644 index 000..cd3501e --- /dev/null +++ b/vdsm/hostdev.py @@ -0,0 +1,106 @@ +# +# Copyright 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +import logging +import xml.etree.ElementTree as etree + +from vdsm import libvirtconnection + + +def parseDeviceParams(device_xml): +params = {} + +devXML = etree.fromstring(device_xml) +name = devXML.find('name').text +if name != 'computer': +params['parent'] = devXML.find('parent').text + +caps = devXML.find('capability') +params['capability'] = caps.attrib['type'] + +for element in ('vendor', 'product'): +elementXML = caps.find(element) +if elementXML is not None: +if 'id' in elementXML.attrib: +params[element + '_id'] = elementXML.attrib['id'] +params[element] = elementXML.text + +iommu_group = caps.find('iommuGroup') +if iommu_group: +params['iommu_group'] = iommu_group.attrib['number'] + +return params + + +def getDevicesFromLibvirt(vmContainer): + +Method that scans all VMs in supported vmContainer, locates node +devices and pairs them with VM in internal mapping, removing VMs or +devices that no longer exist + +devices = {} +hostDevices = [(dev.name(), dev) for dev + in libvirtconnection.listAllDevices(0)] + +for (device_name, device) in hostDevices: +devices[device_name] = [device, ''] + +# loop through VMs and find their host devices +for vmId, params in vmContainer.items(): +try: +for device in params.conf['devices']: +if device['device'] == 'hostdev': +try: +devices[device['name']][1] = vmId +except
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 1: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11261/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/296/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12203/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc19_created/330/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12050/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/311/ : SUCCESS -- 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: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 2: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11262/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/297/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12204/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc19_created/331/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12051/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/312/ : SUCCESS -- 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: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 3: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11263/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc20_created/298/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12205/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-fc19_created/332/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12052/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_install-rpm-sanity-el6_created/313/ : SUCCESS -- 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: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
Francesco Romani has posted comments on this change. Change subject: vdsm: introduce hostdev module .. Patch Set 4: (4 comments) http://gerrit.ovirt.org/#/c/32313/4/vdsm/hostdev.py File vdsm/hostdev.py: Line 1: # Line 2: # Copyright 2014 Red Hat, Inc. since this is new code, we want to be (finally!) pep8 friendly: http://webcache.googleusercontent.com/search?q=cache:N35llBwzhFcJ:https://www.ovirt.org/Vdsm_Coding_Guidelines+cd=1hl=itct=clnkgl=it (linking google cache only because ovirt wiki seems down at the moment :( ) Line 3: # Line 4: # This program is free software; you can redistribute it and/or modify Line 5: # it under the terms of the GNU General Public License as published by Line 6: # the Free Software Foundation; either version 2 of the License, or Line 18: # Refer to the README and COPYING files for full details of the license Line 19: # Line 20: Line 21: import logging Line 22: import xml.etree.ElementTree as etree Good move. I'm all to use etree for new code. Line 23: Line 24: from vdsm import libvirtconnection Line 25: Line 26: Line 59: hostDevices = [(dev.name(), dev) for dev Line 60:in libvirtconnection.get().listAllDevices(0)] Line 61: Line 62: for (device_name, device) in hostDevices: Line 63: devices[device_name] = [device, ''] a namedtuple would probably help readability here (also looking at line 71) Line 64: Line 65: # loop through VMs and find their host devices Line 66: for vmId, params in vmContainer.items(): Line 67: try: Line 62: for (device_name, device) in hostDevices: Line 63: devices[device_name] = [device, ''] Line 64: Line 65: # loop through VMs and find their host devices Line 66: for vmId, params in vmContainer.items(): do we need vmContainerLock here? Line 67: try: Line 68: for device in params.conf['devices']: Line 69: if device['device'] == 'hostdev': Line 70: try: -- 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 mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: introduce hostdev module
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 mpoled...@redhat.com Gerrit-Reviewer: Dan Kenigsberg dan...@redhat.com Gerrit-Reviewer: Francesco Romani from...@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skriva...@redhat.com Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches