From: Stefan Berger Subject: [PATCH] [XEND] Fix for creating VLANs using the Xen-API Date: Thu, 26 Jul 2007 11:38:38 -0400 Message-ID: <1185464318.3650.1.camel@gsal-3.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-iYM2FLtXbnRxCkCeSb9M" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org --=-iYM2FLtXbnRxCkCeSb9M Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 --=-iYM2FLtXbnRxCkCeSb9M Content-Disposition: attachment; filename=xend_pif_peth_detection_fix.diff Content-Type: text/x-patch; name=xend_pif_peth_detection_fix.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: root/xen-unstable.hg/tools/python/xen/xend/XendPIF.py =================================================================== --- root.orig/xen-unstable.hg/tools/python/xen/xend/XendPIF.py +++ 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: --=-iYM2FLtXbnRxCkCeSb9M Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-iYM2FLtXbnRxCkCeSb9M--