ia64/xen-unstable

changeset 1719:430a2d09d6ad

bitkeeper revision 1.1051 (40ed377bW0cMKaeeMSXfQOknw3iMaw)

Documentation.
author mjw@wray-m-3.hpl.hp.com
date Thu Jul 08 12:00:59 2004 +0000 (2004-07-08)
parents 98bb9542a5bc
children 06e9774f9633
files tools/python/xen/xend/server/blkif.py tools/python/xen/xend/server/channel.py tools/python/xen/xend/server/controller.py
line diff
     1.1 --- a/tools/python/xen/xend/server/blkif.py	Thu Jul 08 11:57:55 2004 +0000
     1.2 +++ b/tools/python/xen/xend/server/blkif.py	Thu Jul 08 12:00:59 2004 +0000
     1.3 @@ -29,8 +29,12 @@ class BlkifControllerFactory(controller.
     1.4      def createInstance(self, dom, recreate=0):
     1.5          """Create a block device controller for a domain.
     1.6  
     1.7 -        dom      domain
     1.8 -        recreate if true it's a recreate (after xend restart)
     1.9 +        @param dom: domain
    1.10 +        @type  dom: int
    1.11 +        @param recreate: if true it's a recreate (after xend restart)
    1.12 +        @type  recreate: bool
    1.13 +        @return: deferred
    1.14 +        @rtype: twisted.internet.defer.Deferred
    1.15          """
    1.16          d = defer.Deferred()
    1.17          blkif = self.getInstanceByDom(dom)
    1.18 @@ -51,9 +55,10 @@ class BlkifControllerFactory(controller.
    1.19      def getDomainDevices(self, dom):
    1.20          """Get the block devices for a domain.
    1.21  
    1.22 -        dom domain
    1.23 -
    1.24 -        returns devices
    1.25 +        @param dom: domain
    1.26 +        @type  dom: int
    1.27 +        @return: devices
    1.28 +        @rtype:  [device]
    1.29          """
    1.30          blkif = self.getInstanceByDom(dom)
    1.31          return (blkif and blkif.getDevices()) or []
    1.32 @@ -61,10 +66,12 @@ class BlkifControllerFactory(controller.
    1.33      def getDomainDevice(self, dom, vdev):
    1.34          """Get a block device from a domain.
    1.35  
    1.36 -        dom  domain
    1.37 -        vdev device index
    1.38 -
    1.39 -        returns device
    1.40 +        @param dom: domain
    1.41 +        @type  dom: int
    1.42 +        @param vdev: device index
    1.43 +        @type  vedv: int
    1.44 +        @return: device
    1.45 +        @rtype:  device
    1.46          """
    1.47          blkif = self.getInstanceByDom(dom)
    1.48          return (blkif and blkif.getDevice(vdev)) or None
    1.49 @@ -72,8 +79,10 @@ class BlkifControllerFactory(controller.
    1.50      def setControlDomain(self, dom, recreate=0):
    1.51          """Set the back-end block device controller domain.
    1.52  
    1.53 -        dom      domain
    1.54 -        recreate if true it's a recreate (after xend restart)
    1.55 +        @param dom: domain
    1.56 +        @type  dom: int
    1.57 +        @param recreate: if true it's a recreate (after xend restart)
    1.58 +        @type  recreate: int
    1.59          """
    1.60          if self.dom == dom: return
    1.61          self.deregisterChannel()
    1.62 @@ -84,14 +93,19 @@ class BlkifControllerFactory(controller.
    1.63  
    1.64      def getControlDomain(self):
    1.65          """Get the back-end block device controller domain.
    1.66 +
    1.67 +        @return: domain
    1.68 +        @rtype:  int
    1.69          """
    1.70          return self.dom
    1.71  
    1.72      def reattachDevice(self, dom, vdev):
    1.73          """Reattach a device (on changing control domain).
    1.74  
    1.75 -        dom  domain
    1.76 -        vdev device index
    1.77 +        @param dom: domain
    1.78 +        @type  dom: int
    1.79 +        @param vdev: device index
    1.80 +        @type  vdev: int
    1.81          """
    1.82          blkif = self.getInstanceByDom(dom)
    1.83          if blkif:
    1.84 @@ -102,6 +116,9 @@ class BlkifControllerFactory(controller.
    1.85  
    1.86      def devicesAttached(self):
    1.87          """Check if all devices are attached.
    1.88 +
    1.89 +        @return: true if all devices attached
    1.90 +        @rtype:  bool
    1.91          """
    1.92          attached = 1
    1.93          for blkif in self.getInstances():
    1.94 @@ -111,19 +128,32 @@ class BlkifControllerFactory(controller.
    1.95          return attached
    1.96                           
    1.97      def reattached(self):
    1.98 -        """Notify all block interface we have been reattached
    1.99 +        """Notify all block interfaces we have been reattached
   1.100          (after changing control domain).
   1.101          """
   1.102          for blkif in self.getInstances():
   1.103              blkif.reattached()
   1.104  
   1.105      def respond_be_create(self, msg, d):
   1.106 +        """Response handler for a be_create message.
   1.107 +        Calls I{d} with the block interface created.
   1.108 +
   1.109 +        @param msg: message
   1.110 +        @type  msg: xu message
   1.111 +        @param d: deferred to call
   1.112 +        @type  d: Deferred
   1.113 +        """
   1.114          print 'respond_be_create>'
   1.115          val = unpackMsg('blkif_be_create_t', msg)
   1.116          blkif = self.getInstanceByDom(val['domid'])
   1.117          d.callback(blkif)
   1.118      
   1.119      def respond_be_connect(self, msg):
   1.120 +        """Response handler for a be_connect message.
   1.121 +
   1.122 +        @param msg: message
   1.123 +        @type  msg: xu message
   1.124 +        """
   1.125          print 'respond_be_connect>', self
   1.126          val = unpackMsg('blkif_be_connect_t', msg)
   1.127          blkif = self.getInstanceByDom(val['domid'])
   1.128 @@ -133,6 +163,15 @@ class BlkifControllerFactory(controller.
   1.129              pass
   1.130      
   1.131      def respond_be_vbd_create(self, msg, d):
   1.132 +        """Response handler for a be_vbd_create message.
   1.133 +        Tries to grow the vbd, and passes the deferred I{d} on for
   1.134 +        the grow to call.
   1.135 +
   1.136 +        @param msg: message
   1.137 +        @type  msg: xu message
   1.138 +        @param d: deferred to call
   1.139 +        @type  d: Deferred
   1.140 +        """
   1.141          print 'recv_be_vbd_create>', self
   1.142          val = unpackMsg('blkif_be_vbd_create_t', msg)
   1.143          blkif = self.getInstanceByDom(val['domid'])
   1.144 @@ -145,6 +184,13 @@ class BlkifControllerFactory(controller.
   1.145              pass
   1.146      
   1.147      def respond_be_vbd_grow(self, msg, d):
   1.148 +        """Response handler for a be_vbd_grow message.
   1.149 +
   1.150 +        @param msg: message
   1.151 +        @type  msg: xu message
   1.152 +        @param d: deferred to call
   1.153 +        @type  d: Deferred or None
   1.154 +        """
   1.155          print 'recv_be_vbd_grow>', self
   1.156          val = unpackMsg('blkif_be_vbd_grow_t', msg)
   1.157          # Check status?
   1.158 @@ -155,6 +201,13 @@ class BlkifControllerFactory(controller.
   1.159              self.reattachDevice(val['domid'], val['vdevice'])
   1.160  
   1.161      def recv_be_driver_status_changed(self, msg, req):
   1.162 +        """Request handler for be_driver_status_changed messages.
   1.163 +        
   1.164 +        @param msg: message
   1.165 +        @type  msg: xu message
   1.166 +        @param req: request flag (true if the msg is a request)
   1.167 +        @type  req: bool
   1.168 +        """
   1.169          print 'recv_be_driver_status_changed>', self, req
   1.170          val = unpackMsg('blkif_be_driver_status_changed_t', msg)
   1.171          status = val['status']
   1.172 @@ -222,6 +275,17 @@ class BlkifController(controller.Control
   1.173          return self.devices.get(vdev)
   1.174  
   1.175      def addDevice(self, vdev, mode, segment):
   1.176 +        """Add a device to the device table.
   1.177 +
   1.178 +        @param vdev:     device index
   1.179 +        @type  vdev:     int
   1.180 +        @param mode:     read/write mode
   1.181 +        @type  mode:     string
   1.182 +        @param segment:  segment
   1.183 +        @type  segment:  int
   1.184 +        @return: device
   1.185 +        @rtype:  BlkDev
   1.186 +        """
   1.187          if vdev in self.devices: return None
   1.188          dev = BlkDev(self, vdev, mode, segment)
   1.189          self.devices[vdev] = dev
   1.190 @@ -230,12 +294,16 @@ class BlkifController(controller.Control
   1.191      def attachDevice(self, vdev, mode, segment, recreate=0):
   1.192          """Attach a device to the specified interface.
   1.193  
   1.194 -        vdev     device index
   1.195 -        mode     read/write mode
   1.196 -        segment  segment
   1.197 -        recreate if true it's being recreated (after xend restart)
   1.198 -
   1.199 -        returns deferred
   1.200 +        @param vdev:     device index
   1.201 +        @type  vdev:     int
   1.202 +        @param mode:     read/write mode
   1.203 +        @type  mode:     string
   1.204 +        @param segment:  segment
   1.205 +        @type  segment:  int
   1.206 +        @param recreate: if true it's being recreated (after xend restart)
   1.207 +        @type  recreate: bool
   1.208 +        @return: deferred
   1.209 +        @rtype:  Deferred
   1.210          """
   1.211          dev = self.addDevice(vdev, mode, segment)
   1.212          if not dev: return -1
     2.1 --- a/tools/python/xen/xend/server/channel.py	Thu Jul 08 11:57:55 2004 +0000
     2.2 +++ b/tools/python/xen/xend/server/channel.py	Thu Jul 08 12:00:59 2004 +0000
     2.3 @@ -2,7 +2,7 @@
     2.4  
     2.5  import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
     2.6  from xen.lowlevel import xu
     2.7 -from messages import msgTypeName
     2.8 +from messages import msgTypeName, printMsg
     2.9  
    2.10  VIRQ_MISDIRECT  = 0  # Catch-all interrupt for unbound VIRQs.
    2.11  VIRQ_TIMER      = 1  # Timebase update, and/or requested timeout.
    2.12 @@ -222,12 +222,18 @@ class Channel(BaseChannel):
    2.13  
    2.14      def getLocalPort(self):
    2.15          """Get the local port.
    2.16 +
    2.17 +        @return: local port
    2.18 +        @rtype:  int
    2.19          """
    2.20          if self.closed: return -1
    2.21          return self.port.local_port
    2.22  
    2.23      def getRemotePort(self):
    2.24          """Get the remote port.
    2.25 +
    2.26 +        @return: remote port
    2.27 +        @rtype:  int
    2.28          """
    2.29          if self.closed: return -1
    2.30          return self.port.remote_port
    2.31 @@ -248,8 +254,9 @@ class Channel(BaseChannel):
    2.32      def registerDevice(self, types, dev):
    2.33          """Register a device controller.
    2.34  
    2.35 -        @param types message types the controller handles
    2.36 -        @param dev   device controller
    2.37 +        @param types: message types the controller handles
    2.38 +        @type  types: array of ints
    2.39 +        @param dev:   device controller
    2.40          """
    2.41          if self.closed: return
    2.42          self.devs.append(dev)
    2.43 @@ -259,7 +266,7 @@ class Channel(BaseChannel):
    2.44      def deregisterDevice(self, dev):
    2.45          """Remove the registration for a device controller.
    2.46  
    2.47 -        @param dev device controller
    2.48 +        @param dev: device controller
    2.49          """
    2.50          if dev in self.devs:
    2.51              self.devs.remove(dev)
    2.52 @@ -270,13 +277,20 @@ class Channel(BaseChannel):
    2.53      def getDevice(self, type):
    2.54          """Get the device controller handling a message type.
    2.55  
    2.56 -        @param type message type
    2.57 -        @returns controller or None
    2.58 +        @param type: message type
    2.59 +        @type  type: int
    2.60 +        @return: controller or None
    2.61 +        @rtype:  device controller
    2.62          """
    2.63          return self.devs_by_type.get(type)
    2.64  
    2.65      def getMessageType(self, msg):
    2.66          """Get a 2-tuple of the message type and subtype.
    2.67 +
    2.68 +        @param msg: message
    2.69 +        @type  msg: xu message
    2.70 +        @return: type info
    2.71 +        @rtype:  (int, int)
    2.72          """
    2.73          hdr = msg.get_header()
    2.74          return (hdr['type'], hdr.get('subtype'))
     3.1 --- a/tools/python/xen/xend/server/controller.py	Thu Jul 08 11:57:55 2004 +0000
     3.2 +++ b/tools/python/xen/xend/server/controller.py	Thu Jul 08 12:00:59 2004 +0000
     3.3 @@ -1,53 +1,80 @@
     3.4  # Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
     3.5 +"""General support for controllers, which handle devices
     3.6 +for a domain.
     3.7 +"""
     3.8  
     3.9  from twisted.internet import defer
    3.10  defer.Deferred.debug = 1
    3.11  
    3.12  import channel
    3.13 -from messages import msgTypeName
    3.14 +from messages import msgTypeName, printMsg
    3.15  
    3.16 -DEBUG=0
    3.17 +DEBUG = 0
    3.18  
    3.19  class OutOfOrderError(RuntimeError):
    3.20 -    """Error reported when a response arrives out of order.
    3.21 +    """Error reported when a response message arrives out of order.
    3.22      """
    3.23      pass
    3.24  
    3.25  class Responder:
    3.26 -    """Handler for a response to a message.
    3.27 +    """Handler for a response to a message with a specified id.
    3.28      """
    3.29  
    3.30      def __init__(self, mid, deferred):
    3.31          """Create a responder.
    3.32  
    3.33 -        mid      message id of response to handle
    3.34 -        deferred deferred object holding the callbacks
    3.35 +        @param mid: message id of response to handle
    3.36 +        @type  mid: int
    3.37 +        @param deferred: deferred object holding the callbacks
    3.38 +        @type  deferred: Deferred
    3.39          """
    3.40          self.mid = mid
    3.41          self.deferred = deferred
    3.42  
    3.43      def responseReceived(self, msg):
    3.44 +        """Entry point called when a response message with the right id arrives.
    3.45 +        Calls callback on I{self.deferred} with the message.
    3.46 +
    3.47 +        @param msg: response message
    3.48 +        @type  msg: xu message
    3.49 +        """
    3.50          if self.deferred.called: return
    3.51          self.deferred.callback(msg)
    3.52  
    3.53      def error(self, err):
    3.54 +        """Entry point called when there has been an error.
    3.55 +        Calls errback on I{self.deferred} with the error.
    3.56 +
    3.57 +        @param err: error
    3.58 +        @type  err: Exception
    3.59 +        """
    3.60          if self.deferred.called: return
    3.61          self.deferred.errback(err)
    3.62  
    3.63  class CtrlMsgRcvr:
    3.64      """Abstract class for things that deal with a control interface to a domain.
    3.65 -
    3.66 -    Instance variables:
    3.67 +    Once I{registerChannel} has been called, our message types are registered
    3.68 +    with the channel to the domain. The channel will call I{requestReceived}
    3.69 +    when a request arrives, or I{responseReceived} when a response arrives,
    3.70 +    if they have one of our message types.
    3.71  
    3.72 -    dom       : the domain we are a control interface for
    3.73 -    majorTypes: list of major message types we are interested in
    3.74 -    subTypes  : mapping of message subtypes to methods
    3.75 +    @ivar dom: the domain we are a control interface for
    3.76 +    @type dom: int
    3.77 +    @ivar majorTypes: major message types we are interested in
    3.78 +    @type majorTypes: [int]
    3.79 +    @ivar subTypes: mapping of message subtypes to methods
    3.80 +    @ivar subTypes: {int:method}
    3.81 +    @ivar timeout: timeout (in seconds) for message handlers
    3.82 +    @type timeout: int
    3.83      
    3.84 -    channel   : channel to the domain
    3.85 -    idx       : channel index
    3.86 +    @ivar channel: channel to the domain
    3.87 +    @type channel: Channel
    3.88 +    @ivar idx: channel index
    3.89 +    @ivar idx: string
    3.90 +    @ivar responders: table of message response handlers
    3.91 +    @type responders: {int:Responder}
    3.92      """
    3.93  
    3.94 -
    3.95      def __init__(self):
    3.96          self.channelFactory = channel.channelFactory()
    3.97          self.majorTypes = [ ]
    3.98 @@ -56,22 +83,25 @@ class CtrlMsgRcvr:
    3.99          self.channel = None
   3.100          self.idx = None
   3.101          self.responders = []
   3.102 -        # Timeout (in seconds) for deferreds.
   3.103          self.timeout = 10
   3.104  
   3.105      def setTimeout(self, timeout):
   3.106          self.timeout = timeout
   3.107  
   3.108      def requestReceived(self, msg, type, subtype):
   3.109 -        """Dispatch a request to handlers.
   3.110 +        """Dispatch a request message to handlers.
   3.111 +        Called by the channel for requests with one of our types.
   3.112  
   3.113 -        msg     message
   3.114 -        type    major message type
   3.115 -        subtype minor message type
   3.116 +        @param msg:     message
   3.117 +        @type  msg:     xu message
   3.118 +        @param type:    major message type
   3.119 +        @type  type:    int
   3.120 +        @param subtype: minor message type
   3.121 +        @type  subtype: int
   3.122          """
   3.123 -        msgid = msg.get_header()['id']
   3.124          if DEBUG:
   3.125 -            print 'requestReceived>', self, msgid, msgTypeName(type, subtype)
   3.126 +            print 'requestReceived>',
   3.127 +            printMsg(msg, all=1)
   3.128          method = self.subTypes.get(subtype)
   3.129          if method:
   3.130              method(msg, 1)
   3.131 @@ -81,14 +111,23 @@ class CtrlMsgRcvr:
   3.132          
   3.133      def responseReceived(self, msg, type, subtype):
   3.134          """Dispatch a response to handlers.
   3.135 +        Called by the channel for responses with one of our types.
   3.136 +        
   3.137 +        First looks for a message responder for the message's id.
   3.138 +        See L{callResponders}, L{addResponder}.
   3.139 +        If there is no responder, looks for a message handler for
   3.140 +        the message type/subtype.
   3.141  
   3.142 -        msg     message
   3.143 -        type    major message type
   3.144 -        subtype minor message type
   3.145 +        @param msg:     message
   3.146 +        @type  msg:     xu message
   3.147 +        @param type:    major message type
   3.148 +        @type  type:    int
   3.149 +        @param subtype: minor message type
   3.150 +        @type  subtype: int
   3.151          """
   3.152 -        msgid = msg.get_header()['id']
   3.153          if DEBUG:
   3.154 -            print 'responseReceived>', self, msgid, msgTypeName(type, subtype)
   3.155 +            print 'responseReceived>',
   3.156 +            printMsg(msg, all=1)
   3.157          if self.callResponders(msg):
   3.158              return
   3.159          method = self.subTypes.get(subtype)
   3.160 @@ -100,16 +139,21 @@ class CtrlMsgRcvr:
   3.161  
   3.162      def addResponder(self, mid, deferred):
   3.163          """Add a responder for a message id.
   3.164 -        The deferred is called with callback(msg) when a response
   3.165 -        with the given message id arrives. Responses are expected
   3.166 +        The I{deferred} is called with callback(msg) when a response
   3.167 +        with message id I{mid} arrives. Responses are expected
   3.168          to arrive in order of message id. When a response arrives,
   3.169          waiting responders for messages with lower id have errback
   3.170          called with an OutOfOrder error.
   3.171  
   3.172 -        mid      message id of response expected
   3.173 -        deferred a Deferred to handle the response
   3.174 +        Responders have a timeout set and I{deferred} will error
   3.175 +        on expiry.
   3.176  
   3.177 -        returns Responder
   3.178 +        @param mid:      message id of response expected
   3.179 +        @type  mid:      int
   3.180 +        @param deferred: handler for the response
   3.181 +        @type  deferred: Deferred
   3.182 +        @return: responder
   3.183 +        @rtype:  Responder
   3.184          """
   3.185          if self.timeout > 0:
   3.186              deferred.setTimeout(self.timeout)
   3.187 @@ -119,10 +163,13 @@ class CtrlMsgRcvr:
   3.188  
   3.189      def callResponders(self, msg):
   3.190          """Call any waiting responders for a response message.
   3.191 +        Looks for a responder registered for the message's id.
   3.192 +        See L{addResponder}.
   3.193  
   3.194 -        msg     response message
   3.195 -        
   3.196 -        returns 1 if there was a responder for the message, 0 otherwise
   3.197 +        @param msg: response message
   3.198 +        @type  msg: xu message
   3.199 +        @return: 1 if there was a responder for the message, 0 otherwise
   3.200 +        @rtype : bool
   3.201          """
   3.202          hdr = msg.get_header()
   3.203          mid = hdr['id']
   3.204 @@ -133,7 +180,7 @@ class CtrlMsgRcvr:
   3.205                  break
   3.206              self.responders.pop()
   3.207              if resp.mid < mid:
   3.208 -                print 'handleResponse> Out of order:', resp.mid, mid
   3.209 +                print 'callResponders> Out of order:', resp.mid, mid
   3.210                  resp.error(OutOfOrderError())
   3.211              else:
   3.212                  handled = 1
   3.213 @@ -148,7 +195,8 @@ class CtrlMsgRcvr:
   3.214      
   3.215      def registerChannel(self):
   3.216          """Register interest in our major message types with the
   3.217 -        channel to our domain.
   3.218 +        channel to our domain. Once we have registered, the channel
   3.219 +        will call requestReceived or responseReceived for our messages.
   3.220          """
   3.221          self.channel = self.channelFactory.domChannel(self.dom)
   3.222          self.idx = self.channel.getIndex()
   3.223 @@ -157,7 +205,8 @@ class CtrlMsgRcvr:
   3.224          
   3.225      def deregisterChannel(self):
   3.226          """Deregister interest in our major message types with the
   3.227 -        channel to our domain.
   3.228 +        channel to our domain. After this the channel won't call
   3.229 +        us any more.
   3.230          """
   3.231          if self.channel:
   3.232              self.channel.deregisterDevice(self)
   3.233 @@ -166,18 +215,23 @@ class CtrlMsgRcvr:
   3.234      def produceRequests(self):
   3.235          """Produce any queued requests.
   3.236  
   3.237 -        return number produced
   3.238 +        @return: number produced
   3.239 +        @rtype:  int
   3.240          """
   3.241          return 0
   3.242  
   3.243      def writeRequest(self, msg, response=None):
   3.244          """Write a request to the channel.
   3.245  
   3.246 -        msg      message
   3.247 -        response Deferred to handle the response (optional)
   3.248 +        @param msg:      request message
   3.249 +        @type  msg:      xu message
   3.250 +        @param response: response handler
   3.251 +        @type  response: Deferred
   3.252          """
   3.253          if self.channel:
   3.254 -            if DEBUG: print 'CtrlMsgRcvr>writeRequest>', self, msg
   3.255 +            if DEBUG:
   3.256 +                print 'CtrlMsgRcvr>writeRequest>',
   3.257 +                printMsg(msg, all=1)
   3.258              if response:
   3.259                  self.addResponder(msg.get_header()['id'], response)
   3.260              self.channel.writeRequest(msg)
   3.261 @@ -185,29 +239,33 @@ class CtrlMsgRcvr:
   3.262              print 'CtrlMsgRcvr>writeRequest>', 'no channel!', self
   3.263  
   3.264      def writeResponse(self, msg):
   3.265 -        """Write a response to the channel.
   3.266 +        """Write a response to the channel. This acknowledges
   3.267 +        a request message.
   3.268 +
   3.269 +        @param msg:      message
   3.270 +        @type  msg:      xu message
   3.271          """
   3.272          if self.channel:
   3.273 -            if DEBUG: print 'CtrlMsgRcvr>writeResponse>', self, msg
   3.274 +            if DEBUG:
   3.275 +                print 'CtrlMsgRcvr>writeResponse>',
   3.276 +                printMsg(msg, all=0)
   3.277              self.channel.writeResponse(msg)
   3.278          else:
   3.279              print 'CtrlMsgRcvr>writeResponse>', 'no channel!', self
   3.280              
   3.281  class ControllerFactory(CtrlMsgRcvr):
   3.282 -    """Abstract class for factories creating controllers.
   3.283 +    """Abstract class for factories creating controllers for a domain.
   3.284      Maintains a table of instances.
   3.285  
   3.286 -    Instance variables:
   3.287 -
   3.288 -    instances : mapping of index to controller instance
   3.289 -    dlist     : list of deferreds
   3.290 -    dom       : domain
   3.291 +    @ivar instances: mapping of index to controller instance
   3.292 +    @type instances: {int: Controller}
   3.293 +    @ivar dom: domain
   3.294 +    @type dom: int
   3.295      """
   3.296  
   3.297      def __init__(self):
   3.298          CtrlMsgRcvr.__init__(self)
   3.299          self.instances = {}
   3.300 -        self.dlist = []
   3.301          self.dom = 0
   3.302          
   3.303      def addInstance(self, instance):
   3.304 @@ -241,6 +299,11 @@ class ControllerFactory(CtrlMsgRcvr):
   3.305  
   3.306      def createInstance(self, dom, recreate=0):
   3.307          """Create an instance. Define in a subclass.
   3.308 +
   3.309 +        @param dom: domain
   3.310 +        @type  dom: int
   3.311 +        @param recreate: true if the instance is being recreated (after xend restart)
   3.312 +        @type  recreate: int
   3.313          """
   3.314          raise NotImplementedError()
   3.315