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 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> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC PATCH v3 17/49] migration: add vmstate for int8 and char arrays List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 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)