From patchwork Thu Mar 28 16:47:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Hrdina X-Patchwork-Id: 232145 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 269802C00A8 for ; Fri, 29 Mar 2013 04:29:38 +1100 (EST) Received: from localhost ([::1]:56516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULG4a-0005Ix-Ko for incoming@patchwork.ozlabs.org; Thu, 28 Mar 2013 12:53:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULFzC-000703-Gg for qemu-devel@nongnu.org; Thu, 28 Mar 2013 12:47:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULFzB-0004Kw-3v for qemu-devel@nongnu.org; Thu, 28 Mar 2013 12:47:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULFzA-0004Kl-RO for qemu-devel@nongnu.org; Thu, 28 Mar 2013 12:47:33 -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 r2SGlWBd017214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 28 Mar 2013 12:47:32 -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 r2SGlIRG018303; Thu, 28 Mar 2013 12:47:30 -0400 From: Pavel Hrdina To: qemu-devel@nongnu.org Date: Thu, 28 Mar 2013 17:47:10 +0100 Message-Id: <278b56fdb4da73cb84f9fa8e01a5014c76cbf141.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 06/11] 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 Reviewed-by: Eric Blake --- savevm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/savevm.c b/savevm.c index 7598934..3c1ac9e 100644 --- a/savevm.c +++ b/savevm.c @@ -1910,7 +1910,7 @@ void qemu_savevm_state_cancel(void) } } -static int qemu_savevm_state(QEMUFile *f) +static int qemu_savevm_state(QEMUFile *f, Error **errp) { int ret; MigrationParams params = { @@ -1918,23 +1918,23 @@ static int qemu_savevm_state(QEMUFile *f) .shared = 0 }; - if (qemu_savevm_state_blocked(NULL)) { + if (qemu_savevm_state_blocked(errp)) { return -EINVAL; } qemu_mutex_unlock_iothread(); - qemu_savevm_state_begin(f, ¶ms, NULL); + qemu_savevm_state_begin(f, ¶ms, errp); qemu_mutex_lock_iothread(); while (qemu_file_get_error(f) == 0) { - if (qemu_savevm_state_iterate(f, NULL) > 0) { + if (qemu_savevm_state_iterate(f, errp) > 0) { break; } } ret = qemu_file_get_error(f); if (ret == 0) { - qemu_savevm_state_complete(f, NULL); + qemu_savevm_state_complete(f, errp); ret = qemu_file_get_error(f); } if (ret != 0) { @@ -2321,7 +2321,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) {