direct-io.hg

changeset 9463:58938b561b66

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>
author anthony@rhesis.austin.ibm.com
date Wed Mar 29 14:50:57 2006 +0100 (2006-03-29)
parents 48abab2ab719
children d7cbcf5d7cd6
files tools/python/xen/xend/server/XMLRPCServer.py
line diff
     1.1 --- a/tools/python/xen/xend/server/XMLRPCServer.py	Wed Mar 29 13:56:26 2006 +0100
     1.2 +++ b/tools/python/xen/xend/server/XMLRPCServer.py	Wed Mar 29 14:50:57 2006 +0100
     1.3 @@ -24,6 +24,7 @@ from xen.util.xmlrpclib2 import UnixXMLR
     1.4  
     1.5  from xen.xend.XendClient import XML_RPC_SOCKET, ERROR_INVALID_DOMAIN
     1.6  from xen.xend.XendError import *
     1.7 +from types import ListType
     1.8  
     1.9  def lookup(domid):
    1.10      info = XendDomain.instance().domain_lookup_by_name_or_id(domid)
    1.11 @@ -35,24 +36,36 @@ def dispatch(domid, fn, args):
    1.12      info = lookup(domid)
    1.13      return getattr(info, fn)(*args)
    1.14  
    1.15 +# vcpu_avail is a long and is not needed by the clients.  It's far easier
    1.16 +# to just remove it then to try and marshal the long.
    1.17 +def fixup_sxpr(sexpr):
    1.18 +    ret = []
    1.19 +    for k in sexpr:
    1.20 +        if type(k) is ListType:
    1.21 +            if len(k) != 2 or k[0] != 'vcpu_avail':
    1.22 +                ret.append(fixup_sxpr(k))
    1.23 +        else:
    1.24 +            ret.append(k)
    1.25 +    return ret
    1.26 +
    1.27  def domain(domid):
    1.28      info = lookup(domid)
    1.29 -    return info.sxpr()
    1.30 +    return fixup_sxpr(info.sxpr())
    1.31  
    1.32  def domains(detail=1):
    1.33      if detail < 1:
    1.34          return XendDomain.instance().list_names()
    1.35      else:
    1.36          domains = XendDomain.instance().list_sorted()
    1.37 -        return map(lambda dom: dom.sxpr(), domains)
    1.38 +        return map(lambda dom: fixup_sxpr(dom.sxpr()), domains)
    1.39  
    1.40  def domain_create(config):
    1.41      info = XendDomain.instance().domain_create(config)
    1.42 -    return info.sxpr()
    1.43 +    return fixup_sxpr(info.sxpr())
    1.44  
    1.45  def domain_restore(src):
    1.46      info = XendDomain.instance().domain_restore(src)
    1.47 -    return info.sxpr()    
    1.48 +    return fixup_sxpr(info.sxpr())
    1.49  
    1.50  def get_log():
    1.51      f = open(XendLogging.getLogFilename(), 'r')