From patchwork Thu Jul 31 12:55:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Dovgalyuk X-Patchwork-Id: 375261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 55A40140108 for ; Thu, 31 Jul 2014 23:01:40 +1000 (EST) Received: from localhost ([::1]:56376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCpzG-0000CS-DT for incoming@patchwork.ozlabs.org; Thu, 31 Jul 2014 09:01:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCpsx-0006G3-8M for qemu-devel@nongnu.org; Thu, 31 Jul 2014 08:55:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCpsr-0005RR-4W for qemu-devel@nongnu.org; Thu, 31 Jul 2014 08:55:07 -0400 Received: from mail.ispras.ru ([83.149.199.45]:54662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCpsq-0005RN-Sp for qemu-devel@nongnu.org; Thu, 31 Jul 2014 08:55:01 -0400 Received: from PASHA-ISP.novsu.ac.ru (unknown [80.250.189.177]) by mail.ispras.ru (Postfix) with ESMTPSA id 063E8540157; Thu, 31 Jul 2014 16:55:00 +0400 (MSK) To: qemu-devel@nongnu.org From: Pavel Dovgalyuk Date: Thu, 31 Jul 2014 16:55:03 +0400 Message-ID: <20140731125503.1600.77766.stgit@PASHA-ISP.novsu.ac.ru> In-Reply-To: <20140731125321.1600.46604.stgit@PASHA-ISP.novsu.ac.ru> References: <20140731125321.1600.46604.stgit@PASHA-ISP.novsu.ac.ru> User-Agent: StGit/0.16 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 83.149.199.45 Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, pavel.dovgaluk@ispras.ru, pbonzini@redhat.com, afaerber@suse.de, fred.konrad@greensocs.com Subject: [Qemu-devel] [RFC PATCH v3 17/49] migration: add vmstate for int8 and char arrays 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 patch adds macros for vmstate int8 and char arrays. Signed-off-by: Pavel Dovgalyuk --- include/migration/vmstate.h | 13 +++++++++++++ vmstate.c | 6 ++++++ 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 9a001bd..2f7207b 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -143,6 +143,7 @@ extern const VMStateDescription vmstate_dummy; #endif extern const VMStateInfo vmstate_info_bool; +extern const VMStateInfo vmstate_info_char; extern const VMStateInfo vmstate_info_int8; extern const VMStateInfo vmstate_info_int16; @@ -694,6 +695,18 @@ extern const VMStateInfo vmstate_info_bitmap; #define VMSTATE_UINT64_ARRAY(_f, _s, _n) \ VMSTATE_UINT64_ARRAY_V(_f, _s, _n, 0) +#define VMSTATE_INT8_ARRAY_V(_f, _s, _n, _v) \ + VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int8, int8_t) + +#define VMSTATE_INT8_ARRAY(_f, _s, _n) \ + VMSTATE_INT8_ARRAY_V(_f, _s, _n, 0) + +#define VMSTATE_CHAR_ARRAY_V(_f, _s, _n, _v) \ + VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_char, char) + +#define VMSTATE_CHAR_ARRAY(_f, _s, _n) \ + VMSTATE_CHAR_ARRAY_V(_f, _s, _n, 0) + #define VMSTATE_INT16_ARRAY_V(_f, _s, _n, _v) \ VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_int16, int16_t) diff --git a/vmstate.c b/vmstate.c index ef2f87b..6a7f7c2 100644 --- a/vmstate.c +++ b/vmstate.c @@ -286,6 +286,12 @@ const VMStateInfo vmstate_info_int8 = { .put = put_int8, }; +const VMStateInfo vmstate_info_char = { + .name = "char", + .get = get_int8, + .put = put_int8, +}; + /* 16 bit int */ static int get_int16(QEMUFile *f, void *pv, size_t size)