[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 9 of 9] tools: notify restore to hangup during migration --abort_if_busy



# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1364481743 -3600
# Node ID 756d175cefa9885112b6d1337d1e855a223d94a9
# Parent  4bf71e887b838dd643399b8b8a65406d5f8eb94f
tools: notify restore to hangup during migration --abort_if_busy

If a guest is too busy to finish migration, the remote side is not
notified and as a result an imcomplete, paused guest will remain on the
remote side. Add a new flag to notify the receiver about the aborted
migration so that both sides can cleanup properly.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r 4bf71e887b83 -r 756d175cefa9 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -983,6 +983,10 @@ static int pagebuf_get_one(xc_interface 
         DPRINTF("read generation id buffer address");
         return pagebuf_get_one(xch, ctx, buf, fd, dom);
 
+    case XC_SAVE_ID_BUSY_ABORT:
+        ERROR("Source host requested cancelation, guest is busy.");
+        errno = EBUSY;
+        return -1;
     default:
         if ( (count > MAX_BATCH_SIZE) || (count < 0) ) {
             ERROR("Max batch size exceeded (%d). Giving up.", count);
diff -r 4bf71e887b83 -r 756d175cefa9 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1537,9 +1537,11 @@ int xc_domain_save(xc_interface *xch, in
             {
                 if ( !min_reached && abort_if_busy )
                 {
+                    unsigned int cmd = XC_SAVE_ID_BUSY_ABORT;
                     ERROR("Live migration aborted, as requested. (guest too 
busy?)"
                      " total_sent %lu iter %d, max_iters %u max_factor %u",
                       total_sent, iter, max_iters, max_factor);
+                    wrexact(io_fd, &cmd, sizeof(cmd));
                     print_stats(xch, dom, sent_this_iter, &time_stats, 
&shadow_stats, 1);
                     rc = 1;
                     goto out;
diff -r 4bf71e887b83 -r 756d175cefa9 tools/libxc/xg_save_restore.h
--- a/tools/libxc/xg_save_restore.h
+++ b/tools/libxc/xg_save_restore.h
@@ -259,6 +259,7 @@
 #define XC_SAVE_ID_HVM_ACCESS_RING_PFN  -16
 #define XC_SAVE_ID_HVM_SHARING_RING_PFN -17
 #define XC_SAVE_ID_TOOLSTACK          -18 /* Optional toolstack specific info 
*/
+#define XC_SAVE_ID_BUSY_ABORT         -19 /* Source requested cancelation */
 
 /*
 ** We process save/restore/migrate in batches of pages; the below

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.