debuggers.hg

changeset 21003:b9a84ded541f

xm: Fix xm network-list for XenAPI

When I use XenAPI, MAC addresses are not shown by xm network-list.
MAC addresses are shown by this patch.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Feb 22 10:00:24 2010 +0000 (2010-02-22)
parents a591bf0a9dd6
children 0fa4ead4ed0f
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Mon Feb 22 09:58:48 2010 +0000
     1.2 +++ b/tools/python/xen/xm/main.py	Mon Feb 22 10:00:24 2010 +0000
     1.3 @@ -2144,8 +2144,11 @@ def xm_network_list(args):
     1.4  
     1.5      if serverType == SERVER_XEN_API:
     1.6          vif_refs = server.xenapi.VM.get_VIFs(get_single_vm(dom))
     1.7 -        vif_properties = \
     1.8 -            map(server.xenapi.VIF.get_runtime_properties, vif_refs)
     1.9 +        vif_properties = []
    1.10 +        for vif_ref in vif_refs:
    1.11 +            vif_property = server.xenapi.VIF.get_runtime_properties(vif_ref)
    1.12 +            vif_property['mac'] = server.xenapi.VIF.get_MAC(vif_ref)
    1.13 +            vif_properties.append(vif_property)
    1.14          devs = map(lambda (handle, properties): [handle, map2sxp(properties)],
    1.15                     zip(range(len(vif_properties)), vif_properties))
    1.16      else: