From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: Juan Quintela <quintela@redhat.com>
Subject: [PATCH v2 70/71] tests/unit/test-vmstate: Constify VMState
Date: Thu, 21 Dec 2023 14:16:51 +1100 [thread overview]
Message-ID: <20231221031652.119827-71-richard.henderson@linaro.org> (raw)
In-Reply-To: <20231221031652.119827-1-richard.henderson@linaro.org>
While const data in tests is not particularly important,
this makes a grep test clear across the tree.
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tests/unit/test-vmstate.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/tests/unit/test-vmstate.c b/tests/unit/test-vmstate.c
index 0b7d5ecd68..c4f9faa273 100644
--- a/tests/unit/test-vmstate.c
+++ b/tests/unit/test-vmstate.c
@@ -197,7 +197,7 @@ static const VMStateDescription vmstate_simple_primitive = {
.name = "simple/primitive",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_BOOL(b_1, TestSimple),
VMSTATE_BOOL(b_2, TestSimple),
VMSTATE_UINT8(u8_1, TestSimple),
@@ -299,7 +299,7 @@ static const VMStateDescription vmstate_simple_arr = {
.name = "simple/array",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT16_ARRAY(u16_1, TestSimpleArray, 3),
VMSTATE_END_OF_LIST()
}
@@ -341,7 +341,7 @@ static const VMStateDescription vmstate_versioned = {
.name = "test/versioned",
.version_id = 2,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(a, TestStruct),
VMSTATE_UINT32_V(b, TestStruct, 2), /* Versioned field in the middle, so
* we catch bugs more easily.
@@ -412,7 +412,7 @@ static const VMStateDescription vmstate_skipping = {
.name = "test/skip",
.version_id = 2,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(a, TestStruct),
VMSTATE_UINT32(b, TestStruct),
VMSTATE_UINT32_TEST(c, TestStruct, test_skip),
@@ -524,7 +524,7 @@ const VMStateDescription vmsd_tst = {
.name = "test/tst",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_INT32(i, TestStructTriv),
VMSTATE_END_OF_LIST()
}
@@ -542,7 +542,7 @@ const VMStateDescription vmsd_arps = {
.name = "test/arps",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_ARRAY_OF_POINTER_TO_STRUCT(ar, TestArrayOfPtrToStuct,
AR_SIZE, 0, vmsd_tst, TestStructTriv),
VMSTATE_END_OF_LIST()
@@ -630,7 +630,7 @@ const VMStateDescription vmsd_arpp = {
.name = "test/arps",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_ARRAY_OF_POINTER(ar, TestArrayOfPtrToInt,
AR_SIZE, 0, vmstate_info_int32, int32_t*),
VMSTATE_END_OF_LIST()
@@ -685,7 +685,7 @@ static const VMStateDescription vmstate_q_element = {
.name = "test/queue-element",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_BOOL(b, TestQtailqElement),
VMSTATE_UINT8(u8, TestQtailqElement),
VMSTATE_END_OF_LIST()
@@ -696,7 +696,7 @@ static const VMStateDescription vmstate_q = {
.name = "test/queue",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_INT16(i16, TestQtailq),
VMSTATE_QTAILQ_V(q, TestQtailq, 1, vmstate_q_element, TestQtailqElement,
next),
@@ -821,7 +821,7 @@ typedef struct TestGTreeInterval {
.name = "interval", \
.version_id = 1, \
.minimum_version_id = 1, \
- .fields = (VMStateField[]) { \
+ .fields = (const VMStateField[]) { \
VMSTATE_UINT64(low, TestGTreeInterval), \
VMSTATE_UINT64(high, TestGTreeInterval), \
VMSTATE_END_OF_LIST() \
@@ -839,7 +839,7 @@ typedef struct TestGTreeMapping {
.name = "mapping", \
.version_id = 1, \
.minimum_version_id = 1, \
- .fields = (VMStateField[]) { \
+ .fields = (const VMStateField[]) { \
VMSTATE_UINT64(phys_addr, TestGTreeMapping), \
VMSTATE_UINT32(flags, TestGTreeMapping), \
VMSTATE_END_OF_LIST() \
@@ -915,7 +915,7 @@ static const VMStateDescription vmstate_domain = {
.version_id = 1,
.minimum_version_id = 1,
.pre_load = domain_preload,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_INT32(id, TestGTreeDomain),
VMSTATE_GTREE_V(mappings, TestGTreeDomain, 1,
vmstate_interval_mapping,
@@ -940,7 +940,7 @@ static const VMStateDescription vmstate_qlist_element = {
.name = "test/queue list",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(id, TestQListElement),
VMSTATE_END_OF_LIST()
}
@@ -951,7 +951,7 @@ static const VMStateDescription vmstate_iommu = {
.version_id = 1,
.minimum_version_id = 1,
.pre_load = iommu_preload,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_INT32(id, TestGTreeIOMMU),
VMSTATE_GTREE_DIRECT_KEY_V(domains, TestGTreeIOMMU, 1,
&vmstate_domain, TestGTreeDomain),
@@ -963,7 +963,7 @@ static const VMStateDescription vmstate_container = {
.name = "test/container/qlist",
.version_id = 1,
.minimum_version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(id, TestQListContainer),
VMSTATE_QLIST_V(list, TestQListContainer, 1, vmstate_qlist_element,
TestQListElement, next),
@@ -1414,7 +1414,7 @@ static int tmp_child_post_load(void *opaque, int version_id)
static const VMStateDescription vmstate_tmp_back_to_parent = {
.name = "test/tmp_child_parent",
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT64(f, TestStruct),
VMSTATE_END_OF_LIST()
}
@@ -1424,7 +1424,7 @@ static const VMStateDescription vmstate_tmp_child = {
.name = "test/tmp_child",
.pre_save = tmp_child_pre_save,
.post_load = tmp_child_post_load,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_INT64(diff, TmpTestStruct),
VMSTATE_STRUCT_POINTER(parent, TmpTestStruct,
vmstate_tmp_back_to_parent, TestStruct),
@@ -1435,7 +1435,7 @@ static const VMStateDescription vmstate_tmp_child = {
static const VMStateDescription vmstate_with_tmp = {
.name = "test/with_tmp",
.version_id = 1,
- .fields = (VMStateField[]) {
+ .fields = (const VMStateField[]) {
VMSTATE_UINT32(a, TestStruct),
VMSTATE_UINT64(d, TestStruct),
VMSTATE_WITH_TMP(TestStruct, TmpTestStruct, vmstate_tmp_child),
--
2.34.1
next prev parent reply other threads:[~2023-12-21 3:25 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-21 3:15 [PATCH v2 00/71] *: Constify VMState Richard Henderson
2023-12-21 3:15 ` [PATCH v2 01/71] migration: Make VMStateDescription.subsections const Richard Henderson
2023-12-21 3:15 ` [PATCH v2 02/71] target/arm: Constify VMState in machine.c Richard Henderson
2023-12-21 3:15 ` [PATCH v2 03/71] target/arm: Constify hvf/hvf.c Richard Henderson
2023-12-21 3:15 ` [PATCH v2 04/71] target/alpha: Constify VMState in machine.c Richard Henderson
2023-12-21 3:15 ` [PATCH v2 05/71] target/avr: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 06/71] target/cris: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 07/71] target/hppa: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 08/71] target/i386: " Richard Henderson
2023-12-22 2:51 ` Zhao Liu
2023-12-21 3:15 ` [PATCH v2 09/71] target/loongarch: " Richard Henderson
2023-12-21 6:43 ` gaosong
2023-12-21 3:15 ` [PATCH v2 10/71] target/m68k: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 11/71] target/microblaze: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 12/71] target/mips: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 13/71] target/openrisc: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 14/71] target/ppc: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 15/71] target/riscv: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 16/71] target/s390x: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 17/71] target/sparc: " Richard Henderson
2023-12-21 3:15 ` [PATCH v2 18/71] hw/arm: Constify VMState Richard Henderson
2023-12-21 3:16 ` [PATCH v2 19/71] hw/core: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 20/71] hw/9pfs: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 21/71] hw/acpi: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 22/71] hw/adc: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 23/71] hw/audio: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 24/71] hw/block: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 25/71] hw/char: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 26/71] hw/display: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 27/71] hw/dma: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 28/71] hw/gpio: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 29/71] hw/hyperv: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 30/71] hw/i2c: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 31/71] hw/i386: " Richard Henderson
2023-12-22 2:54 ` Zhao Liu
2023-12-21 3:16 ` [PATCH v2 32/71] hw/ide: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 33/71] hw/input: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 34/71] hw/intc: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 35/71] hw/ipack: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 36/71] hw/ipmi: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 37/71] hw/isa: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 38/71] hw/loongarch: " Richard Henderson
2023-12-21 6:44 ` gaosong
2023-12-21 3:16 ` [PATCH v2 39/71] hw/m68k: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 40/71] hw/misc: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 41/71] hw/net: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 42/71] hw/nvram: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 43/71] hw/openrisc: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 44/71] hw/pci: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 45/71] hw/pci-bridge: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 46/71] hw/pci-host: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 47/71] hw/ppc: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 48/71] hw/riscv: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 49/71] hw/rtc: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 50/71] hw/s390x: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 51/71] hw/scsi: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 52/71] hw/sd: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 53/71] hw/sensor: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 54/71] hw/sparc: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 55/71] hw/ssi: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 56/71] hw/timer: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 57/71] hw/tpm: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 58/71] hw/usb: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 59/71] hw/vfio: " Richard Henderson
2023-12-21 8:14 ` Cédric Le Goater
2023-12-21 3:16 ` [PATCH v2 60/71] hw/virtio: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 61/71] hw/watchdog: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 62/71] hw/misc/macio: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 63/71] audio: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 64/71] backends: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 65/71] cpu-target: " Richard Henderson
2023-12-22 2:55 ` Zhao Liu
2023-12-21 3:16 ` [PATCH v2 66/71] migration: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 67/71] system: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 68/71] replay: " Richard Henderson
2023-12-21 3:16 ` [PATCH v2 69/71] util/fifo8: " Richard Henderson
2023-12-21 3:16 ` Richard Henderson [this message]
2023-12-21 3:16 ` [PATCH v2 71/71] docs: Constify VMstate in examples Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231221031652.119827-71-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).