From patchwork Mon Jun 4 09:57:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 162765 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 C1EE5B6FBA for ; Mon, 4 Jun 2012 21:47:04 +1000 (EST) Received: from localhost ([::1]:38082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbU3Y-00014C-2R for incoming@patchwork.ozlabs.org; Mon, 04 Jun 2012 05:58:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbU2t-0008RN-VX for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:58:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbU2n-0004aE-QZ for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:57:55 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:46351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbU2n-0004Zp-Gx for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:57:49 -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 94D3048972; Mon, 4 Jun 2012 18:57:44 +0900 (JST) Received: (nullmailer pid 5083 invoked by uid 1000); Mon, 04 Jun 2012 09:57:44 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kvm@vger.kernel.org Date: Mon, 4 Jun 2012 18:57:03 +0900 Message-Id: <00bc188e328b7368bc0b8f5d69fd899b068899f2.1338802192.git.yamahata@valinux.co.jp> X-Mailer: git-send-email 1.7.1.1 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 Subject: [Qemu-devel] [PATCH v2 01/41] arch_init: export sort_ram_list() and ram_save_block() 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 This will be used by postcopy. Signed-off-by: Isaku Yamahata --- arch_init.c | 4 ++-- migration.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch_init.c b/arch_init.c index a9e8b74..38e0173 100644 --- a/arch_init.c +++ b/arch_init.c @@ -164,7 +164,7 @@ static int is_dup_page(uint8_t *page) static RAMBlock *last_block; static ram_addr_t last_offset; -static int ram_save_block(QEMUFile *f) +int ram_save_block(QEMUFile *f) { RAMBlock *block = last_block; ram_addr_t offset = last_offset; @@ -273,7 +273,7 @@ static int block_compar(const void *a, const void *b) return strcmp((*ablock)->idstr, (*bblock)->idstr); } -static void sort_ram_list(void) +void sort_ram_list(void) { RAMBlock *block, *nblock, **blocks; int n; diff --git a/migration.h b/migration.h index 2e9ca2e..8b9509c 100644 --- a/migration.h +++ b/migration.h @@ -76,6 +76,8 @@ uint64_t ram_bytes_remaining(void); uint64_t ram_bytes_transferred(void); uint64_t ram_bytes_total(void); +void sort_ram_list(void); +int ram_save_block(QEMUFile *f); int ram_save_live(QEMUFile *f, int stage, void *opaque); int ram_load(QEMUFile *f, void *opaque, int version_id);