# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1240843358 -3600
# Node ID a63d20d7a941a050ecfbf2fd7a8909915e62f79b
# Parent d89f655e5698e0bd87a0a56b22a6da1f88eaabcc
xend: Fix for op_pincpu in SrvDomain.py
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.
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
tools/python/xen/xend/XendAPI.py | 3 +--
tools/python/xen/xend/XendDomain.py | 1 +
tools/python/xen/xm/main.py | 5 ++---
3 files changed, 4 insertions(+), 5 deletions(-)
diff -r d89f655e5698 -r a63d20d7a941 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py Mon Apr 27 15:41:28 2009 +0100
+++ b/tools/python/xen/xend/XendAPI.py Mon Apr 27 15:42:38 2009 +0100
@@ -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)
diff -r d89f655e5698 -r a63d20d7a941 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py Mon Apr 27 15:41:28 2009 +0100
+++ b/tools/python/xen/xend/XendDomain.py Mon Apr 27 15:42:38 2009 +0100
@@ -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):
diff -r d89f655e5698 -r a63d20d7a941 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py Mon Apr 27 15:41:28 2009 +0100
+++ b/tools/python/xen/xm/main.py Mon Apr 27 15:42:38 2009 +0100
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|