]> xenbits.xensource.com Git - xen.git/commitdiff
xm: Fix xm network-list for XenAPI
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 22 Feb 2010 10:00:24 +0000 (10:00 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 22 Feb 2010 10:00:24 +0000 (10:00 +0000)
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>
tools/python/xen/xm/main.py

index 0ca4f7a3447c36bed6f5b34521d03e2104dd3951..73e868f2cbc29812151bd527352bd1f5811afffd 100644 (file)
@@ -2144,8 +2144,11 @@ def xm_network_list(args):
 
     if serverType == SERVER_XEN_API:
         vif_refs = server.xenapi.VM.get_VIFs(get_single_vm(dom))
-        vif_properties = \
-            map(server.xenapi.VIF.get_runtime_properties, vif_refs)
+        vif_properties = []
+        for vif_ref in vif_refs:
+            vif_property = server.xenapi.VIF.get_runtime_properties(vif_ref)
+            vif_property['mac'] = server.xenapi.VIF.get_MAC(vif_ref)
+            vif_properties.append(vif_property)
         devs = map(lambda (handle, properties): [handle, map2sxp(properties)],
                    zip(range(len(vif_properties)), vif_properties))
     else: