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

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Mon Jan 13 11:20:44 UTC 2014


Reviewed-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>

On 01/13/2014 09:12 AM, shaohef at linux.vnet.ibm.com wrote:
> 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):




More information about the Kimchi-devel mailing list