From patchwork Thu Dec 13 15:40:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Hrdina X-Patchwork-Id: 206127 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 516EE2C009A for ; Fri, 14 Dec 2012 02:42:33 +1100 (EST) Received: from localhost ([::1]:50773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjAvf-0003cU-IR for incoming@patchwork.ozlabs.org; Thu, 13 Dec 2012 10:42:31 -0500 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 Received: from localhost.localdomain.com (dhcp-27-184.brq.redhat.com [10.34.27.184]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBDFeqvO030229; Thu, 13 Dec 2012 10:41:04 -0500 From: Pavel Hrdina To: qemu-devel@nongnu.org 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: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: phrdina@redhat.com Subject: [Qemu-devel] [PATCH v2 11/17] savevm: add error parameter to 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 --- 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) {