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>
This commit is contained in:
emellor@ewan committed 2005-09-23 16:50:02 +01:00
1 parent a65b0d048f
commit 9b0cb01573
1 file changed
+9 -8
+9 -8
View File
@@ -614,7 +614,7 @@ class XendDomainInfo:
sxpr.append(['maxmem', self.info['maxmem_KiB'] / 1024])
if self.infoIsSet('device'):
for (n, c) in self.info['device']:
for (_, c) in self.info['device']:
sxpr.append(['device', c])
def stateChar(name):
@@ -706,13 +706,6 @@ class XendDomainInfo:
"""
# todo - add support for scheduling params?
try:
if 'image' not in self.info:
raise VmError('Missing image in configuration')
self.image = ImageHandler.create(self,
self.info['image'],
self.info['device'])
self.initDomain()
# Create domain devices.
@@ -737,6 +730,14 @@ class XendDomainInfo:
self.domid = xc.domain_create(dom = self.domid or 0,
ssidref = self.info['ssidref'])
if 'image' not in self.info:
raise VmError('Missing image in configuration')
self.image = ImageHandler.create(self,
self.info['image'],
self.info['device'])
if self.domid <= 0:
raise VmError('Creating domain failed: name=%s' %
self.info['name'])
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.