diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-02-02 10:51:54 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-02-02 10:51:54 +0000 |
commit | 912c5a1f617d48e383be042645ec0c33b8c7309c (patch) | |
tree | e57b068e7da63a5ce8bdcf7e0fdf8a64ce686f1e /tools | |
parent | ef532054c0de7c4a548e0124b42acf9477f580d5 (diff) | |
download | xen-912c5a1f617d48e383be042645ec0c33b8c7309c.tar.gz xen-912c5a1f617d48e383be042645ec0c33b8c7309c.tar.bz2 xen-912c5a1f617d48e383be042645ec0c33b8c7309c.zip |
Fix save/restore failure cleanup
The save failure cleanup introduced in 13543:207523704fb1 is
incorrect: if we didn't get as far as actually suspending the domain,
then the guest domain will not be expecting the devices to be removed
(seen on both Linux and Solaris, which don't expect a 'Closing' state
when they hold the device open). Only re-jig devices if we definitely
shut the domain down.
Signed-off-by: John Levon <john.levon@sun.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/python/xen/xend/XendCheckpoint.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py index a70df6f785..adc63c0e63 100644 --- a/tools/python/xen/xend/XendCheckpoint.py +++ b/tools/python/xen/xend/XendCheckpoint.py @@ -67,6 +67,8 @@ def save(fd, dominfo, network, live, dst, checkpoint=False): # thing is useful for debugging. dominfo.setName('migrating-' + domain_name) + done_suspend = 0 + try: dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP1, domain_name) @@ -94,6 +96,7 @@ def save(fd, dominfo, network, live, dst, checkpoint=False): log.debug("Suspending %d ...", dominfo.getDomid()) dominfo.shutdown('suspend') dominfo.waitForShutdown() + done_suspend = 1 dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP2, domain_name) log.info("Domain %d suspended.", dominfo.getDomid()) @@ -140,9 +143,14 @@ def save(fd, dominfo, network, live, dst, checkpoint=False): log.exception("Save failed on domain %s (%s).", domain_name, dominfo.getDomid()) - dominfo.resumeDomain() - log.debug("XendCheckpoint.save: resumeDomain") - + # If we didn't get as far as suspending the domain (for + # example, we couldn't balloon enough memory for the new + # domain), then we don't want to re-plumb the devices, as the + # domU will not be expecting it. + if done_suspend: + log.debug("XendCheckpoint.save: resumeDomain") + dominfo.resumeDomain() + try: dominfo.setName(domain_name) except: |