From: Stefan Berger Subject: [PATCH] [Xend] Do network startup earlier Date: Thu, 26 Jul 2007 11:04:24 -0400 Message-ID: <1185462264.4011.6.camel@gsal-3.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-7eDXWTWHT7srr4EBQY+1" 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 --=-7eDXWTWHT7srr4EBQY+1 Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 --=-7eDXWTWHT7srr4EBQY+1 Content-Disposition: attachment; filename=xend_network_start_early.diff Content-Type: text/x-patch; name=xend_network_start_early.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 @@ -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) Index: root/xen-unstable.hg/tools/python/xen/xend/server/SrvServer.py =================================================================== --- root.orig/xen-unstable.hg/tools/python/xen/xend/server/SrvServer.py +++ root/xen-unstable.hg/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) --=-7eDXWTWHT7srr4EBQY+1 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 --=-7eDXWTWHT7srr4EBQY+1--