[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Network scripts start/stop



Attached a patch.

diff -r 6341a28c8a45 tools/python/xen/xend/XendPIF.py
--- a/tools/python/xen/xend/XendPIF.py  Mon Mar 31 18:08:17 2008 +0100
+++ b/tools/python/xen/xend/XendPIF.py  Sat Apr 05 01:40:20 2008 -0400
@@ -24,16 +24,12 @@ from xen.xend.XendBase import XendBase
 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)

 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 -r 6341a28c8a45 tools/python/xen/xend/server/SrvServer.py
--- a/tools/python/xen/xend/server/SrvServer.py Mon Mar 31 18:08:17 2008 +0100
+++ b/tools/python/xen/xend/server/SrvServer.py Sat Apr 05 01:41:54 2008 -0400
@@ -53,6 +53,7 @@ from xen.xend.XendClient import XEN_API_
 from xen.xend.XendClient import XEN_API_SOCKET
 from xen.xend.XendDomain import instance as xenddomain
 from xen.web.SrvDir import SrvDir
+from xen.xend import Vifctl

 from SrvRoot import SrvRoot
 from XMLRPCServer import XMLRPCServer
@@ -83,6 +84,7 @@ class XendServers:

         # clean up domains for those that have on_xend_stop
         if not reloading:
+            Vifctl.network('stop')
             xenddomain().cleanup_domains()

         self.running = False
@@ -104,6 +106,8 @@ class XendServers:
         # and call each server's cleanup if possible
         signal.signal(signal.SIGTERM, self.cleanup)
         signal.signal(signal.SIGHUP, self.reloadConfig)
+
+        Vifctl.network('start')

         while True:
             threads = []
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.