Change in vdsm[master]: Adding utility methods and conf for CPU limit MOM integration

msivak at redhat.com msivak at redhat.com
Tue May 13 13:56:43 UTC 2014


Martin Sivák has posted comments on this change.

Change subject: Adding utility methods and conf for CPU limit MOM integration
......................................................................


Patch Set 11:

(2 comments)

http://gerrit.ovirt.org/#/c/27258/11/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 4393: 
Line 4394:         metadataCpuLimit = domain.getMetadata(2,'http://ovirt.org/param/vcpu_limit',0)
Line 4395: 
Line 4396:         if metadataCpuLimit:
Line 4397:             pattern = "^<vcpu_limit>(.*)</vcpu_limit>"
Please use re.compile to compile the regexp to a class constant (in the class block, outside __init__).
Line 4398:             metadataCpuLimit = re.search(pattern,
Line 4399:                                          metadataCpuLimit, re.M)
Line 4400:             ret['vcpu_user_limit'] = metadataCpuLimit.group(1)
Line 4401:         else:


Line 4460: 
Line 4461: 
Line 4462:     def setCpuTuneQuota(self, quota):
Line 4463: 
Line 4464:         def reportError(key='cpuTuneErr', msg=None):
I do not really like this duplicated nested function (all except one word) and would prefer if you removed the duplication.
Line 4465:             self.log.error("Set new vcpu quota failed", exc_info=True)
Line 4466:             if msg is None:
Line 4467:                 error = errCode[key]
Line 4468:             else:


-- 
To view, visit http://gerrit.ovirt.org/27258
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic502d9a4a976cd76bb6042bbb51f6cd281199631
Gerrit-PatchSet: 11
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Kobi Ianko <kobi at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: David Caro <dcaroest at redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik at redhat.com>
Gerrit-Reviewer: Kobi Ianko <kobi at redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list