xend: Tear down domain if device hotplug fails during startup

If creating an unmanaged guest (eg xm create), if device hotplug fails
during the startup of the guest, then the guest will be torn down
again. If creating and starting a managed guest (eg xm new && xm
start), then if device hotplug fails, the still born guest gets left
in 'paused' state. This confuses users no end, who go an unpause and
then get all upset when it shortly crashes (due to lack of disk or
network devices).

The attached patch fixes XenDomain.py's domain_start() method so that
if waitForDevices() fails, then the entire domain is torn down. This
is the same approach used in xm create.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
kfraser@localhost.localdomain committed 2007-05-24 14:05:58 +01:00
1 parent 565f279e07
commit 1c77b7cb9f
1 file changed
+8 -2
+8 -2
View File
@@ -985,10 +985,16 @@ class XendDomain:
dominfo.start(is_managed = True)
finally:
self.domains_lock.release()
dominfo.waitForDevices()
try:
dominfo.waitForDevices()
except Exception, ex:
log.warn("Failed to setup devices for " + str(dominfo) + ": " + str(ex))
dominfo.destroy()
raise
if not start_paused:
dominfo.unpause()
def domain_delete(self, domid):
"""Remove a managed domain from database
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.