ia64/xen-unstable

changeset 5002:46777a5b3981

bitkeeper revision 1.1461 (428c649aJ3imCLGJhIeU9ADXW51cWw)

Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into firebug.cl.cam.ac.uk:/local/scratch/cl349/xen-unstable.bk
author cl349@firebug.cl.cam.ac.uk
date Thu May 19 10:04:10 2005 +0000 (2005-05-19)
parents ce73b866361b 29fd5cbbc564
children 76bb150a09da db2dafdbcc68
files tools/python/xen/web/reactor.py tools/python/xen/xend/EventServer.py tools/python/xen/xend/XendMigrate.py tools/python/xen/xend/server/event.py
line diff
     1.1 --- a/tools/python/xen/web/reactor.py	Thu May 19 08:24:43 2005 +0000
     1.2 +++ b/tools/python/xen/web/reactor.py	Thu May 19 10:04:10 2005 +0000
     1.3 @@ -1,9 +1,2 @@
     1.4 -from threading import Timer
     1.5 -
     1.6  from unix import listenUNIX, connectUNIX
     1.7  from tcp import listenTCP, connectTCP
     1.8 -
     1.9 -def callLater(_delay, _fn, *args, **kwds):
    1.10 -    timer = Timer(_delay, _fn, args=args, kwargs=kwds)
    1.11 -    timer.start()
    1.12 -    return timer
     2.1 --- a/tools/python/xen/xend/EventServer.py	Thu May 19 08:24:43 2005 +0000
     2.2 +++ b/tools/python/xen/xend/EventServer.py	Thu May 19 10:04:10 2005 +0000
     2.3 @@ -5,8 +5,7 @@
     2.4  import string
     2.5  from threading import Lock
     2.6  
     2.7 -#from twisted.internet import reactor
     2.8 -from xen.web import reactor
     2.9 +import scheduler
    2.10  
    2.11  # subscribe a.b.c h: map a.b.c -> h
    2.12  # subscribe a.b.* h: map a.b.* -> h
    2.13 @@ -130,7 +129,7 @@ class EventServer:
    2.14              self.lock.release()
    2.15              
    2.16          if async:
    2.17 -            reactor.callLater(0, self.call_handlers, event, val)
    2.18 +            scheduler.now(self.call_handlers, [event, val])
    2.19          else:
    2.20              self.call_handlers(event, val)
    2.21  
     3.1 --- a/tools/python/xen/xend/XendMigrate.py	Thu May 19 08:24:43 2005 +0000
     3.2 +++ b/tools/python/xen/xend/XendMigrate.py	Thu May 19 10:04:10 2005 +0000
     3.3 @@ -12,6 +12,7 @@ import types
     3.4  from xen.web import reactor
     3.5  from xen.web.protocol import Protocol, ClientFactory
     3.6  
     3.7 +import scheduler
     3.8  import sxp
     3.9  import XendDB
    3.10  import EventServer; eserver = EventServer.instance()
    3.11 @@ -120,7 +121,7 @@ class SuspendHandler:
    3.12  
    3.13      def start(self):
    3.14          self.subscribe(on=True)
    3.15 -        timer = reactor.callLater(self.timeout, self.onTimeout)
    3.16 +        timer = scheduler.later(self.timeout, self.onTimeout)
    3.17          try:
    3.18              self.readyCond.acquire()
    3.19              while not self.ready:
     4.1 --- a/tools/python/xen/xend/server/event.py	Thu May 19 08:24:43 2005 +0000
     4.2 +++ b/tools/python/xen/xend/server/event.py	Thu May 19 10:04:10 2005 +0000
     4.3 @@ -3,6 +3,7 @@ import StringIO
     4.4  
     4.5  from xen.web import reactor, protocol
     4.6  
     4.7 +from xen.xend import scheduler
     4.8  from xen.xend import sxp
     4.9  from xen.xend import PrettyPrint
    4.10  from xen.xend import EventServer; eserver = EventServer.instance()
    4.11 @@ -47,7 +48,7 @@ class EventProtocol(protocol.Protocol):
    4.12          if self.transport:
    4.13              self.transport.loseConnection()
    4.14          if self.connected:
    4.15 -            reactor.callLater(0, self.connectionLost)
    4.16 +            scheduler.now(self.connectionLost)
    4.17  
    4.18      def connectionLost(self, reason=None):
    4.19          self.unsubscribe()