diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-07-27 09:04:35 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-07-27 09:04:35 +0100 |
commit | fecde045d39413368ad197016664291d85bbb173 (patch) | |
tree | f73dc1456df4d19c604da9042569f2895d88c069 /tools | |
parent | 61cd58b40096c85e9f601355922cdcaff5d97b26 (diff) | |
download | xen-fecde045d39413368ad197016664291d85bbb173.tar.gz xen-fecde045d39413368ad197016664291d85bbb173.tar.bz2 xen-fecde045d39413368ad197016664291d85bbb173.zip |
[Xend] Do network startup earlier.
Xend tries to rebuild the network configuration such as bridges and
vlan interfaces (in those bridges) when starting. Unfortunately this
fails on the first startup since the network script has not run, yet,
and for example created peth0. When restarting xend it works due to
the peth0 being there then. This patch moves the initialization of the
network to an earlier time in the xend initialization process to
mitigate this problem.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/python/xen/xend/XendPIF.py | 4 | ||||
-rw-r--r-- | tools/python/xen/xend/server/SrvServer.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tools/python/xen/xend/XendPIF.py b/tools/python/xen/xend/XendPIF.py index d29f9a363f..d210730765 100644 --- a/tools/python/xen/xend/XendPIF.py +++ b/tools/python/xen/xend/XendPIF.py @@ -24,6 +24,7 @@ from xen.xend import XendAPIStore from xen.xend.XendBase import XendBase from xen.xend.XendPIFMetrics import XendPIFMetrics from xen.xend.XendError import * +from xen.xend import Vifctl log = logging.getLogger("xend.XendPIF") log.setLevel(logging.TRACE) @@ -31,6 +32,9 @@ log.setLevel(logging.TRACE) MAC_RE = re.compile(':'.join(['[0-9a-f]{2}'] * 6)) IP_IFACE_RE = re.compile(r'^\d+: (\w+):.*mtu (\d+) .* link/\w+ ([0-9a-f:]+)') + +Vifctl.network('start') + def linux_phy_to_virt(pif_name): return 'eth' + re.sub(r'^[a-z]+', '', pif_name) diff --git a/tools/python/xen/xend/server/SrvServer.py b/tools/python/xen/xend/server/SrvServer.py index 10a09a4c56..95be674da8 100644 --- a/tools/python/xen/xend/server/SrvServer.py +++ b/tools/python/xen/xend/server/SrvServer.py @@ -49,7 +49,6 @@ from threading import Thread from xen.web.httpserver import HttpServer, UnixHttpServer from xen.xend import XendNode, XendOptions, XendAPI -from xen.xend import Vifctl from xen.xend.XendLogging import log from xen.xend.XendClient import XEN_API_SOCKET from xen.xend.XendDomain import instance as xenddomain @@ -101,8 +100,6 @@ class XendServers: if status: fcntl.fcntl(status, fcntl.F_SETFD, fcntl.FD_CLOEXEC) - Vifctl.network('start') - # Prepare to catch SIGTERM (received when 'xend stop' is executed) # and call each server's cleanup if possible signal.signal(signal.SIGTERM, self.cleanup) |