From patchwork Fri Mar 29 14:12:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Hrdina X-Patchwork-Id: 232429 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 36CDC2C00C7 for ; Sat, 30 Mar 2013 01:16:52 +1100 (EST) Received: from localhost ([::1]:59785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULa6s-0008Pk-BT for incoming@patchwork.ozlabs.org; Fri, 29 Mar 2013 10:16:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULa3C-0002X0-OJ for qemu-devel@nongnu.org; Fri, 29 Mar 2013 10:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULa3B-0003cV-KK for qemu-devel@nongnu.org; Fri, 29 Mar 2013 10:13:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULa3B-0003cO-CQ for qemu-devel@nongnu.org; Fri, 29 Mar 2013 10:13:01 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2TED0Rf017820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 29 Mar 2013 10:13:00 -0400 Received: from localhost.localdomain.com (vpn1-6-110.ams2.redhat.com [10.36.6.110]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2TECc3a031878; Fri, 29 Mar 2013 10:12:59 -0400 From: Pavel Hrdina To: qemu-devel@nongnu.org Date: Fri, 29 Mar 2013 15:12:37 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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 v4 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 6ac4ece..75f64d1 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; }