mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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:
1 parent
a65b0d048f
commit
9b0cb01573
1 file changed
+9
-8
@@ -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'])
|
||||
|
||||