ia64/xen-unstable

changeset 15655:f035c4d9880a

[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>
author kfraser@localhost.localdomain
date Fri Jul 27 09:04:35 2007 +0100 (2007-07-27)
parents 68f0e623f6b0
children e63b331d8698
files tools/python/xen/xend/XendPIF.py tools/python/xen/xend/server/SrvServer.py
line diff
     1.1 --- a/tools/python/xen/xend/XendPIF.py	Fri Jul 27 09:03:35 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendPIF.py	Fri Jul 27 09:04:35 2007 +0100
     1.3 @@ -24,6 +24,7 @@ from xen.xend import XendAPIStore
     1.4  from xen.xend.XendBase import XendBase
     1.5  from xen.xend.XendPIFMetrics import XendPIFMetrics
     1.6  from xen.xend.XendError import *
     1.7 +from xen.xend import Vifctl
     1.8  
     1.9  log = logging.getLogger("xend.XendPIF")
    1.10  log.setLevel(logging.TRACE)
    1.11 @@ -31,6 +32,9 @@ log.setLevel(logging.TRACE)
    1.12  MAC_RE = re.compile(':'.join(['[0-9a-f]{2}'] * 6))
    1.13  IP_IFACE_RE = re.compile(r'^\d+: (\w+):.*mtu (\d+) .* link/\w+ ([0-9a-f:]+)')
    1.14  
    1.15 +
    1.16 +Vifctl.network('start')
    1.17 +
    1.18  def linux_phy_to_virt(pif_name):
    1.19      return 'eth' + re.sub(r'^[a-z]+', '', pif_name)
    1.20  
     2.1 --- a/tools/python/xen/xend/server/SrvServer.py	Fri Jul 27 09:03:35 2007 +0100
     2.2 +++ b/tools/python/xen/xend/server/SrvServer.py	Fri Jul 27 09:04:35 2007 +0100
     2.3 @@ -49,7 +49,6 @@ from threading import Thread
     2.4  from xen.web.httpserver import HttpServer, UnixHttpServer
     2.5  
     2.6  from xen.xend import XendNode, XendOptions, XendAPI
     2.7 -from xen.xend import Vifctl
     2.8  from xen.xend.XendLogging import log
     2.9  from xen.xend.XendClient import XEN_API_SOCKET
    2.10  from xen.xend.XendDomain import instance as xenddomain
    2.11 @@ -101,8 +100,6 @@ class XendServers:
    2.12          if status:
    2.13              fcntl.fcntl(status, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
    2.14          
    2.15 -        Vifctl.network('start')
    2.16 -
    2.17          # Prepare to catch SIGTERM (received when 'xend stop' is executed)
    2.18          # and call each server's cleanup if possible
    2.19          signal.signal(signal.SIGTERM, self.cleanup)