mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
bitkeeper revision 1.1159.1.174 (41544174lO23TSzrMCtW6FnECUFlnQ)
Revert to constructing image first when creating a domain - doing it later breaks restore.
This commit is contained in:
1 parent
34fe926686
commit
04e12a3139
4 files changed
+36
-20
No files matched your search
@@ -500,16 +500,14 @@ class XendDomainInfo:
|
||||
raise VmError('missing memory size')
|
||||
|
||||
self.init_domain()
|
||||
self.construct_image()
|
||||
self.configure_console()
|
||||
self.configure_restart()
|
||||
self.configure_backends()
|
||||
deferred = self.configure()
|
||||
def cbok(val):
|
||||
return self.construct_image()
|
||||
def cberr(err):
|
||||
self.destroy()
|
||||
return err
|
||||
deferred.addCallback(cbok)
|
||||
deferred.addErrback(cberr)
|
||||
except StandardError, ex:
|
||||
# Catch errors, cleanup and re-raise.
|
||||
@@ -651,12 +649,7 @@ class XendDomainInfo:
|
||||
devices have been released.
|
||||
"""
|
||||
if self.dom is None: return 0
|
||||
if self.console:
|
||||
if self.restart_pending():
|
||||
self.console.deregisterChannel()
|
||||
else:
|
||||
log.debug('Closing console, domain %s', self.id)
|
||||
self.console.close()
|
||||
self.destroy_console()
|
||||
chan = xend.getDomChannel(self.dom)
|
||||
if chan:
|
||||
log.debug("Closing channel to domain %d", self.dom)
|
||||
@@ -666,6 +659,14 @@ class XendDomainInfo:
|
||||
except Exception, err:
|
||||
log.exception("Domain destroy failed: %s", self.name)
|
||||
|
||||
def destroy_console(self):
|
||||
if self.console:
|
||||
if self.restart_pending():
|
||||
self.console.deregisterChannel()
|
||||
else:
|
||||
log.debug('Closing console, domain %s', self.id)
|
||||
self.console.close()
|
||||
|
||||
def cleanup(self):
|
||||
"""Cleanup vm resources: release devices.
|
||||
"""
|
||||
|
||||