[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Allow callers to XendClient.xend_list_domains to specify the detail flag, and



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID f43f094467f6f401ec9f54f1855cf142adcef92f
# Parent  5aae1b1c30980fe704e723926db1f4e527e03f32
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 5aae1b1c3098 -r f43f094467f6 tools/python/xen/xend/XendClient.py
--- a/tools/python/xen/xend/XendClient.py       Sat Mar  4 18:12:37 2006
+++ b/tools/python/xen/xend/XendClient.py       Sat Mar  4 18:15:36 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 5aae1b1c3098 -r f43f094467f6 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Sat Mar  4 18:12:37 2006
+++ b/tools/python/xen/xm/main.py       Sat Mar  4 18:15:36 2006
@@ -396,10 +396,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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.