From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7jlg-00015a-FB for qemu-devel@nongnu.org; Thu, 17 Jul 2014 07:22:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7jlZ-0003HW-O1 for qemu-devel@nongnu.org; Thu, 17 Jul 2014 07:22:32 -0400 Received: from mail.ispras.ru ([83.149.199.45]:47439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7jTN-00051M-Ky for qemu-devel@nongnu.org; Thu, 17 Jul 2014 07:03:37 -0400 From: Pavel Dovgalyuk Date: Thu, 17 Jul 2014 15:03:40 +0400 Message-ID: <20140717110340.8352.76904.stgit@PASHA-ISP> In-Reply-To: <20140717110153.8352.80175.stgit@PASHA-ISP> References: <20140717110153.8352.80175.stgit@PASHA-ISP> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC PATCH v2 18/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, pavel.dovgaluk@ispras.ru, pbonzini@redhat.com, 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)