Francesco Romani has uploaded a new change for review.
Change subject: virt: faster getVMList ......................................................................
virt: faster getVMList
avoid (apparently?) wasteful work and make the verb implementation faster with no changes in behaviour.
Change-Id: I82c602301bc133d6a4971c8a4d15f823929f7c43 Signed-off-by: Francesco Romani fromani@redhat.com --- M vdsm/API.py M vdsm/virt/vm.py 2 files changed, 5 insertions(+), 10 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/36902/1
diff --git a/vdsm/API.py b/vdsm/API.py index 6c28479..91632f9 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -1365,18 +1365,10 @@ # VM-related functions def getVMList(self, fullStatus=False, vmList=()): """ return a list of known VMs with full (or partial) config each """ - - def reportedStatus(v, full): - d = v.status() - if full: - return d - else: - return {'vmId': d['vmId'], 'status': d['status']} - # To improve complexity, convert 'vms' to set(vms) vmSet = set(vmList) return {'status': doneCode, - 'vmList': [reportedStatus(v, fullStatus) + 'vmList': [v.status(fullStatus) for v in self._cif.vmContainer.values() if not vmSet or v.id in vmSet]}
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 22bb957..2d69923 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -2796,8 +2796,11 @@ pass self.saveState()
- def status(self): + def status(self, fullStatus=True): # used by API.Global.getVMList + if not fullStatus: + return {'vmId': self.id, 'status': self.lastStatus} + self.conf['status'] = self.lastStatus with self._confLock: # Filter out any internal keys
automation@ovirt.org has posted comments on this change.
Change subject: virt: faster getVMList ......................................................................
Patch Set 1: Verified-1
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::ERROR, At least one bug-url is required for the stable branch * Check merged to previous::WARN, Still open on branches master
Francesco Romani has abandoned this change.
Change subject: virt: faster getVMList ......................................................................
Abandoned
not enough performance gain to justify the backport to the stable branch.
automation@ovirt.org has posted comments on this change.
Change subject: virt: faster getVMList ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found
vdsm-patches@lists.fedorahosted.org