|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-changelog
[Xen-changelog] Allow callers to XendClient.xend_list_domains to	specify
 
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 578a7cd07970be6836fcc8d58b503469e5abf0de
# Parent  1be3cb670cf22b55b7bb49f7c8aec3e16fa6e28f
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@xxxxxxxxxxxxx>
diff -r 1be3cb670cf2 -r 578a7cd07970 tools/python/xen/xend/XendClient.py
--- a/tools/python/xen/xend/XendClient.py       Wed Mar  8 22:57:53 2006
+++ b/tools/python/xen/xend/XendClient.py       Wed Mar  8 22:57:59 2006
@@ -196,8 +196,9 @@
     def xend_domains(self):
         return self.xendGet(self.domainurl())
 
-    def xend_list_domains(self):
-        return self.xendGet(self.domainurl(), {'detail': '1'})
+    def xend_list_domains(self, detail = True):
+        return self.xendGet(self.domainurl(),
+                            {'detail': detail and '1' or '0'})
 
     def xend_domain_vcpuinfo(self, dom):
         return self.xendGet(self.domainurl(dom), {'op': 'vcpuinfo'})
diff -r 1be3cb670cf2 -r 578a7cd07970 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Mar  8 22:57:53 2006
+++ b/tools/python/xen/xm/main.py       Wed Mar  8 22:57:59 2006
@@ -395,10 +395,8 @@
     if args:
         dominfo = map(server.xend_domain_vcpuinfo, args)
     else:
-        doms = server.xend_list_domains()
-        dominfo = map(
-            lambda x: server.xend_domain_vcpuinfo(sxp.child_value(x, 'name')),
-            doms)
+        doms = server.xend_list_domains(False)
+        dominfo = map(server.xend_domain_vcpuinfo, doms)
 
     print 'Name                              ID  VCPU  CPU  State  Time(s)  
CPU Affinity'
 
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
 |   
 
 | 
    | 
  
  
    |   | 
    |