From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjAuS-0001kr-GY for qemu-devel@nongnu.org; Thu, 13 Dec 2012 10:41:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjAuI-0005vW-EA for qemu-devel@nongnu.org; Thu, 13 Dec 2012 10:41:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjAuI-0005vC-58 for qemu-devel@nongnu.org; Thu, 13 Dec 2012 10:41:06 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBDFf557023274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Dec 2012 10:41:05 -0500 From: Pavel Hrdina Date: Thu, 13 Dec 2012 16:40:45 +0100 Message-Id: <4363785e623850cc541b40c20f9720067f57c2ee.1355404685.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH v2 11/17] savevm: add error parameter to qemu_savevm_state() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: phrdina@redhat.com Signed-off-by: Pavel Hrdina --- savevm.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/savevm.c b/savevm.c index c17cc7f..71c7df8 100644 --- a/savevm.c +++ b/savevm.c @@ -1787,7 +1787,8 @@ void qemu_savevm_state_cancel(QEMUFile *f) } } -static int qemu_savevm_state(QEMUFile *f) +static int qemu_savevm_state(QEMUFile *f, + Error **errp) { int ret; MigrationParams params = { @@ -1795,22 +1796,24 @@ static int qemu_savevm_state(QEMUFile *f) .shared = 0 }; - if (qemu_savevm_state_blocked(NULL)) { + if (qemu_savevm_state_blocked(errp)) { ret = -EINVAL; goto out; } - ret = qemu_savevm_state_begin(f, ¶ms, NULL); - if (ret < 0) + ret = qemu_savevm_state_begin(f, ¶ms, errp); + if (ret < 0) { goto out; + } do { - ret = qemu_savevm_state_iterate(f, NULL); - if (ret < 0) + ret = qemu_savevm_state_iterate(f, errp); + if (ret < 0) { goto out; + } } while (ret == 0); - ret = qemu_savevm_state_complete(f, NULL); + ret = qemu_savevm_state_complete(f, errp); out: if (ret == 0) { @@ -2217,7 +2220,7 @@ void do_savevm(Monitor *mon, const QDict *qdict) monitor_printf(mon, "Could not open VM state file\n"); goto the_end; } - ret = qemu_savevm_state(f); + ret = qemu_savevm_state(f, NULL); vm_state_size = qemu_ftell(f); qemu_fclose(f); if (ret < 0) { -- 1.8.0.2