From patchwork Thu Mar 28 16:47:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Hrdina X-Patchwork-Id: 232132 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 C55212C00A2 for ; Fri, 29 Mar 2013 04:07:43 +1100 (EST) Received: from localhost ([::1]:52813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULG2u-000353-Sp for incoming@patchwork.ozlabs.org; Thu, 28 Mar 2013 12:51:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULFz9-0006us-Mz for qemu-devel@nongnu.org; Thu, 28 Mar 2013 12:47:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULFz7-0004It-BS for qemu-devel@nongnu.org; Thu, 28 Mar 2013 12:47:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULFz6-0004IZ-V2 for qemu-devel@nongnu.org; Thu, 28 Mar 2013 12:47:29 -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 r2SGlSNU029158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 28 Mar 2013 12:47:28 -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 r2SGlIRE018303; Thu, 28 Mar 2013 12:47:26 -0400 From: Pavel Hrdina To: qemu-devel@nongnu.org Date: Thu, 28 Mar 2013 17:47:08 +0100 Message-Id: <8740ef658400588fe8f6ffbb543fd8504eb65b16.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 04/11] savevm: add error parameter to qemu_savevm_state_iterate() 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 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 2f35a05..af4f699 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -76,7 +76,7 @@ bool qemu_savevm_state_blocked(Error **errp); void qemu_savevm_state_begin(QEMUFile *f, const MigrationParams *params, Error **errp); -int qemu_savevm_state_iterate(QEMUFile *f); +int qemu_savevm_state_iterate(QEMUFile *f, Error **errp); void qemu_savevm_state_complete(QEMUFile *f); void qemu_savevm_state_cancel(void); uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size); diff --git a/migration.c b/migration.c index d517dd6..e9d2f40 100644 --- a/migration.c +++ b/migration.c @@ -516,7 +516,7 @@ static void *migration_thread(void *opaque) pending_size = qemu_savevm_state_pending(s->file, max_size); DPRINTF("pending size %lu max %lu\n", pending_size, max_size); if (pending_size && pending_size >= max_size) { - qemu_savevm_state_iterate(s->file); + qemu_savevm_state_iterate(s->file, NULL); } else { DPRINTF("done iterating\n"); qemu_mutex_lock_iothread(); diff --git a/savevm.c b/savevm.c index 56da096..575f1b2 100644 --- a/savevm.c +++ b/savevm.c @@ -1784,7 +1784,7 @@ void qemu_savevm_state_begin(QEMUFile *f, * 0 : We haven't finished, caller have to go again * 1 : We have finished, we can go to complete phase */ -int qemu_savevm_state_iterate(QEMUFile *f) +int qemu_savevm_state_iterate(QEMUFile *f, Error **errp) { SaveStateEntry *se; int ret = 1; @@ -1926,7 +1926,7 @@ static int qemu_savevm_state(QEMUFile *f) qemu_mutex_lock_iothread(); while (qemu_file_get_error(f) == 0) { - if (qemu_savevm_state_iterate(f) > 0) { + if (qemu_savevm_state_iterate(f, NULL) > 0) { break; } }