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/
Home Products Support Community News


[Xen-changelog] Allow callers to XendClient.xend_list_domains to specify

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Allow callers to XendClient.xend_list_domains to specify the detail flag, and
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 04 Mar 2006 19:32:07 +0000
Delivery-date: Sat, 04 Mar 2006 19:32:49 +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 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)
-        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

<Prev in Thread] Current Thread [Next in Thread>