ia64/xen-unstable

changeset 7160:486f1c3e7805

Fix call to XendCheckpoint.restore, since that method no longer needs a
XendDomain instance passed in.

Remove meaningless indirection of imports through web/reactor.py. Tidy import
statements.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Sun Oct 02 18:17:26 2005 +0100 (2005-10-02)
parents 9918d8c3e116
children a73ab0ddf990
files tools/python/xen/xend/server/event.py tools/python/xen/xend/server/relocate.py
line diff
     1.1 --- a/tools/python/xen/web/reactor.py	Fri Sep 30 17:10:52 2005 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,19 +0,0 @@
     1.4 -#============================================================================
     1.5 -# This library is free software; you can redistribute it and/or
     1.6 -# modify it under the terms of version 2.1 of the GNU Lesser General Public
     1.7 -# License as published by the Free Software Foundation.
     1.8 -#
     1.9 -# This library is distributed in the hope that it will be useful,
    1.10 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.11 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.12 -# Lesser General Public License for more details.
    1.13 -#
    1.14 -# You should have received a copy of the GNU Lesser General Public
    1.15 -# License along with this library; if not, write to the Free Software
    1.16 -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.17 -#============================================================================
    1.18 -# Copyright (C) 2005 Mike Wray <mike.wray@hp.com>
    1.19 -#============================================================================
    1.20 -
    1.21 -from unix import listenUNIX, connectUNIX
    1.22 -from tcp import listenTCP, connectTCP, SetCloExec
     2.1 --- a/tools/python/xen/xend/server/event.py	Fri Sep 30 17:10:52 2005 +0100
     2.2 +++ b/tools/python/xen/xend/server/event.py	Sun Oct 02 18:17:26 2005 +0100
     2.3 @@ -13,19 +13,25 @@
     2.4  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     2.5  #============================================================================
     2.6  # Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
     2.7 +# Copyright (C) 2005 XenSource Ltd
     2.8  #============================================================================
     2.9  
    2.10  import sys
    2.11  import StringIO
    2.12  
    2.13 -from xen.web import reactor, protocol
    2.14 +from xen.web import protocol, tcp, unix
    2.15  
    2.16  from xen.xend import scheduler
    2.17  from xen.xend import sxp
    2.18  from xen.xend import PrettyPrint
    2.19 -from xen.xend import EventServer; eserver = EventServer.instance()
    2.20 +from xen.xend import EventServer
    2.21  from xen.xend.XendError import XendError
    2.22 -from xen.xend import XendRoot; xroot = XendRoot.instance()
    2.23 +from xen.xend import XendRoot
    2.24 +
    2.25 +
    2.26 +eserver = EventServer.instance()
    2.27 +xroot = XendRoot.instance()
    2.28 +
    2.29  
    2.30  DEBUG = 0
    2.31  
    2.32 @@ -210,8 +216,8 @@ def listenEvent(daemon):
    2.33      factory = EventFactory(daemon)
    2.34      if xroot.get_xend_unix_server():
    2.35          path = '/var/lib/xend/event-socket'
    2.36 -        reactor.listenUNIX(path, factory)
    2.37 +        unix.listenUNIX(path, factory)
    2.38      if xroot.get_xend_http_server():
    2.39          port = xroot.get_xend_event_port()
    2.40          interface = xroot.get_xend_address()
    2.41 -        reactor.listenTCP(port, factory, interface=interface)
    2.42 +        tcp.listenTCP(port, factory, interface=interface)
     3.1 --- a/tools/python/xen/xend/server/relocate.py	Fri Sep 30 17:10:52 2005 +0100
     3.2 +++ b/tools/python/xen/xend/server/relocate.py	Sun Oct 02 18:17:26 2005 +0100
     3.3 @@ -13,22 +13,28 @@
     3.4  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     3.5  #============================================================================
     3.6  # Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
     3.7 +# Copyright (C) 2005 XenSource Ltd
     3.8  #============================================================================
     3.9  
    3.10  import socket
    3.11  import sys
    3.12  import StringIO
    3.13  
    3.14 -from xen.web import reactor, protocol
    3.15 +from xen.web import protocol, tcp, unix
    3.16  
    3.17  from xen.xend import scheduler
    3.18  from xen.xend import sxp
    3.19 -from xen.xend import EventServer; eserver = EventServer.instance()
    3.20 +from xen.xend import EventServer
    3.21  from xen.xend.XendError import XendError
    3.22 -from xen.xend import XendRoot; xroot = XendRoot.instance()
    3.23 +from xen.xend import XendRoot
    3.24  from xen.xend.XendLogging import log
    3.25  from xen.xend import XendCheckpoint
    3.26  
    3.27 +
    3.28 +eserver = EventServer.instance()
    3.29 +xroot = XendRoot.instance()
    3.30 +
    3.31 +
    3.32  DEBUG = 0
    3.33  
    3.34  class RelocationProtocol(protocol.Protocol):
    3.35 @@ -114,8 +120,7 @@ class RelocationProtocol(protocol.Protoc
    3.36          if self.transport:
    3.37              self.send_reply(["ready", name])
    3.38              self.transport.sock.setblocking(1)
    3.39 -            xd = xroot.get_component("xen.xend.XendDomain")
    3.40 -            XendCheckpoint.restore(xd, self.transport.sock.fileno())
    3.41 +            XendCheckpoint.restore(self.transport.sock.fileno())
    3.42              self.transport.sock.setblocking(0)
    3.43          else:
    3.44              log.error(name + ": no transport")
    3.45 @@ -136,11 +141,11 @@ def listenRelocation():
    3.46      factory = RelocationFactory()
    3.47      if xroot.get_xend_unix_server():
    3.48          path = '/var/lib/xend/relocation-socket'
    3.49 -        reactor.listenUNIX(path, factory)
    3.50 +        unix.listenUNIX(path, factory)
    3.51      if xroot.get_xend_relocation_server():
    3.52          port = xroot.get_xend_relocation_port()
    3.53          interface = xroot.get_xend_relocation_address()
    3.54 -        l = reactor.listenTCP(port, factory, interface=interface)
    3.55 +        l = tcp.listenTCP(port, factory, interface=interface)
    3.56          l.setCloExec()
    3.57  
    3.58  def setupRelocation(dst, port):