ia64/xen-unstable
changeset 6886:3233e7ecfa9f
merge?
line diff
138.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32 Wed Sep 14 18:00:23 2005 -0600 138.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32 Thu Sep 15 07:38:53 2005 +0000 138.3 @@ -372,7 +372,7 @@ CONFIG_PNP=y 138.4 # 138.5 CONFIG_ISAPNP=y 138.6 # CONFIG_PNPBIOS is not set 138.7 -CONFIG_PNPACPI=y 138.8 +# CONFIG_PNPACPI is not set 138.9 138.10 # 138.11 # Block devices
352.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h Wed Sep 14 18:00:23 2005 -0600 352.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h Thu Sep 15 07:38:53 2005 +0000 352.3 @@ -35,7 +35,7 @@ static inline void __prepare_arch_switch 352.4 * of cr3/ldt (i.e., not in __switch_to). 352.5 */ 352.6 __asm__ __volatile__ ( 352.7 - "movl %%es,%0 ; movl %%ds,%1 ; movl %%fs,%2 ; movl %%gs,%3" 352.8 + "mov %%es,%0 ; mov %%ds,%1 ; mov %%fs,%2 ; mov %%gs,%3" 352.9 : "=m" (current->thread.es), 352.10 "=m" (current->thread.ds), 352.11 "=m" (current->thread.fsindex),
535.1 --- a/tools/misc/xend Wed Sep 14 18:00:23 2005 -0600 535.2 +++ b/tools/misc/xend Thu Sep 15 07:38:53 2005 +0000 535.3 @@ -86,9 +86,6 @@ def main(): 535.4 daemon = SrvDaemon.instance() 535.5 if not sys.argv[1:]: 535.6 print 'usage: %s {start|stop|restart}' % sys.argv[0] 535.7 - elif os.fork(): 535.8 - pid, status = os.wait() 535.9 - return status >> 8 535.10 elif sys.argv[1] == 'start': 535.11 start_xenstored() 535.12 start_consoled()
540.1 --- a/tools/python/xen/lowlevel/xc/xc.c Wed Sep 14 18:00:23 2005 -0600 540.2 +++ b/tools/python/xen/lowlevel/xc/xc.c Thu Sep 15 07:38:53 2005 +0000 540.3 @@ -220,6 +220,9 @@ static PyObject *pyxc_domain_getinfo(PyO 540.4 return PyErr_NoMemory(); 540.5 540.6 nr_doms = xc_domain_getinfo(xc->xc_handle, first_dom, max_doms, info); 540.7 + 540.8 + if (nr_doms < 0) 540.9 + return PyErr_SetFromErrno(xc_error); 540.10 540.11 list = PyList_New(nr_doms); 540.12 for ( i = 0 ; i < nr_doms; i++ )
557.1 --- a/tools/python/xen/web/httpserver.py Wed Sep 14 18:00:23 2005 -0600 557.2 +++ b/tools/python/xen/web/httpserver.py Thu Sep 15 07:38:53 2005 +0000 557.3 @@ -273,6 +273,9 @@ class HttpServer: 557.4 self.interface = interface 557.5 self.port = port 557.6 self.root = root 557.7 + # ready indicates when we are ready to begin accept connections 557.8 + # it should be set after a successful bind 557.9 + self.ready = False 557.10 557.11 def getRoot(self): 557.12 return self.root 557.13 @@ -283,6 +286,7 @@ class HttpServer: 557.14 def run(self): 557.15 self.bind() 557.16 self.listen() 557.17 + self.ready = True 557.18 self.requestLoop() 557.19 557.20 def stop(self):
562.1 --- a/tools/python/xen/web/tcp.py Wed Sep 14 18:00:23 2005 -0600 562.2 +++ b/tools/python/xen/web/tcp.py Thu Sep 15 07:38:53 2005 +0000 562.3 @@ -18,6 +18,7 @@ 562.4 import sys 562.5 import socket 562.6 import types 562.7 +import time 562.8 562.9 from connection import * 562.10 from protocol import * 562.11 @@ -35,8 +36,25 @@ class TCPListener(SocketListener): 562.12 def createSocket(self): 562.13 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 562.14 sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) 562.15 - addr = (self.interface, self.port) 562.16 - sock.bind(addr) 562.17 + 562.18 + # SO_REUSEADDR does not always ensure that we do not get an address 562.19 + # in use error when restarted quickly 562.20 + # we implement a timeout to try and avoid failing unnecessarily 562.21 + 562.22 + timeout = time.time() + 30 562.23 + again = True 562.24 + while again and time.time() < timeout: 562.25 + again = False 562.26 + try: 562.27 + sock.bind((self.interface, self.port)) 562.28 + except socket.error, (errno, strerrno): 562.29 + if errno == 98: 562.30 + again = True 562.31 + else: 562.32 + raise socket.error(errno, strerrno) 562.33 + if again: 562.34 + raise socket.error(98, "address in use") 562.35 + 562.36 return sock 562.37 562.38 def acceptConnection(self, sock, protocol, addr):
573.1 --- a/tools/python/xen/xend/XendDomainInfo.py Wed Sep 14 18:00:23 2005 -0600 573.2 +++ b/tools/python/xen/xend/XendDomainInfo.py Thu Sep 15 07:38:53 2005 +0000 573.3 @@ -110,9 +110,13 @@ def dom_get(dom): 573.4 @param dom: domain id 573.5 @return: info or None 573.6 """ 573.7 - domlist = xc.domain_getinfo(dom, 1) 573.8 - if domlist and dom == domlist[0]['dom']: 573.9 - return domlist[0] 573.10 + try: 573.11 + domlist = xc.domain_getinfo(dom, 1) 573.12 + if domlist and dom == domlist[0]['dom']: 573.13 + return domlist[0] 573.14 + except Exception, err: 573.15 + # ignore missing domain 573.16 + log.exception("domain_getinfo(%d) failed, ignoring", dom) 573.17 return None 573.18 573.19 class XendDomainInfo: 573.20 @@ -349,7 +353,12 @@ class XendDomainInfo: 573.21 def update(self, info=None): 573.22 """Update with info from xc.domain_getinfo(). 573.23 """ 573.24 - self.info = info or dom_get(self.domid) 573.25 + if info: 573.26 + self.info = info 573.27 + else: 573.28 + di = dom_get(self.domid) 573.29 + if not di: 573.30 + return 573.31 self.memory = self.info['mem_kb'] / 1024 573.32 self.ssidref = self.info['ssidref'] 573.33
583.1 --- a/tools/python/xen/xend/server/SrvDaemon.py Wed Sep 14 18:00:23 2005 -0600 583.2 +++ b/tools/python/xen/xend/server/SrvDaemon.py Thu Sep 15 07:38:53 2005 +0000 583.3 @@ -137,13 +137,6 @@ class Daemon: 583.4 else: 583.5 return 0 583.6 583.7 - def onSIGCHLD(self, signum, frame): 583.8 - if self.child > 0: 583.9 - try: 583.10 - pid, sts = os.waitpid(self.child, os.WNOHANG) 583.11 - except os.error, ex: 583.12 - pass 583.13 - 583.14 def fork_pid(self, pidfile): 583.15 """Fork and write the pid of the child to 'pidfile'. 583.16 583.17 @@ -200,15 +193,29 @@ class Daemon: 583.18 # Trying to run an already-running service is a success. 583.19 return 0 583.20 583.21 - signal.signal(signal.SIGCHLD, self.onSIGCHLD) 583.22 + ret = 0 583.23 + 583.24 + # we use a pipe to communicate between the parent and the child process 583.25 + # this way we know when the child has actually initialized itself so 583.26 + # we can avoid a race condition during startup 583.27 + 583.28 + r,w = os.pipe() 583.29 if self.fork_pid(XEND_PID_FILE): 583.30 - #Parent. Sleep to give child time to start. 583.31 - time.sleep(1) 583.32 + os.close(w) 583.33 + r = os.fdopen(r, 'r') 583.34 + s = r.read() 583.35 + r.close() 583.36 + if not len(s): 583.37 + ret = 1 583.38 + else: 583.39 + ret = int(s) 583.40 else: 583.41 + os.close(r) 583.42 # Child 583.43 self.tracing(trace) 583.44 - self.run() 583.45 - return 0 583.46 + self.run(os.fdopen(w, 'w')) 583.47 + 583.48 + return ret 583.49 583.50 def tracing(self, traceon): 583.51 """Turn tracing on or off. 583.52 @@ -290,7 +297,7 @@ class Daemon: 583.53 def stop(self): 583.54 return self.cleanup(kill=True) 583.55 583.56 - def run(self): 583.57 + def run(self, status): 583.58 _enforce_dom0_cpus() 583.59 try: 583.60 log.info("Xend Daemon started") 583.61 @@ -298,12 +305,14 @@ class Daemon: 583.62 relocate.listenRelocation() 583.63 servers = SrvServer.create() 583.64 self.daemonize() 583.65 - servers.start() 583.66 + servers.start(status) 583.67 except Exception, ex: 583.68 print >>sys.stderr, 'Exception starting xend:', ex 583.69 if XEND_DEBUG: 583.70 traceback.print_exc() 583.71 log.exception("Exception starting xend (%s)" % ex) 583.72 + status.write('1') 583.73 + status.close() 583.74 self.exit(1) 583.75 583.76 def exit(self, rc=0):
589.1 --- a/tools/python/xen/xend/server/SrvServer.py Wed Sep 14 18:00:23 2005 -0600 589.2 +++ b/tools/python/xen/xend/server/SrvServer.py Thu Sep 15 07:38:53 2005 +0000 589.3 @@ -48,6 +48,7 @@ from xen.xend import XendRoot; xroot = X 589.4 from xen.xend import Vifctl 589.5 from xen.xend.XendLogging import log 589.6 from xen.web.SrvDir import SrvDir 589.7 +import time 589.8 589.9 from SrvRoot import SrvRoot 589.10 589.11 @@ -59,7 +60,7 @@ class XendServers: 589.12 def add(self, server): 589.13 self.servers.append(server) 589.14 589.15 - def start(self): 589.16 + def start(self, status): 589.17 Vifctl.network('start') 589.18 threads = [] 589.19 for server in self.servers: 589.20 @@ -67,6 +68,25 @@ class XendServers: 589.21 thread.start() 589.22 threads.append(thread) 589.23 589.24 + 589.25 + # check for when all threads have initialized themselves and then 589.26 + # close the status pipe 589.27 + 589.28 + threads_left = True 589.29 + while threads_left: 589.30 + threads_left = False 589.31 + 589.32 + for server in self.servers: 589.33 + if not server.ready: 589.34 + threads_left = True 589.35 + break 589.36 + 589.37 + if threads_left: 589.38 + time.sleep(.5) 589.39 + 589.40 + status.write('0') 589.41 + status.close() 589.42 + 589.43 for t in threads: 589.44 t.join() 589.45