From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lokcc-00068F-Dg for qemu-devel@nongnu.org; Tue, 31 Mar 2009 16:31:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LokcX-000602-1J for qemu-devel@nongnu.org; Tue, 31 Mar 2009 16:31:45 -0400 Received: from [199.232.76.173] (port=53865 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LokcW-0005zR-Oq for qemu-devel@nongnu.org; Tue, 31 Mar 2009 16:31:40 -0400 Received: from mx2.redhat.com ([66.187.237.31]:52582) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LokcV-0001U0-Rw for qemu-devel@nongnu.org; Tue, 31 Mar 2009 16:31:40 -0400 From: Glauber Costa Date: Tue, 31 Mar 2009 16:31:36 -0400 Message-Id: <1238531496-4285-4-git-send-email-glommer@redhat.com> In-Reply-To: <1238531496-4285-3-git-send-email-glommer@redhat.com> References: <1238531496-4285-1-git-send-email-glommer@redhat.com> <1238531496-4285-2-git-send-email-glommer@redhat.com> <1238531496-4285-3-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH v2 3/3] propagate error on failed completion Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Yaniv Kamay , aliguori@us.ibm.com, Dor Laor , avi@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 CC: Yaniv Kamay CC: Dor Laor --- 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