Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LojtG-0000Jn-CE for qemu-devel@nongnu.org; Tue, 31 Mar 2009 15:44:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LojtB-0000J0-LY for qemu-devel@nongnu.org; Tue, 31 Mar 2009 15:44:53 -0400 Received: from [199.232.76.173] (port=57229 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LojtB-0000Ix-Hi for qemu-devel@nongnu.org; Tue, 31 Mar 2009 15:44:49 -0400 Received: from mx2.redhat.com ([66.187.237.31]:51105) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LojtA-0004Bp-VE for qemu-devel@nongnu.org; Tue, 31 Mar 2009 15:44:49 -0400 Date: Tue, 31 Mar 2009 16:48:54 -0300 From: Glauber Costa Message-ID: <20090331194854.GE20773@poweredge.glommer> References: <1238521389-4130-1-git-send-email-glommer@redhat.com> <49D27077.8000209@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49D27077.8000209@redhat.com> Subject: [Qemu-devel] Re: [PATCH 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: Yaniv Kamay Cc: aliguori@us.ibm.com, Dor Laor , qemu-devel@nongnu.org, avi@redhat.com On Tue, Mar 31, 2009 at 10:35:19PM +0300, Yaniv Kamay wrote: > Glauber Costa wrote: >> 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 | 6 +++++- >> 1 files changed, 5 insertions(+), 1 deletions(-) >> >> diff --git a/migration.c b/migration.c >> index b3904b2..d77ebbd 100644 >> --- a/migration.c >> +++ b/migration.c >> @@ -224,7 +224,11 @@ void migrate_fd_put_ready(void *opaque) >> vm_stop(0); >> bdrv_flush_all(); >> - qemu_savevm_state_complete(s->file); >> + if ((qemu_savevm_state_complete(s->file)) < 0) { >> + vm_start(); >> + s->state = MIG_STATE_ERROR; >> + return; >> + } >> s->state = MIG_STATE_COMPLETED; >> migrate_fd_cleanup(s); >> } >> > We need to call migrate_fd_cleanup() in case of error. thanks for the spot. I will update this patch. > > Yaniv >