Skip to contentSkip to conversation

Fix for creating VLANs using the Xen-API

PATCH New Stefan Berger 1 participant 1 message Jul 26, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix for creating VLANs using the Xen-API

Recent changes to the setup of the peth0 interface have resulted in a change of its MAC address. Previously it seems to have had a MAC address of 'fe:ff:ff:ff:ff:ff', but now it has the same MAC address as eth0. As a consequence to this the Xen-API code to create VLANs (PIF.create_VLAN("peth0",...)) does not work anymore, since peth0 can not be identified according to this previous criteria of fake MAC address. This patch fixes this issue by identifying it through the prefix 'peth'.

xen-unstable.hg/tools/python/xen/xend/XendPIF.py +3 -3
Index: root/xen-unstable.hg/tools/python/xen/xend/XendPIF.py
===================================================================
@@ -41,8 +41,8 @@ def linux_phy_to_virt(pif_name):
 def linux_get_phy_ifaces():
     """Returns a list of physical interfaces.
 
-    Identifies PIFs as those that have a interface name starting with 'p'
-    and have the fake 'fe:ff:ff:ff:ff:ff' MAC address.
+    Identifies PIFs as those that have a interface name starting with
+    'peth'.
 
     See /etc/xen/scripts/network-bridge for how the devices are renamed.
 
@@ -62,7 +62,7 @@ def linux_get_phy_ifaces():
                 
         # resolve pifs' mac addresses
         for name, mtu, mac in ifaces.values():
-            if name[0] == 'p' and mac == 'fe:ff:ff:ff:ff:ff':
+            if name.startswith('peth'):
                 bridged_ifname = linux_phy_to_virt(name)
                 bridged_if = ifaces.get(bridged_ifname)
                 if bridged_if:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel