From: Anthony Liguori <aliguori@us.ibm.com>
To: xen-devel <xen-devel@lists.xensource.com>
Cc: Ewan Mellor <ewan@xensource.com>,
"Puthiyaparambil, Aravindh" <aravindh.puthiyaparambil@unisys.com>
Subject: [PATCH] Remove vcpu_avail from the S-Expression that's passed on the wire
Date: Tue, 28 Mar 2006 13:42:04 -0600 [thread overview]
Message-ID: <4429918C.40502@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 429 bytes --]
Third time's a charm right :-)
vcpu_avail is the configuration parameter that's tripping us up on large
SMP systems. Instead of modifying the XML-RPC layer, a much less
invasive solution is just to remove vcpu_avail from the S-Expression
that's passed over the wire. The vcpu_avail parameter is not used by xm
so this seems like a pretty reasonable thing to do. It certainly feels
less hacky.
Regards,
Anthony Liguori
[-- Attachment #2: xend-xmlrpc-vcpu_avail.diff --]
[-- Type: text/plain, Size: 2061 bytes --]
# HG changeset patch
# User anthony@rhesis.austin.ibm.com
# Node ID 96c1e3c2d336a0f9cdb9e074c737e7026cede171
# Parent 4109c4e7804abeabe3b222673f2ba4dd1375be53
Remove vcpu_avail from the public S-Expression that's passed over the wire.
This trips up the XML-RPC layer on large SMP systems and isn't actually used
by xm.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff -r 4109c4e7804a -r 96c1e3c2d336 tools/python/xen/xend/server/XMLRPCServer.py
--- a/tools/python/xen/xend/server/XMLRPCServer.py Tue Mar 28 13:19:22 2006
+++ b/tools/python/xen/xend/server/XMLRPCServer.py Tue Mar 28 19:29:40 2006
@@ -24,6 +24,7 @@
from xen.xend.XendClient import XML_RPC_SOCKET, ERROR_INVALID_DOMAIN
from xen.xend.XendError import *
+from types import ListType
def lookup(domid):
info = XendDomain.instance().domain_lookup_by_name_or_id(domid)
@@ -35,24 +36,36 @@
info = lookup(domid)
return getattr(info, fn)(*args)
+# vcpu_avail is a long and is not needed by the clients. It's far easier
+# to just remove it then to try and marshal the long.
+def fixup_sxpr(sexpr):
+ ret = []
+ for k in sexpr:
+ if type(k) is ListType:
+ if len(k) != 2 or k[0] != 'vcpu_avail':
+ ret.append(fixup_sxpr(k))
+ else:
+ ret.append(k)
+ return ret
+
def domain(domid):
info = lookup(domid)
- return info.sxpr()
+ return fixup_sxpr(info.sxpr())
def domains(detail=1):
if detail < 1:
return XendDomain.instance().list_names()
else:
domains = XendDomain.instance().list_sorted()
- return map(lambda dom: dom.sxpr(), domains)
+ return map(lambda dom: fixup_sxpr(dom.sxpr()), domains)
def domain_create(config):
info = XendDomain.instance().domain_create(config)
- return info.sxpr()
+ return fixup_sxpr(info.sxpr())
def domain_restore(src):
info = XendDomain.instance().domain_restore(src)
- return info.sxpr()
+ return fixup_sxpr(info.sxpr())
def get_log():
f = open(XendLogging.getLogFilename(), 'r')
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2006-03-28 19:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-28 19:42 Anthony Liguori [this message]
2006-03-28 23:45 ` [PATCH] Remove vcpu_avail from the S-Expression that's passed on the wire Anthony Liguori
2006-03-29 12:55 ` Keir Fraser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4429918C.40502@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=aravindh.puthiyaparambil@unisys.com \
--cc=ewan@xensource.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.