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>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2006-03-04 19:15:36 +01:00
1 parent d34501c219
commit 8ee550dbe0
2 files changed
+5 -6

No files matched your search

+3 -2
View File
@@ -196,8 +196,9 @@ class Xend:
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'})
+2 -4
View File
@@ -396,10 +396,8 @@ def xm_vcpu_list(args):
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'
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.