All of lore.kernel.org
 help / color / mirror / Atom feed
From: john.levon@sun.com
To: xen-devel@lists.xensource.com
Subject: [PATCH] Fix save/restore failure cleanup
Date: Fri, 01 Feb 2008 10:18:50 -0800	[thread overview]
Message-ID: <904da511efb367ef015f.1201889930@hatchback> (raw)

# HG changeset patch
# User john.levon@sun.com
# Date 1201883258 28800
# Node ID 904da511efb367ef015fc71ac551eda9d73c83da
# Parent  db45491fd981542e1197aa6cf78a8d2215336cc5
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>

diff --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py
--- 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
     # 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
                 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
         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:

                 reply	other threads:[~2008-02-01 18:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=904da511efb367ef015f.1201889930@hatchback \
    --to=john.levon@sun.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.