From patchwork Mon Apr 21 14:40:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 341010 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6224614008A for ; Tue, 22 Apr 2014 13:15:28 +1000 (EST) Received: from localhost ([::1]:49417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcFmQ-00042Y-HQ for incoming@patchwork.ozlabs.org; Mon, 21 Apr 2014 11:05:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcFQk-0004Gk-Nc for qemu-devel@nongnu.org; Mon, 21 Apr 2014 10:42:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WcFQe-00043L-Hk for qemu-devel@nongnu.org; Mon, 21 Apr 2014 10:42:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcFQe-00043F-90 for qemu-devel@nongnu.org; Mon, 21 Apr 2014 10:42:40 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3LEgdJm031350 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 Apr 2014 10:42:39 -0400 Received: from trasno.mitica (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3LEfi6i019220; Mon, 21 Apr 2014 10:42:38 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 21 Apr 2014 16:40:18 +0200 Message-Id: <1398091304-10677-39-git-send-email-quintela@redhat.com> In-Reply-To: <1398091304-10677-1-git-send-email-quintela@redhat.com> References: <1398091304-10677-1-git-send-email-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 038/124] vmstate: Test for VMSTATE_UINT16_ARRAY 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 Remove unused VMSTATE_UINT16_ARRAY_V. Signed-off-by: Juan Quintela --- include/migration/vmstate.h | 7 ++----- tests/test-vmstate.c | 6 ++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 19789c4..5935d60 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -609,15 +609,12 @@ extern const VMStateInfo vmstate_info_bitmap; #define VMSTATE_UINT8_ARRAY(_f, _s, _n) \ VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_uint8, uint8_t) -#define VMSTATE_UINT16_ARRAY_V(_f, _s, _n, _v) \ - VMSTATE_ARRAY(_f, _s, _n, _v, vmstate_info_uint16, uint16_t) +#define VMSTATE_UINT16_ARRAY(_f, _s, _n) \ + VMSTATE_ARRAY_TEST(_f, _s, _n, NULL, vmstate_info_uint16, uint16_t) #define VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, _v) \ VMSTATE_2DARRAY(_f, _s, _n1, _n2, _v, vmstate_info_uint16, uint16_t) -#define VMSTATE_UINT16_ARRAY(_f, _s, _n) \ - VMSTATE_UINT16_ARRAY_V(_f, _s, _n, 0) - #define VMSTATE_UINT16_2DARRAY(_f, _s, _n1, _n2) \ VMSTATE_UINT16_2DARRAY_V(_f, _s, _n1, _n2, 0) diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index b2590e3..baf9046 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -514,6 +514,7 @@ typedef struct TestArray { bool b_2[VMSTATE_ARRAY_SIZE]; uint8_t u8_1[VMSTATE_ARRAY_SIZE]; uint8_t u8_2[VMSTATE_ARRAY_SIZE]; + uint16_t u16_1[VMSTATE_ARRAY_SIZE]; } TestArray; TestArray obj_array = { @@ -522,6 +523,7 @@ TestArray obj_array = { .b_2 = { true, false, true, false, true}, .u8_1 = { 1, 2, 3, 4, 5}, .u8_2 = { 5, 4, 3, 2, 1}, + .u16_1 = {11, 12, 13, 14, 15}, }; static const VMStateDescription vmstate_array_primitive = { @@ -533,6 +535,7 @@ static const VMStateDescription vmstate_array_primitive = { VMSTATE_INT32_EQUAL(size, TestArray), VMSTATE_BOOL_ARRAY(b_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_UINT8_ARRAY(u8_1, TestArray, VMSTATE_ARRAY_SIZE), + VMSTATE_UINT16_ARRAY(u16_1, TestArray, VMSTATE_ARRAY_SIZE), VMSTATE_END_OF_LIST() } }; @@ -541,6 +544,7 @@ uint8_t wire_array_primitive[] = { /* size */ 0x00, 0x00, 0x00, 0x05, /* b_1 */ 0x00, 0x01, 0x00, 0x01, 0x00, /* u8_1 */ 0x01, 0x02, 0x03, 0x04, 0x05, + /* u16_1 */ 0x00, 0x0b, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0x0e, 0x00, 0x0f, QEMU_VM_EOF, /* just to ensure we won't get EOF reported prematurely */ }; @@ -557,6 +561,7 @@ static void obj_array_copy(void *arg1, void *arg2) target->b_2[i] = source->b_2[i]; target->u8_1[i] = source->u8_1[i]; target->u8_2[i] = source->u8_2[i]; + target->u16_1[i] = source->u16_1[i]; } } @@ -587,6 +592,7 @@ static void test_array_primitive(void) ELEM_EQUAL(b_1, i); ELEM_EQUAL(u8_1, i); ELEM_NOT_EQUAL(u8_2, i); + ELEM_EQUAL(u16_1, i); } }