Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 204892 - Xend (3.1.2) does't properly restart with custom named interfaces
Summary: Xend (3.1.2) does't properly restart with custom named interfaces
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Xen Devs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-08 12:37 UTC by Reto Gantenbein (ganto)
Modified: 2011-03-26 11:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Reto Gantenbein (ganto) 2008-01-08 12:37:55 UTC
If you rename your interfaces with udev (e.g. public instead of eth0) and attach them to Xen bridges the xend doesn't succeed to restart. 



Reproducible: Always

Steps to Reproduce:
1. rename network interface with udev
2. attach it to xen-bridge
3. restart xend

Actual Results:  
Error message:
[2008-01-04 18:00:51 16495] INFO (SrvDaemon:331) Xend Daemon started
[2008-01-04 18:00:51 16495] INFO (SrvDaemon:335) Xend changeset: unavailable.
[2008-01-04 18:00:51 16495] INFO (SrvDaemon:342) Xend version: Unknown.
[2008-01-04 18:00:51 16495] ERROR (SrvDaemon:353) Exception starting xend (local variable 'bridged_mac' referenced before assignment)
Traceback (most recent call last):
  File "usr/lib64/python2.4/site-packages/xen/xend/server/SrvDaemon.py", line 345, in run
    servers = SrvServer.create()
  File "usr/lib64/python2.4/site-packages/xen/xend/server/SrvServer.py", line 254, in create
    root.putChild('xend', SrvRoot())
  File "usr/lib64/python2.4/site-packages/xen/xend/server/SrvRoot.py", line 40, in __init__
    self.get(name)
  File "usr/lib64/python2.4/site-packages/xen/web/SrvDir.py", line 82, in get
    val = val.getobj()
  File "usr/lib64/python2.4/site-packages/xen/web/SrvDir.py", line 52, in getobj
    self.obj = klassobj()
  File "usr/lib64/python2.4/site-packages/xen/xend/server/SrvNode.py", line 30, in __init__
    self.xn = XendNode.instance()
  File "usr/lib64/python2.4/site-packages/xen/xend/XendNode.py", line 659, in instance
    inst = XendNode()
  File "usr/lib64/python2.4/site-packages/xen/xend/XendNode.py", line 178, in __init__
    unconfigured_pifs = [(name, mtu, mac)
  File "usr/lib64/python2.4/site-packages/xen/xend/XendPIF.py", line 66, in linux_get_phy_ifaces
    phy_ifaces.append((name, int(mtu), bridged_mac))
UnboundLocalError: local variable 'bridged_mac' referenced before assignment




Expected Results:  
successful restart of Xen daemon

Found fix in Bug report for Debian (cannot remember URL anymore).

Patch in /usr/lib64/python2.4/site-packages/xen/xend/XendPIF.py:

  IP_IFACE_RE = re.compile(r'^\d+: (\w+):.*mtu (\d+) .* link/\w+ ([0-9a-f:]+)')

 def linux_phy_to_virt(pif_name):
-    return 'eth' + re.sub(r'^[a-z]+', '', pif_name)
+    return re.sub(r'^p', '', pif_name)

 def linux_get_phy_ifaces():
     """Returns a list of physical interfaces.
Comment 1 Reto Gantenbein (ganto) 2008-01-08 13:14:09 UTC
source to patch: http://lists.alioth.debian.org/pipermail/pkg-xen-devel/2007-November/001509.html
Comment 2 Patrick Lauer gentoo-dev 2009-06-22 16:39:14 UTC
Hi Reto,

is this still a problem with newer xen versions (especially 3.4.0) ?
Comment 3 Alexey Shvetsov archtester gentoo-dev 2011-03-26 11:25:49 UTC
Xen 4.1 in tree. Please test with it and reopen if it doesnt work