ia64/xen-unstable

changeset 15654:68f0e623f6b0

[XEND] 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'.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author kfraser@localhost.localdomain
date Fri Jul 27 09:03:35 2007 +0100 (2007-07-27)
parents bf512fde6667
children f035c4d9880a
files tools/python/xen/xend/XendPIF.py
line diff
     1.1 --- a/tools/python/xen/xend/XendPIF.py	Fri Jul 27 09:01:15 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendPIF.py	Fri Jul 27 09:03:35 2007 +0100
     1.3 @@ -37,8 +37,8 @@ def linux_phy_to_virt(pif_name):
     1.4  def linux_get_phy_ifaces():
     1.5      """Returns a list of physical interfaces.
     1.6  
     1.7 -    Identifies PIFs as those that have a interface name starting with 'p'
     1.8 -    and have the fake 'fe:ff:ff:ff:ff:ff' MAC address.
     1.9 +    Identifies PIFs as those that have a interface name starting with
    1.10 +    'peth'.
    1.11  
    1.12      See /etc/xen/scripts/network-bridge for how the devices are renamed.
    1.13  
    1.14 @@ -58,7 +58,7 @@ def linux_get_phy_ifaces():
    1.15                  
    1.16          # resolve pifs' mac addresses
    1.17          for name, mtu, mac in ifaces.values():
    1.18 -            if name[0] == 'p' and mac == 'fe:ff:ff:ff:ff:ff':
    1.19 +            if name.startswith('peth'):
    1.20                  bridged_ifname = linux_phy_to_virt(name)
    1.21                  bridged_if = ifaces.get(bridged_ifname)
    1.22                  if bridged_if: