Mark Wu has uploaded a new change for review.
Change subject: Fix duplicate emulated machines returned ......................................................................
Fix duplicate emulated machines returned
The old code use getElementsByTagName('machine') to collect machines information, which will hit the default info for that arch and the kvm domain's. This patch changes to collect machines information from the node of kvm domain.
Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Signed-off-by: Mark Wu wudxw@linux.vnet.ibm.com --- M vdsm/caps.py 1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/8208/1
diff --git a/vdsm/caps.py b/vdsm/caps.py index 98b33ab..c00c957 100644 --- a/vdsm/caps.py +++ b/vdsm/caps.py @@ -98,15 +98,15 @@ def _getEmulatedMachines(): c = libvirtconnection.get() caps = minidom.parseString(c.getCapabilities()) - guestTag = caps.getElementsByTagName('guest') - # Guest element is missing if kvm modules are not loaded - if len(guestTag) == 0: + for domainNode in caps.getElementsByTagName('domain'): + if domainNode.getAttribute('type') == 'kvm': + break + else: + # KVM domain is missing if kvm modules are not loaded return []
- guestTag = guestTag[0] - return [m.firstChild.toxml() - for m in guestTag.getElementsByTagName('machine')] + for m in domainNode.getElementsByTagName('machine')]
def _getAllCpuModels():
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com
Mark Wu has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 1: Verified
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com
Mark Wu has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 1:
Without this patch, I got: emulatedMachines = ['pc-0.15', 'pc-1.0', 'pc', 'pc-0.14', 'pc-0.13', 'pc-0.12', 'pc-0.11', 'pc-0.10', 'isapc', 'pc-0.15', 'pc-1.0', 'pc', 'pc-0.14', 'pc-0.13', 'pc-0.12', 'pc-0.11', 'pc-0.10', 'isapc']
With this patch: emulatedMachines = ['pc-0.15', 'pc-1.0', 'pc', 'pc-0.14', 'pc-0.13', 'pc-0.12', 'pc-0.11', 'pc-0.10', 'isapc']
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com
Ryan Harper has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 1: I would prefer that you didn't submit this
While I like removing duplicate information, it's not clear to me what vdsm cares about here.
if you run virsh capabilities (which is what the call is doing), you'll see that for each *emulator* type it is enumerating the machine types the emulator supports.
Some systems may have more than just qemu-kvm emulator.
If vdsm wanted to support multiple emulators, I think it would make sense to enumerate the machine types *per emulator*.
If we only care about qemu-kvm (and I think we do) then I think the patch is good enough. If we want to be more explicit, then the emulatedMachines field ought to be a list of dictionaries, one for each emulator and the machine types each emulator supports.
Thoughts?
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com
Mark Wu has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 1:
I think for vdsm, we just care about qemu-kvm.
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/152/ (1/2)
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/118/ (2/2)
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/118/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/152/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/154/ (1/2)
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/120/ (2/2)
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/120/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/154/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Douglas Schilling Landgraf has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 3: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Hunt Xu has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 3: I would prefer that you didn't submit this
(2 inline comments)
.................................................... File tests/capsTests.py Line 63: Line 64: def testEmulatedMachines(self): Line 65: testPath = os.path.realpath(__file__) Line 66: dirName = os.path.split(testPath)[0] Line 67: path = os.path.join(dirName, "caps_libvirt.out") You might also want to update caps_libvirt.out with duplicate returned emulated machines to see whether this patch works well Line 68: machines = caps._getEmulatedMachines(file(path).read()) Line 69: expectedMachines = ['rhel6.3.0', 'pc', 'rhel6.2.0', 'rhel6.1.0', Line 70: 'rhel6.0.0', 'rhel5.5.0', 'rhel5.4.4', 'rhel5.4.0'] Line 71: self.assertEqual(machines, expectedMachines)
.................................................... File vdsm/caps.py Line 130: if capabilities is None: Line 131: capabilities = _getCapsXMLStr() Line 132: caps = ET.fromstring(capabilities) Line 133: return [m.text for m in Line 134: caps.findall("guest/arch[@name='x86_64']/machine")] I don't like the idea to import another module for this issue. If we only want to avoid duplicate items in the LIST, a simple list(set(LIST)) would be sufficient. In the old function, i.e., return list(set([m.firstChild.toxml() for m in guestTag.getElementsByTagName('machine')])) Line 135: Line 136: Line 137: def _getAllCpuModels(): Line 138: cpu_map = minidom.parseString(
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Mark Wu has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 3: (2 inline comments)
.................................................... File tests/capsTests.py Line 63: Line 64: def testEmulatedMachines(self): Line 65: testPath = os.path.realpath(__file__) Line 66: dirName = os.path.split(testPath)[0] Line 67: path = os.path.join(dirName, "caps_libvirt.out") Ok, I will update it in next patch. Line 68: machines = caps._getEmulatedMachines(file(path).read()) Line 69: expectedMachines = ['rhel6.3.0', 'pc', 'rhel6.2.0', 'rhel6.1.0', Line 70: 'rhel6.0.0', 'rhel5.5.0', 'rhel5.4.4', 'rhel5.4.0'] Line 71: self.assertEqual(machines, expectedMachines)
.................................................... File vdsm/caps.py Line 130: if capabilities is None: Line 131: capabilities = _getCapsXMLStr() Line 132: caps = ET.fromstring(capabilities) Line 133: return [m.text for m in Line 134: caps.findall("guest/arch[@name='x86_64']/machine")] xml.etree.ElementTree is included in python standard library, is it still a problem? the way you suggested could become inaccurate. Line 135: Line 136: Line 137: def _getAllCpuModels(): Line 138: cpu_map = minidom.parseString(
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Vinzenz Feenstra has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 3: I would prefer that you didn't submit this
(1 inline comment)
.................................................... File vdsm/caps.py Line 21: """Collect host capabilities""" Line 22: Line 23: import os Line 24: from xml.dom import minidom Line 25: import xml.etree.ElementTree as ET Do we really need to import it as ET? On usage this might be quite confusing. And for a one time use I don't see a point in having a short cut. Line 26: import logging Line 27: import time Line 28: import struct Line 29: import socket
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Mark Wu has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 4:
Patch Set 4 change: 1. update caps_libvirt.out with latest libvirt caps output to verify the patch can solve the problem as per Hunt Xu's comments. 2. Use the full name of the ElementTree module as per Vinzenz Feenstra's comments
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Mark Wu has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 4: Verified
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 4: (1 inline comment)
.................................................... File vdsm/caps.py Line 130: if capabilities is None: Line 131: capabilities = _getCapsXMLStr() Line 132: caps = xml.etree.ElementTree.fromstring(capabilities) Line 133: return [m.text for m in Line 134: caps.findall("guest/arch[@name='x86_64']/machine")] welcom, xpath, to vdsm.
(I'm slightly hurt by needing to link with both xml.minidom and xml.etree. maybe we should have a gradual move to etree?) Line 135: Line 136: Line 137: def _getAllCpuModels(): Line 138: cpu_map = minidom.parseString(
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Adam Litke has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 4: I would prefer that you didn't submit this
(1 inline comment)
Just want to consider if we can avoid importing xml.etree.
.................................................... File vdsm/caps.py Line 21: """Collect host capabilities""" Line 22: Line 23: import os Line 24: from xml.dom import minidom Line 25: import xml.etree.ElementTree this is the first time we are using xml.etree. Can you try to change your code so that it only depends on xml.dom.minidom? Line 26: import logging Line 27: import time Line 28: import struct Line 29: import socket
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Hunt Xu has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 4: (1 inline comment)
.................................................... File vdsm/caps.py Line 130: if capabilities is None: Line 131: capabilities = _getCapsXMLStr() Line 132: caps = xml.etree.ElementTree.fromstring(capabilities) Line 133: return [m.text for m in Line 134: caps.findall("guest/arch[@name='x86_64']/machine")] To avoid xml.etree:
return [ m.firstChild.toxml() for m in caps.getElementsByTagName('guest')[0].getElementsByTagName('arch')[0].childNodes if m.nodeName == 'machine'] Line 135: Line 136: Line 137: def _getAllCpuModels(): Line 138: cpu_map = minidom.parseString(
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Hunt Xu has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 5: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Adam Litke has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 5: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 5: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Mark Wu has posted comments on this change.
Change subject: Fix duplicate emulated machines returned ......................................................................
Patch Set 5: Verified
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Fix duplicate emulated machines returned ......................................................................
Fix duplicate emulated machines returned
On Fedora, libvirt call getCapabilities() also append the list of emulated machines to the 'domain' node whose type is 'kvm'. The list is identical to what's listed in the default info of that arch. So it would cause getElementsByTagName('machine') matches all of machine tags and return a list of duplidate emuated machines.
This patch changes to only collect information from the direct children of tag 'arch' and adds a test case for it.
Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Signed-off-by: Mark Wu wudxw@linux.vnet.ibm.com --- M tests/capsTests.py M tests/caps_libvirt.out M vdsm/caps.py 3 files changed, 84 insertions(+), 41 deletions(-)
Approvals: Adam Litke: Looks good to me, but someone else must approve Hunt Xu: Looks good to me, but someone else must approve Mark Wu: Verified Dan Kenigsberg: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/8208 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I7e28688bf09b5bc413afffe9cc1501d4247d67e0 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org