mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
d34501c219
commit
8ee550dbe0
2 files changed
+5
-6
No files matched your search
@@ -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'})
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||