From patchwork Fri Mar 22 13:16:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Hrdina X-Patchwork-Id: 230008 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 E40072C00A1 for ; Sat, 23 Mar 2013 00:17:06 +1100 (EST) Received: from localhost ([::1]:59694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJ1qD-00054p-1k for incoming@patchwork.ozlabs.org; Fri, 22 Mar 2013 09:17:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJ1pb-0004xy-P6 for qemu-devel@nongnu.org; Fri, 22 Mar 2013 09:16:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJ1pZ-00088k-Om for qemu-devel@nongnu.org; Fri, 22 Mar 2013 09:16:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJ1pZ-00088D-GZ for qemu-devel@nongnu.org; Fri, 22 Mar 2013 09:16:25 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2MDGOTY001156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 22 Mar 2013 09:16:25 -0400 Received: from localhost.localdomain.com (vpn1-5-126.ams2.redhat.com [10.36.5.126]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2MDGBBg008641; Fri, 22 Mar 2013 09:16:23 -0400 From: Pavel Hrdina To: qemu-devel@nongnu.org Date: Fri, 22 Mar 2013 14:16:04 +0100 Message-Id: <06467fc6c06628d760de026055644d339a65d7b5.1363957855.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Pavel Hrdina , armbru@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH v2 05/12] savevm: add error parameter to qemu_savevm_state_complete() 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 --- include/sysemu/sysemu.h | 2 +- migration.c | 2 +- savevm.c | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index af4f699..9e6a4a9 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -77,7 +77,7 @@ void qemu_savevm_state_begin(QEMUFile *f, const MigrationParams *params, Error **errp); int qemu_savevm_state_iterate(QEMUFile *f, Error **errp); -void qemu_savevm_state_complete(QEMUFile *f); +void qemu_savevm_state_complete(QEMUFile *f, Error **errp); void qemu_savevm_state_cancel(void); uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size); int qemu_loadvm_state(QEMUFile *f); diff --git a/migration.c b/migration.c index c2bf531..c8fdfc0 100644 --- a/migration.c +++ b/migration.c @@ -524,7 +524,7 @@ static void *migration_thread(void *opaque) old_vm_running = runstate_is_running(); vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); qemu_file_set_rate_limit(s->file, INT_MAX); - qemu_savevm_state_complete(s->file); + qemu_savevm_state_complete(s->file, NULL); qemu_mutex_unlock_iothread(); if (!qemu_file_get_error(s->file)) { migrate_finish_set_state(s, MIG_STATE_COMPLETED); diff --git a/savevm.c b/savevm.c index c5ac701..76af390 100644 --- a/savevm.c +++ b/savevm.c @@ -1709,7 +1709,7 @@ int qemu_savevm_state_iterate(QEMUFile *f, Error **errp) return ret; } -void qemu_savevm_state_complete(QEMUFile *f) +void qemu_savevm_state_complete(QEMUFile *f, Error **errp) { SaveStateEntry *se; int ret; @@ -1734,6 +1734,7 @@ void qemu_savevm_state_complete(QEMUFile *f) trace_savevm_section_end(se->section_id); if (ret < 0) { qemu_file_set_error(f, ret); + error_setg(errp, "Failed to complete vmstate save."); return; } } @@ -1819,7 +1820,7 @@ static int qemu_savevm_state(QEMUFile *f) ret = qemu_file_get_error(f); if (ret == 0) { - qemu_savevm_state_complete(f); + qemu_savevm_state_complete(f, NULL); ret = qemu_file_get_error(f); } if (ret != 0) {