Search for renamed vlan devices using the typical convention p+name (Saori Fukuta)

This commit is contained in:
Cole Robinson 2008-07-25 13:35:01 -04:00
parent 9339032ad0
commit 737d2614f4
1 changed files with 9 additions and 0 deletions

View File

@ -225,6 +225,15 @@ class vmmConnection(gobject.GObject):
vlanmac = self._net_get_mac_address(name, vlanpath)
if vlanmac:
(ignore,vlanname) = os.path.split(vlanpath)
# If running a device in bridged mode, there's areasonable
# chance that the actual ethernet device has beenrenamed to
# something else. ethN -> pethN
pvlanpath = vlanpath[0:len(vlanpath)-len(vlanname)] + "p" + vlanname
if os.path.exists(pvlanpath):
logging.debug("Device %s named to p%s" % (vlanname, vlanname))
vlanname = "p" + vlanname
vlanpath = pvlanpath
self._net_device_added(vlanname, vlanmac, vlanpath)
def _net_device_added(self, name, mac, sysfspath):