Change in vdsm[master]: v2v: externalVMList Xen+Kvm support

nsoffer at redhat.com nsoffer at redhat.com
Thu Jan 7 13:18:21 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: v2v: externalVMList Xen+Kvm support
......................................................................


Patch Set 26:

(2 comments)

https://gerrit.ovirt.org/#/c/48672/26/tests/v2vTests.py
File tests/v2vTests.py:

Line 130:     def listDomainsID(self):
Line 131:         # listDomainsID return only active domains
Line 132:         return [vm.id for vm in self._vms if vm.isActive]
Line 133: 
Line 134:     def lookupByName(self, name):
This returns all domains - both active and inactive:
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByName
Line 135:         for vm in self._vms:
Line 136:             if vm.name == name:
Line 137:                 return vm
Line 138:         raise fake.Error(libvirt.VIR_ERR_NO_DOMAIN,


Line 137:                 return vm
Line 138:         raise fake.Error(libvirt.VIR_ERR_NO_DOMAIN,
Line 139:                          'virDomainLookupByName() failed')
Line 140: 
Line 141:     def lookupByID(self, id):
This returns only active domains, since inactive domain id is -1:
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByID

So you should check vm.active and skip inactive domains.

Looking at the docs, it seem that the lookup code is wrong, and we should use lookupByUUID, since the vmid is a UUID, not a libvirt domain id (small integer).
Line 142:         for vm in self._vms:
Line 143:             if vm.id == id:
Line 144:                 return vm
Line 145:         raise fake.Error(libvirt.VIR_ERR_NO_DOMAIN,


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic7d7e211a9343a528f260da2686b34cea00c53a4
Gerrit-PatchSet: 26
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Eric Blake <eblake at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list