ia64/xen-unstable

changeset 7026:2f83ff9f6bd2

Move variable initialisation out of import section. Remove obsolete save
parameter from XendDominInfo.exportToDB.
author emellor@ewan
date Thu Sep 22 18:03:16 2005 +0100 (2005-09-22)
parents 40a0f049e344
children 06d84bf87159
files tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Thu Sep 22 17:58:43 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Thu Sep 22 18:03:16 2005 +0100
     1.3 @@ -23,13 +23,13 @@
     1.4  """
     1.5  import os
     1.6  
     1.7 -import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
     1.8 +import xen.lowlevel.xc
     1.9  
    1.10  from xen.xend import sxp
    1.11 -from xen.xend import XendRoot; xroot = XendRoot.instance()
    1.12 +from xen.xend import XendRoot
    1.13  from xen.xend import XendCheckpoint
    1.14  from xen.xend.XendDomainInfo import XendDomainInfo, shutdown_reason
    1.15 -from xen.xend import EventServer; eserver = EventServer.instance()
    1.16 +from xen.xend import EventServer
    1.17  from xen.xend.XendError import XendError
    1.18  from xen.xend.XendLogging import log
    1.19  from xen.xend import scheduler
    1.20 @@ -39,6 +39,12 @@ from xen.xend.xenstore import XenNode, D
    1.21  from xen.xend.xenstore.xstransact import xstransact
    1.22  from xen.xend.xenstore.xsutil import GetDomainPath
    1.23  
    1.24 +
    1.25 +xc = xen.lowlevel.xc.new()
    1.26 +xroot = XendRoot.instance()
    1.27 +eserver = EventServer.instance()
    1.28 +
    1.29 +
    1.30  __all__ = [ "XendDomain" ]
    1.31  
    1.32  SHUTDOWN_TIMEOUT = 30
    1.33 @@ -182,7 +188,7 @@ class XendDomain:
    1.34          if info.getDomid() in self.domains:
    1.35              notify = False
    1.36          self.domains[info.getDomid()] = info
    1.37 -        info.exportToDB(save=True)
    1.38 +        info.exportToDB()
    1.39          if notify:
    1.40              eserver.inject('xend.domain.create', [info.getName(),
    1.41                                                    info.getDomid()])
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Sep 22 17:58:43 2005 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Sep 22 18:03:16 2005 +0100
     2.3 @@ -444,7 +444,7 @@ class XendDomainInfo:
     2.4          return xstransact.Store(self.path, *args)
     2.5  
     2.6  
     2.7 -    def exportToDB(self, save=False):
     2.8 +    def exportToDB(self):
     2.9          to_store = {
    2.10              'domid':              str(self.domid),
    2.11              'uuid':               self.uuid,
    2.12 @@ -718,7 +718,7 @@ class XendDomainInfo:
    2.13              # Create domain devices.
    2.14              self.construct_image()
    2.15              self.configure()
    2.16 -            self.exportToDB(save=True)
    2.17 +            self.exportToDB()
    2.18          except Exception, ex:
    2.19              # Catch errors, cleanup and re-raise.
    2.20              print 'Domain construction error:', ex
    2.21 @@ -739,7 +739,7 @@ class XendDomainInfo:
    2.22                                        ssidref = self.info['ssidref'])
    2.23          if self.domid <= 0:
    2.24              raise VmError('Creating domain failed: name=%s' %
    2.25 -                          self.vm.getName())
    2.26 +                          self.info['name'])
    2.27  
    2.28          if self.info['bootloader']:
    2.29              self.image.handleBootloading()