From patchwork Mon Jun 4 09:57:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 162736 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 5B3ACB6FAB for ; Mon, 4 Jun 2012 21:16:13 +1000 (EST) Received: from localhost ([::1]:41669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbU5G-00034T-2h for incoming@patchwork.ozlabs.org; Mon, 04 Jun 2012 06:00:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbU30-0008T0-Tt for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:58:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbU2r-0004dV-AZ for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:58:02 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:46513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbU2q-0004bV-SO for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:57:53 -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 8231748987; Mon, 4 Jun 2012 18:57:45 +0900 (JST) Received: (nullmailer pid 5119 invoked by uid 1000); Mon, 04 Jun 2012 09:57:45 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kvm@vger.kernel.org Date: Mon, 4 Jun 2012 18:57:17 +0900 Message-Id: <0844fe9b2dc3e3e008d122c57148d0f8ac3cd5c5.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 15/41] savevm: export qemu_peek_buffer, qemu_peek_byte, qemu_file_skip 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 Those will be used by postcopy. Signed-off-by: Isaku Yamahata --- qemu-file.h | 3 +++ savevm.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qemu-file.h b/qemu-file.h index 31b83f6..a285bef 100644 --- a/qemu-file.h +++ b/qemu-file.h @@ -88,6 +88,9 @@ void qemu_put_be32(QEMUFile *f, unsigned int v); void qemu_put_be64(QEMUFile *f, uint64_t v); int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size); int qemu_get_byte(QEMUFile *f); +int qemu_peek_byte(QEMUFile *f, int offset); +int qemu_peek_buffer(QEMUFile *f, uint8_t *buf, int size, size_t offset); +void qemu_file_skip(QEMUFile *f, int size); static inline unsigned int qemu_get_ubyte(QEMUFile *f) { diff --git a/savevm.c b/savevm.c index 2d18bab..8ad843f 100644 --- a/savevm.c +++ b/savevm.c @@ -588,14 +588,14 @@ void qemu_put_byte(QEMUFile *f, int v) qemu_fflush(f); } -static void qemu_file_skip(QEMUFile *f, int size) +void qemu_file_skip(QEMUFile *f, int size) { if (f->buf_index + size <= f->buf_size) { f->buf_index += size; } } -static int qemu_peek_buffer(QEMUFile *f, uint8_t *buf, int size, size_t offset) +int qemu_peek_buffer(QEMUFile *f, uint8_t *buf, int size, size_t offset) { int pending; int index; @@ -643,7 +643,7 @@ int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size) return done; } -static int qemu_peek_byte(QEMUFile *f, int offset) +int qemu_peek_byte(QEMUFile *f, int offset) { int index = f->buf_index + offset;