Skip to contentSkip to conversation

Network scripts start/stop

DISCUSSION Christopher Thunes 2 participants 4 messages Apr 4, 2008 – Apr 5, 2008

lore
Share & tools
lore
#1 lore raw

Attached a patch.

tools/python/xen/xend/XendPIF.py Sat Apr 05 01:40:20 2008 -0400 renamed from tools/python/xen/xend/XendPIF.py Mon Mar 31 18:08:17 2008 +0100 +0 -4
diff -r 6341a28c8a45 tools/python/xen/xend/XendPIF.py
@@ -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)
tools/python/xen/xend/server/SrvServer.py Sat Apr 05 01:41:54 2008 -0400 renamed from tools/python/xen/xend/server/SrvServer.py Mon Mar 31 18:08:17 2008 +0100 +4 -0
diff -r 6341a28c8a45 tools/python/xen/xend/server/SrvServer.py
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
In reply to Christopher Thunes
Quoted 11 lines · Christopher Thunes

I was poking around with some network scripts for Xen today (3.2-testing)
and noticed that regardless of whether xend start, xend restart, or xend stop was called a 'start' argument was passed on to the network script (network-bridge, network-route, etc.). I can't imagine this is normal behavior and it seems that the only place that these scripts are called is from a global function call in xend/XendPIF.py around line 35 ("Vifctl.network('start')"). I commented this line out and added appropriate calls to Vifctl.network('start') and Vifctl.network('stop') in xend/server/SrvServer.py in the functions cleanup and start. If someone can let me know if this is standard behavior and if not, if there is a better way to fix the problem it would be much appreciated.

The established behaviour is that networking is brought up with xend, and remains up even across xend stops and restarts. Possibly xend stop and restart should not be calling the network scripts at all, but that¹s a pretty minor issue.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

Alright, thanks

- Chris Thunes

Quoted 19 lines · Keir Fraser

On 5/4/08 00:28, "Christopher Thunes" <[email protected]> wrote:

I was poking around with some network scripts for Xen today
(3.2-testing) and noticed that regardless of whether xend start, xend restart, or xend stop was called a 'start' argument was passed on to the network script (network-bridge, network-route, etc.). I can't imagine this is normal behavior and it seems that the only place that these scripts are called is from a global function call in xend/XendPIF.py around line 35 ("Vifctl.network('start')"). I commented this line out and added appropriate calls to Vifctl.network('start') and Vifctl.network('stop') in xend/server/SrvServer.py in the functions cleanup and start. If someone can let me know if this is standard behavior and if not, if there is a better way to fix the problem it would be much appreciated.

The established behaviour is that networking is brought up with xend, and remains up even across xend stops and restarts. Possibly xend stop and restart should not be calling the network scripts at all, but that’s a pretty minor issue.

-- Keir