From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Pavel Hrdina 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: Subject: [Qemu-devel] [PATCH v3 10/11] savevm: update return value from qemu_savevm_state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: phrdina@redhat.com, armbru@redhat.com, lcapitulino@redhat.com Signed-off-by: Pavel Hrdina --- 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; } -- 1.8.1.4