Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4Ki6-0007Aq-RB for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:10:22 -0400 Received: from [140.186.70.92] (port=37307 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4Ki0-00078Z-ON for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:10:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4Khw-0003wD-HG for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:10:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23606) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4Kht-0003vi-5Q for qemu-devel@nongnu.org; Tue, 20 Apr 2010 17:10:11 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3KLA8Sj018154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 20 Apr 2010 17:10:08 -0400 From: Luiz Capitulino Date: Tue, 20 Apr 2010 18:09:35 -0300 Message-Id: <1271797792-24571-6-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1271797792-24571-1-git-send-email-lcapitulino@redhat.com> References: <1271797792-24571-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 05/22] savevm: load_vmstate(): Return 'ret' on error List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, armbru@redhat.com, quintela@redhat.com, kwolf@redhat.com When looping to restore the snapshot on all drives, load_vmstate() will return 0 if bdrv_snapshot_goto() returns an error. This seems a trick to avoid the call to vm_start() in do_loadvm(), however it brings two problems: 1. The call to load_vmstate() from main() will succeed 2. In QMP, it's just not allowed to fail and return 0 This commit fixes that. Signed-off-by: Luiz Capitulino --- savevm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/savevm.c b/savevm.c index cc6cbb2..5024829 100644 --- a/savevm.c +++ b/savevm.c @@ -1793,7 +1793,7 @@ int load_vmstate(const char *name) } /* fatal on snapshot block device */ if (bs == bs1) - return 0; + return ret; } } } -- 1.7.1.rc1.12.ga6018