WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Remove vcpu_avail from the public S-Expression that's pa

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Remove vcpu_avail from the public S-Expression that's passed over the wire.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 29 Mar 2006 15:26:07 +0000
Delivery-date: Wed, 29 Mar 2006 15:27:54 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User anthony@xxxxxxxxxxxxxxxxxxxxx
# Node ID 58938b561b66db7063634f94f48c201cef02e901
# Parent  48abab2ab71961457d59285bc90fa97958997ec7
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@xxxxxxxxxx>

diff -r 48abab2ab719 -r 58938b561b66 
tools/python/xen/xend/server/XMLRPCServer.py
--- a/tools/python/xen/xend/server/XMLRPCServer.py      Wed Mar 29 12:56:26 2006
+++ b/tools/python/xen/xend/server/XMLRPCServer.py      Wed Mar 29 13:50:57 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')

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Remove vcpu_avail from the public S-Expression that's passed over the wire., Xen patchbot -unstable <=