ia64/xen-unstable

changeset 9141:f43f094467f6

Allow callers to XendClient.xend_list_domains to specify the detail flag, and
turn detail off when doing vcpu-list. This avoids calls to xenstore just to
get the list of domains for the vcpu-list call, significantly increasing
performance of that command on loaded systems.

Closes bug #545.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Sat Mar 04 19:15:36 2006 +0100 (2006-03-04)
parents 5aae1b1c3098
children 64f11b0e2e7d
files tools/python/xen/xend/XendClient.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xend/XendClient.py	Sat Mar 04 19:12:37 2006 +0100
     1.2 +++ b/tools/python/xen/xend/XendClient.py	Sat Mar 04 19:15:36 2006 +0100
     1.3 @@ -196,8 +196,9 @@ class Xend:
     1.4      def xend_domains(self):
     1.5          return self.xendGet(self.domainurl())
     1.6  
     1.7 -    def xend_list_domains(self):
     1.8 -        return self.xendGet(self.domainurl(), {'detail': '1'})
     1.9 +    def xend_list_domains(self, detail = True):
    1.10 +        return self.xendGet(self.domainurl(),
    1.11 +                            {'detail': detail and '1' or '0'})
    1.12  
    1.13      def xend_domain_vcpuinfo(self, dom):
    1.14          return self.xendGet(self.domainurl(dom), {'op': 'vcpuinfo'})
     2.1 --- a/tools/python/xen/xm/main.py	Sat Mar 04 19:12:37 2006 +0100
     2.2 +++ b/tools/python/xen/xm/main.py	Sat Mar 04 19:15:36 2006 +0100
     2.3 @@ -396,10 +396,8 @@ def xm_vcpu_list(args):
     2.4      if args:
     2.5          dominfo = map(server.xend_domain_vcpuinfo, args)
     2.6      else:
     2.7 -        doms = server.xend_list_domains()
     2.8 -        dominfo = map(
     2.9 -            lambda x: server.xend_domain_vcpuinfo(sxp.child_value(x, 'name')),
    2.10 -            doms)
    2.11 +        doms = server.xend_list_domains(False)
    2.12 +        dominfo = map(server.xend_domain_vcpuinfo, doms)
    2.13  
    2.14      print 'Name                              ID  VCPU  CPU  State  Time(s)  CPU Affinity'
    2.15