[virt-tools-list] [virt-manager PATCH 1/2] interface: Return mac address correctly for bridge devices

Lin Ma lma at suse.com
Fri Jan 20 07:42:41 UTC 2017


Because a bridge xml doesn't include its own mac item, what it contains
are the slave devices's mac, It causes the get_xmlobj().macaddr can't
return the mac address of bridge.

So while showing host details, The bridge's mac address is displayed as
'Unknown' in tab 'Network Interfaces'. Say virbr0, We known a dummp tap
was already connected to it to maintain a fixed mac address for virbr0,
But its mac is displayed as 'Unknown' in tab 'Network Interfaces'.

The patch fixed the issue by returning mac from backend instead of xml.

Signed-off-by: Lin Ma <lma at suse.com>
---
 virtManager/interface.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virtManager/interface.py b/virtManager/interface.py
index 3af5974..626465e 100644
--- a/virtManager/interface.py
+++ b/virtManager/interface.py
@@ -81,7 +81,7 @@ class vmmInterface(vmmLibvirtObject):
     ################
 
     def get_mac(self):
-        return self.get_xmlobj().macaddr
+        return self._backend.MACString()
 
     def is_bridge(self):
         typ = self.get_type()
-- 
2.9.2




More information about the virt-tools-list mailing list