Fix for op_pincpu in SrvDomain.py
PATCH 1/1 Fix for op_pincpu in SrvDomain.py
Hi,
op_pincpu method in SrvDomain.py does not currently work because op_pincpu method gives string objects to a cpumap argument of domain_pincpu method in XendDomain.py though the cpumap argument expects list objects.
This patch solves the above problem as follows.
op_pincpu method gives string objects to the cpumap argument as is, because op_pincpu method cannot give list objects to the cpumap argument.
Instead, domain_pincpu method expects that the cpumap argument is string objects, then domain_pincpu method converts the cpumap argument into list objects.
Also, the patch modifies two methods (except for op_pincpu method) calling domain_pincpu method. The methods give string objects to the cpumap argument instead of list objects.
Best regards,
Kan
tools/python/xen/xend/XendAPI.py +1 -2
@@ -1509,8 +1509,7 @@ class XendAPI(object): if key.startswith("cpumap"): vcpu = int(key[6:]) try: - cpus = map(int, value.split(",")) - xendom.domain_pincpu(xeninfo.getDomid(), vcpu, cpus) + xendom.domain_pincpu(xeninfo.getDomid(), vcpu, value) except Exception, ex: log.exception(ex)
tools/python/xen/xend/XendDomain.py +1 -0
@@ -1442,6 +1442,7 @@ class XendDomain: # set the same cpumask for all vcpus rc = 0 cpus = dominfo.getCpus() + cpumap = map(int, cpumap.split(",")) for v in vcpus: try: if dominfo._stateGet() in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):
tools/python/xen/xm/main.py +2 -3
@@ -1379,7 +1379,7 @@ def xm_vcpu_pin(args): else: cpus.append(int(c)) cpus.sort() - return cpus + return ",".join(map(str, cpus)) dom = args[0] vcpu = args[1]
@@ -1389,9 +1389,8 @@ def xm_vcpu_pin(args): cpumap = cpu_make_map(args[2]) if serverType == SERVER_XEN_API: - cpumap = map(str, cpumap) server.xenapi.VM.add_to_VCPUs_params_live( - get_single_vm(dom), "cpumap%i" % int(vcpu), ",".join(cpumap)) + get_single_vm(dom), "cpumap%i" % int(vcpu), cpumap) else: server.xend.domain.pincpu(dom, vcpu, cpumap)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel