From patchwork Tue Oct 30 08:33:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 195432 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 60B742C00AC for ; Tue, 30 Oct 2012 21:53:31 +1100 (EST) Received: from localhost ([::1]:48521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT7Hp-0006Wo-P5 for incoming@patchwork.ozlabs.org; Tue, 30 Oct 2012 04:35:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT7GO-0004nw-Q8 for qemu-devel@nongnu.org; Tue, 30 Oct 2012 04:33:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TT7GD-0000aF-8S for qemu-devel@nongnu.org; Tue, 30 Oct 2012 04:33:32 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:44748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT7GC-0000YY-VE for qemu-devel@nongnu.org; Tue, 30 Oct 2012 04:33:21 -0400 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 58A04181CE; Tue, 30 Oct 2012 17:33:14 +0900 (JST) Received: (nullmailer pid 29481 invoked by uid 1000); Tue, 30 Oct 2012 08:33:14 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kvm@vger.kernel.org Date: Tue, 30 Oct 2012 17:33:04 +0900 Message-Id: <3204d6ba83d6f5697b1c547bcf7fe333eab7b609.1351582535.git.yamahata@valinux.co.jp> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 210.128.90.3 Cc: benoit.hudzia@gmail.com, aarcange@redhat.com, aliguori@us.ibm.com, quintela@redhat.com, stefanha@gmail.com, t.hirofuchi@aist.go.jp, dlaor@redhat.com, satoshi.itoh@aist.go.jp, mdroth@linux.vnet.ibm.com, yoshikawa.takuya@oss.ntt.co.jp, owasserm@redhat.com, avi@redhat.com, pbonzini@redhat.com, chegu_vinod@hp.com Subject: [Qemu-devel] [PATCH v3 28/35] arch_init: factor out setting last_block, last_offset 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: Isaku Yamahata --- arch_init.c | 10 +++++++--- arch_init.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch_init.c b/arch_init.c index d95ce7b..9137013 100644 --- a/arch_init.c +++ b/arch_init.c @@ -416,6 +416,12 @@ static void migration_bitmap_sync(void) static uint64_t bytes_transferred; +void ram_save_set_last_block(RAMBlock *block, ram_addr_t offset) +{ + last_block = block; + last_offset = offset; +} + /* * ram_save_page: Writes a page of memory to the stream f * @@ -496,9 +502,7 @@ bool ram_save_block(QEMUFile *f, bool last_stage) } } while (block != last_block || offset != last_offset); - last_block = block; - last_offset = offset; - + ram_save_set_last_block(block, offset); return wrote; } diff --git a/arch_init.h b/arch_init.h index 499d0f1..9165456 100644 --- a/arch_init.h +++ b/arch_init.h @@ -49,6 +49,7 @@ CpuDefinitionInfoList GCC_WEAK_DECL *arch_query_cpu_definitions(Error **errp); int ram_load_page(QEMUFile *f, void *host, int flags); #if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY) +void ram_save_set_last_block(RAMBlock *block, ram_addr_t offset); bool ram_save_page(QEMUFile *f, RAMBlock *block, ram_addr_t offset, bool last_stage); RAMBlock *ram_find_block(const char *id, uint8_t len);