From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: Yaniv Kamay <ykamay@redhat.com>,
aliguori@us.ibm.com, Dor Laor <dlaor@redhat.com>,
avi@redhat.com
Subject: [Qemu-devel] [PATCH v2 3/3] propagate error on failed completion
Date: Tue, 31 Mar 2009 16:31:36 -0400 [thread overview]
Message-ID: <1238531496-4285-4-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1238531496-4285-3-git-send-email-glommer@redhat.com>
migrate_fd_put_ready() calls qemu_savevm_state_complete(),
but the later can fail.
If it happens, re-start the vm and propagate the error up
Based on a patch by Yaniv Kamay
Signed-off-by: Glauber Costa <glommer@redhat.com>
CC: Yaniv Kamay <ykamay@redhat.com>
CC: Dor Laor <dlaor@redhat.com>
---
migration.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/migration.c b/migration.c
index b3904b2..859d945 100644
--- a/migration.c
+++ b/migration.c
@@ -220,13 +220,19 @@ void migrate_fd_put_ready(void *opaque)
dprintf("iterate\n");
if (qemu_savevm_state_iterate(s->file) == 1) {
+ int state;
dprintf("done iterating\n");
vm_stop(0);
bdrv_flush_all();
- qemu_savevm_state_complete(s->file);
- s->state = MIG_STATE_COMPLETED;
+ if ((qemu_savevm_state_complete(s->file)) < 0) {
+ vm_start();
+ state = MIG_STATE_ERROR;
+ } else {
+ state = MIG_STATE_COMPLETED;
+ }
migrate_fd_cleanup(s);
+ s->state = state;
}
}
--
1.5.6.6
next prev parent reply other threads:[~2009-03-31 20:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-31 20:31 [Qemu-devel] [PATCH v2 0/3] Migration fixes Glauber Costa
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration Glauber Costa
2009-03-31 20:31 ` [Qemu-devel] [PATCH v2 2/3] create qemu_file_set_error Glauber Costa
2009-03-31 20:31 ` Glauber Costa [this message]
2009-04-05 19:30 ` [Qemu-devel] [PATCH v2 1/3] stop dirty tracking just at the end of migration Anthony Liguori
2009-04-05 19:33 ` Anthony Liguori
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=1238531496-4285-4-git-send-email-glommer@redhat.com \
--to=glommer@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=dlaor@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=ykamay@redhat.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 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).