Adam Litke has posted comments on this change.
Change subject: add verb for vdsm to tuneCpu params
......................................................................
Patch Set 5: (6 inline comments)
Pretty close! Just a few minor things to change.
....................................................
File vdsm/API.py
Line 560: try:
Line 561: v = self._cif.vmContainer[self._UUID]
Line 562: for key in tuneParams:
Line 563: tuneParams[key] = storage.misc.validateInt(tuneParams[key],
key)
Line 564: except KeyError:
This catch of KeyError only applies to the v=self._cif.vmContainer ... call. You should
place the for key in tuneParams loop in a separate try block that only catches
se.InvalidParameterExeption.
Line 565: return errCode['noVM']
Line 566: except se.InvalidParameterException:
Line 567: return errCode['tunecpuErr']
Line 568: return v.tuneCpu(tuneParams)
....................................................
File vdsm_api/vdsmapi-schema.json
Line 5071: ##
Line 5072: ## @vcpu_period: the enforcement period of vcpu_quota
Line 5073: ##
Line 5074: ## @vcpu_quota: max bandwidth vCPU can consume
Line 5075: ##
In the next patch series, please align the all descriptions at the same level:
Line 5076: ## @emulator_quota: max bandwidth of the emulator thread
Line 5077: ##
Line 5078: ## @emulator_period: the enforcement period of emulator_period
Line 5079: ###
....................................................
File vdsm_cli/vdsClient.py
Line 205: return self.ExecAndExit(self.s.create(params))
Line 206:
Line 207: def tuneCpu(self, args):
Line 208: params = {}
Line 209: confLines = []
Why do you need confLines?
Line 210: params['vmId'] = args[0]
Line 211: if len(args) > 1:
Line 212: confLines.extend(args[1:])
Line 213: for line in confLines:
Line 209: confLines = []
Line 210: params['vmId'] = args[0]
Line 211: if len(args) > 1:
Line 212: confLines.extend(args[1:])
Line 213: for line in confLines:
for param in args[1:]:
Line 214: if '=' in line:
Line 215: param, value = line.split("=", 1)
Line 216: params[param] = value
Line 217: return self.ExecAndExit(self.s.tuneCpu(params))
Line 210: params['vmId'] = args[0]
Line 211: if len(args) > 1:
Line 212: confLines.extend(args[1:])
Line 213: for line in confLines:
Line 214: if '=' in line:
line is not a great name for this variable. We expect it to be a <key>=<val>
parameter so how about 'param' ?
Line 215: param, value = line.split("=", 1)
Line 216: params[param] = value
Line 217: return self.ExecAndExit(self.s.tuneCpu(params))
Line 218:
Line 211: if len(args) > 1:
Line 212: confLines.extend(args[1:])
Line 213: for line in confLines:
Line 214: if '=' in line:
Line 215: param, value = line.split("=", 1)
var, value = param.split("=", 1)
Line 216: params[param] = value
Line 217: return self.ExecAndExit(self.s.tuneCpu(params))
Line 218:
Line 219: def hotplugNic(self, args):
--
To view, visit
http://gerrit.ovirt.org/7492
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I09e02e09ef06ad6de45be75c3f2f913a3025750f
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Adam Litke <agl(a)us.ibm.com>
Gerrit-Reviewer: Doron Fediuck <dfediuck(a)redhat.com>
Gerrit-Reviewer: Laszlo Hornyak <lhornyak(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Ryan Harper <ryanh(a)us.ibm.com>
Gerrit-Reviewer: Zhu Bo <bozhu(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server