ia64/xen-unstable

changeset 7046:b2c9acd6fdfc

Move ImageHandler.create call to initDomain, after the call to xc.domain_create.
This ensures that ImageHandler has the correct domain ID available to it, which
seems sensible in general, and is necessary for the VMX VNC support in
particular.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Fri Sep 23 16:50:02 2005 +0100 (2005-09-23)
parents 5805b47583ba
children 1f948a831fdc
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri Sep 23 16:05:37 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Sep 23 16:50:02 2005 +0100
     1.3 @@ -614,7 +614,7 @@ class XendDomainInfo:
     1.4              sxpr.append(['maxmem', self.info['maxmem_KiB'] / 1024])
     1.5  
     1.6              if self.infoIsSet('device'):
     1.7 -                for (n, c) in self.info['device']:
     1.8 +                for (_, c) in self.info['device']:
     1.9                      sxpr.append(['device', c])
    1.10  
    1.11              def stateChar(name):
    1.12 @@ -706,13 +706,6 @@ class XendDomainInfo:
    1.13          """
    1.14          # todo - add support for scheduling params?
    1.15          try:
    1.16 -            if 'image' not in self.info:
    1.17 -                raise VmError('Missing image in configuration')
    1.18 -
    1.19 -            self.image = ImageHandler.create(self,
    1.20 -                                             self.info['image'],
    1.21 -                                             self.info['device'])
    1.22 -
    1.23              self.initDomain()
    1.24  
    1.25              # Create domain devices.
    1.26 @@ -737,6 +730,14 @@ class XendDomainInfo:
    1.27  
    1.28          self.domid = xc.domain_create(dom = self.domid or 0,
    1.29                                        ssidref = self.info['ssidref'])
    1.30 +
    1.31 +        if 'image' not in self.info:
    1.32 +            raise VmError('Missing image in configuration')
    1.33 +
    1.34 +        self.image = ImageHandler.create(self,
    1.35 +                                         self.info['image'],
    1.36 +                                         self.info['device'])
    1.37 +
    1.38          if self.domid <= 0:
    1.39              raise VmError('Creating domain failed: name=%s' %
    1.40                            self.info['name'])