From patchwork Thu Mar 28 16:47:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Hrdina X-Patchwork-Id: 232134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A56792C00BE for ; Fri, 29 Mar 2013 04:09:29 +1100 (EST) Received: from localhost ([::1]:58175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULG5A-0006DR-2W for incoming@patchwork.ozlabs.org; Thu, 28 Mar 2013 12:53:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULFzJ-0007DZ-Ph for qemu-devel@nongnu.org; Thu, 28 Mar 2013 12:47:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULFzI-0004O5-7B for qemu-devel@nongnu.org; Thu, 28 Mar 2013 12:47:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULFzI-0004NW-0E for qemu-devel@nongnu.org; Thu, 28 Mar 2013 12:47:40 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2SGld7M029237 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 28 Mar 2013 12:47:39 -0400 Received: from localhost.localdomain.com (dhcp-27-230.brq.redhat.com [10.34.27.230]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2SGlIRK018303; Thu, 28 Mar 2013 12:47:37 -0400 From: Pavel Hrdina To: qemu-devel@nongnu.org Date: Thu, 28 Mar 2013 17:47:14 +0100 Message-Id: <1b1a586c1dc57585d6568a0bcb97b2ba1b11b641.1364487348.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: phrdina@redhat.com, armbru@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH v3 10/11] savevm: update return value from qemu_savevm_state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Pavel Hrdina Reviewed-by: Eric Blake --- savevm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/savevm.c b/savevm.c index 0dce456..1e9ab4b 100644 --- a/savevm.c +++ b/savevm.c @@ -1910,7 +1910,7 @@ void qemu_savevm_state_cancel(void) } } -static int qemu_savevm_state(QEMUFile *f, Error **errp) +static void qemu_savevm_state(QEMUFile *f, Error **errp) { int ret; MigrationParams params = { @@ -1919,7 +1919,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp) }; if (qemu_savevm_state_blocked(errp)) { - return -EINVAL; + return; } qemu_mutex_unlock_iothread(); @@ -1940,7 +1940,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp) if (ret != 0) { qemu_savevm_state_cancel(); } - return ret; } static int qemu_save_device_state(QEMUFile *f) @@ -2327,10 +2326,10 @@ SnapshotInfo *qmp_vm_snapshot_save(bool has_name, const char *name, error_setg(errp, "Failed to open '%s' file.", bdrv_get_device_name(bs)); goto the_end; } - ret = qemu_savevm_state(f, &local_err); + qemu_savevm_state(f, &local_err); vm_state_size = qemu_ftell(f); qemu_fclose(f); - if (ret < 0) { + if (error_is_set(&local_err)) { error_propagate(errp, local_err); goto the_end; }