From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Cc: Ian.Campbell@citrix.com
Subject: [PATCH 9 of 9] tools: notify restore to hangup during migration --abort_if_busy
Date: Thu, 28 Mar 2013 15:43:36 +0100 [thread overview]
Message-ID: <756d175cefa9885112b6.1364481816@probook.site> (raw)
In-Reply-To: <patchbomb.1364481807@probook.site>
# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# 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@aepfle.de>
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
next prev parent reply other threads:[~2013-03-28 14:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 14:43 [PATCH 0 of 9] set migrate constraints from cmdline, better xend.log logging Olaf Hering
2013-03-28 14:43 ` [PATCH 1 of 9] tools/xc: print messages from xc_save with xc_report Olaf Hering
2013-03-28 14:43 ` [PATCH 2 of 9] tools/xc: document printf calls in xc_restore Olaf Hering
2013-03-28 14:43 ` [PATCH 3 of 9] tools/xc: rework xc_save.c:switch_qemu_logdirty Olaf Hering
2013-04-08 17:12 ` Ian Jackson
2013-03-28 14:43 ` [PATCH 4 of 9] tools: set migration constraints from cmdline Olaf Hering
2013-04-08 17:16 ` Ian Jackson
2013-03-28 14:43 ` [PATCH 5 of 9] tools: add xm migrate --log_progress option Olaf Hering
2013-03-28 14:43 ` [PATCH 6 of 9] tools/xend: move assert to exception block Olaf Hering
2013-04-08 17:13 ` Ian Jackson
2013-03-28 14:43 ` [PATCH 7 of 9] tools/libxc: print stats if migration is aborted Olaf Hering
2013-03-28 14:43 ` [PATCH 8 of 9] tools: set number of dirty pages during migration Olaf Hering
2013-03-28 14:43 ` Olaf Hering [this message]
2013-04-08 17:14 ` [PATCH 9 of 9] tools: notify restore to hangup during migration --abort_if_busy Ian Jackson
2013-04-08 17:12 ` [PATCH 0 of 9] set migrate constraints from cmdline, better xend.log logging Ian Jackson
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=756d175cefa9885112b6.1364481816@probook.site \
--to=olaf@aepfle.de \
--cc=Ian.Campbell@citrix.com \
--cc=xen-devel@lists.xen.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).