Change in vdsm[master]: virt: dev: move getUnderlyingDeviceAddress away
automat...@ovirt.org has posted comments on this change. Change subject: virt: dev: move getUnderlyingDeviceAddress away .. Patch Set 2: * Update tracker::IGNORE, no Bug-Url found -- To view, visit https://gerrit.ovirt.org/33749 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e70968020877d36b555468971d327d8d569d352 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani 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]: virt: dev: move getUnderlyingDeviceAddress away
oVirt Jenkins CI Server has posted comments on this change. Change subject: virt: dev: move getUnderlyingDeviceAddress away .. Patch Set 2: Build Successful http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/16839/ : SUCCESS -- To view, visit https://gerrit.ovirt.org/33749 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e70968020877d36b555468971d327d8d569d352 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani 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]: virt: dev: move getUnderlyingDeviceAddress away
Francesco Romani has uploaded a new change for review. Change subject: virt: dev: move getUnderlyingDeviceAddress away .. virt: dev: move getUnderlyingDeviceAddress away make VmDevice._getUnderlyingDeviceAddress() a function -it never used 'self' anyway- and move it into vmxml.py. This patch is another step towards the isolation of vm.py from any xml processing. Change-Id: I7e70968020877d36b555468971d327d8d569d352 Signed-off-by: Francesco Romani --- M vdsm/virt/vm.py M vdsm/virt/vmxml.py 2 files changed, 26 insertions(+), 25 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/33749/2 diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 70329c6..4e1c790 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -4532,22 +4532,6 @@ self.log.exception("Operation failed") return self._reportError(key, msg) -def _getUnderlyingDeviceAddress(self, devXml): -""" -Obtain device's address from libvirt -""" -address = {} -adrXml = devXml.getElementsByTagName('address')[0] -# Parse address to create proper dictionary. -# Libvirt device's address definition is: -# PCI = {'type':'pci', 'domain':'0x', 'bus':'0x00', -#'slot':'0x0c', 'function':'0x0'} -# IDE = {'type':'drive', 'controller':'0', 'bus':'0', 'unit':'0'} -for key in adrXml.attributes.keys(): -address[key.strip()] = adrXml.getAttribute(key).strip() - -return address - def _getUnderlyingUnknownDeviceInfo(self): """ Obtain unknown devices info from libvirt. @@ -4569,7 +4553,7 @@ alias = x.getElementsByTagName('alias')[0].getAttribute('name') if not isKnownDevice(alias): -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) # I general case we assume that device has attribute 'type', # if it hasn't getAttribute returns ''. device = x.getAttribute('type') @@ -4594,7 +4578,7 @@ index = x.getAttribute('index') # Get controller address -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) # In case the controller has index and/or model, they # are compared. Currently relevant for USB controllers. @@ -4633,7 +4617,7 @@ if not x.getElementsByTagName('address'): address = None else: -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) alias = x.getElementsByTagName('alias')[0].getAttribute('name') for dev in self._devices[hwclass.BALLOON]: @@ -4673,7 +4657,7 @@ if not x.getElementsByTagName('address'): continue -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) alias = x.getElementsByTagName('alias')[0].getAttribute('name') for dev in self._devices[hwclass.SMARTCARD]: @@ -4695,7 +4679,7 @@ # PCI watchdog has "address" different from ISA watchdog if x.getElementsByTagName('address'): -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) alias = x.getElementsByTagName('alias')[0].getAttribute('name') for wd in self._devices[hwclass.WATCHDOG]: @@ -4716,7 +4700,7 @@ for x in self._domain.get_device_elements('video'): alias = x.getElementsByTagName('alias')[0].getAttribute('name') # Get video card address -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) # FIXME. We have an identification problem here. # Video card device has not unique identifier, except the alias @@ -4742,7 +4726,7 @@ for x in self._domain.get_device_elements('sound'): alias = x.getElementsByTagName('alias')[0].getAttribute('name') # Get sound card address -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) # FIXME. We have an identification problem here. # Sound device has not unique identifier, except the alias @@ -4794,7 +4778,7 @@ else: drv = 'raw' # Get disk address -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) # Keep data as dict for easier debugging deviceDict = {'path': devPath, 'name': name, @@ -4931,7 +4915,7 @@ network = network[len(netinfo.LIBVIRT_NET_PREFIX):] # Get nic address -address = self._getUnderlyingDeviceAddress(x) +
Change in vdsm[master]: virt: dev: move getUnderlyingDeviceAddress away
Francesco Romani has abandoned this change. Change subject: virt: dev: move getUnderlyingDeviceAddress away .. Abandoned obsoleted by 38714 -- To view, visit https://gerrit.ovirt.org/33749 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I7e70968020877d36b555468971d327d8d569d352 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani 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]: virt: dev: move getUnderlyingDeviceAddress away
oVirt Jenkins CI Server has posted comments on this change. Change subject: virt: dev: move getUnderlyingDeviceAddress away .. Patch Set 2: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/13582/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/14539/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/14371/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/2086/ : There was an infra issue, please contact in...@ovirt.org -- To view, visit http://gerrit.ovirt.org/33749 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e70968020877d36b555468971d327d8d569d352 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani 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]: virt: dev: move getUnderlyingDeviceAddress away
oVirt Jenkins CI Server has posted comments on this change. Change subject: virt: dev: move getUnderlyingDeviceAddress away .. Patch Set 1: Build Failed http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/11796/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/12742/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1715/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/12585/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/33749 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e70968020877d36b555468971d327d8d569d352 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani 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]: virt: dev: move getUnderlyingDeviceAddress away
Francesco Romani has uploaded a new change for review. Change subject: virt: dev: move getUnderlyingDeviceAddress away .. virt: dev: move getUnderlyingDeviceAddress away make VmDevice._getUnderlyingDeviceAddress() a function -it never used 'self' anyway- and move it into vmxml.py. This patch is another step towards the isolation of vm.py from any xml processing. Change-Id: I7e70968020877d36b555468971d327d8d569d352 Signed-off-by: Francesco Romani --- M vdsm/virt/vm.py M vdsm/virt/vmxml.py 2 files changed, 26 insertions(+), 25 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/33749/1 diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 7f21085..5b710a8 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -4681,22 +4681,6 @@ self.log.exception("Operation failed") return self._reportError(key, msg) -def _getUnderlyingDeviceAddress(self, devXml): -""" -Obtain device's address from libvirt -""" -address = {} -adrXml = devXml.getElementsByTagName('address')[0] -# Parse address to create proper dictionary. -# Libvirt device's address definition is: -# PCI = {'type':'pci', 'domain':'0x', 'bus':'0x00', -#'slot':'0x0c', 'function':'0x0'} -# IDE = {'type':'drive', 'controller':'0', 'bus':'0', 'unit':'0'} -for key in adrXml.attributes.keys(): -address[key.strip()] = adrXml.getAttribute(key).strip() - -return address - def _getUnderlyingUnknownDeviceInfo(self): """ Obtain unknown devices info from libvirt. @@ -4721,7 +4705,7 @@ alias = x.getElementsByTagName('alias')[0].getAttribute('name') if not isKnownDevice(alias): -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) # I general case we assume that device has attribute 'type', # if it hasn't getAttribute returns ''. device = x.getAttribute('type') @@ -4749,7 +4733,7 @@ index = x.getAttribute('index') # Get controller address -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) # In case the controller has index and/or model, they # are compared. Currently relevant for USB controllers. @@ -4790,7 +4774,7 @@ if not x.getElementsByTagName('address'): address = None else: -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) alias = x.getElementsByTagName('alias')[0].getAttribute('name') for dev in self._devices[BALLOON_DEVICES]: @@ -4836,7 +4820,7 @@ if not x.getElementsByTagName('address'): continue -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) alias = x.getElementsByTagName('alias')[0].getAttribute('name') for dev in self._devices[SMARTCARD_DEVICES]: @@ -4861,7 +4845,7 @@ # PCI watchdog has "address" different from ISA watchdog if x.getElementsByTagName('address'): -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) alias = x.getElementsByTagName('alias')[0].getAttribute('name') for wd in self._devices[WATCHDOG_DEVICES]: @@ -4884,7 +4868,7 @@ for x in videosxml: alias = x.getElementsByTagName('alias')[0].getAttribute('name') # Get video card address -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) # FIXME. We have an identification problem here. # Video card device has not unique identifier, except the alias @@ -4912,7 +4896,7 @@ for x in soundsxml: alias = x.getElementsByTagName('alias')[0].getAttribute('name') # Get sound card address -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) # FIXME. We have an identification problem here. # Sound device has not unique identifier, except the alias @@ -4966,7 +4950,7 @@ else: drv = 'raw' # Get disk address -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) # Keep data as dict for easier debugging deviceDict = {'path': devPath, 'name': name, @@ -5109,7 +5093,7 @@ network = network[len(netinfo.LIBVIRT_NET_PREFIX):] # Get nic address -address = self._getUnderlyingDeviceAddress(x) +address = vmxml.device_address(x) for n