[Kimchi-devel] [PATCH] get vms list by listAllDomains

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Mon Jan 13 11:12:43 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

we can get all domains by listAllDomains

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 src/kimchi/model.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/kimchi/model.py b/src/kimchi/model.py
index 671af02..4b7df7e 100644
--- a/src/kimchi/model.py
+++ b/src/kimchi/model.py
@@ -646,10 +646,7 @@ class Model(object):
 
     def vms_get_list(self):
         conn = self.conn.get()
-        ids = conn.listDomainsID()
-        names = map(lambda x: conn.lookupByID(x).name(), ids)
-        names += conn.listDefinedDomains()
-        names = map(lambda x: x.decode('utf-8'), names)
+        names = [dom.name().decode('utf-8') for dom in conn.listAllDomains(0)]
         return sorted(names, key=unicode.lower)
 
     def vmscreenshot_lookup(self, name):
-- 
1.8.4.2




More information about the Kimchi-devel mailing list