[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 082/124] vmstate: Create VMSTATE_VARRAY macro
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 082/124] vmstate: Create VMSTATE_VARRAY macro |
Date: |
Mon, 21 Apr 2014 16:41:02 +0200 |
Use it instead of hard-ecoding it on ich9 for GPE.
Signed-off-by: Juan Quintela <address@hidden>
---
hw/acpi/ich9.c | 11 ++---------
include/migration/vmstate.h | 10 ++++++++++
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 407ae89..f4801d1 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -129,15 +129,8 @@ static int ich9_pm_post_load(void *opaque, int version_id)
}
#define VMSTATE_GPE_ARRAY(_field, _state) \
- { \
- .name = (stringify(_field)), \
- .version_id = 0, \
- .num = ICH9_PMIO_GPE0_LEN, \
- .info = &vmstate_info_uint8, \
- .size = sizeof(uint8_t), \
- .flags = VMS_ARRAY | VMS_POINTER, \
- .offset = vmstate_offset_pointer(_state, _field, uint8_t), \
- }
+ VMSTATE_VARRAY(_field, _state, ICH9_PMIO_GPE0_LEN, NULL, \
+ vmstate_info_uint8, uint8)
const VMStateDescription vmstate_ich9_pm = {
.name = "ich9_pm",
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 81268c6..8de6988 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -230,6 +230,16 @@ extern const VMStateInfo vmstate_info_bitmap;
.offset = vmstate_offset_array(_state, _field, _type, _num),\
}
+#define VMSTATE_VARRAY(_field, _state, _num, _test, _info, _type) { \
+ .name = (stringify(_field)), \
+ .field_exists = (_test), \
+ .num = (_num), \
+ .info = &(_info), \
+ .size = sizeof(_type), \
+ .flags = VMS_ARRAY | VMS_POINTER, \
+ .offset = vmstate_offset_pointer(_state, _field, _type),\
+}
+
#define VMSTATE_SUB_ARRAY(_field, _state, _start, _num, _info, _type) { \
.name = (stringify(_field)), \
.num = (_num), \
--
1.9.0
- [Qemu-devel] [PATCH 073/124] vmstate: Remove version parameter from VMSTATE_STRUCT_ARRAY, (continued)
- [Qemu-devel] [PATCH 073/124] vmstate: Remove version parameter from VMSTATE_STRUCT_ARRAY, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 074/124] vmstate: Remove version parameter from VMSTATE_STRUCT_ARRAY_TEST, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 070/124] vmstate: Remove version parameter from VMSTATE_STATIC_BUFFER, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 076/124] vmstate: Remove unused version parameter from VMSTATE_STRUCT_VARRAY_UINT8, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 075/124] vmstate: Remove unused version parameter from VMSTATE_STRUCT_VARRAY_INT32, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 077/124] vmstate: Introduce VMSTATE_VARRAY_UINT32_TEST, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 078/124] vmstate: Remove version parameter from VMSTATE_VARRAY_UINT32, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 079/124] vmstate: Remove version parameter from VMSTATE_STRUCT_TEST, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 080/124] vmstate: Move all users of versioning to VMSTATE_STRUCT_TEST, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 081/124] vmstate: Remove version from all VMSTATE_STRUCT calls, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 082/124] vmstate: Create VMSTATE_VARRAY macro,
Juan Quintela <=
- [Qemu-devel] [PATCH 083/124] vmstate: Create VMSTATE_POINTER_UNSAFE, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 084/124] vmstate: Create VMSTATE_OPENCODED_UNSAFE, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 085/124] vmstate: Create VMSTATE_SYNTHETIC, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 086/124] vmstate: version_id is gone from fields, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 087/124] vmstate: Test for VMSTATE_SYNTHETIC, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 089/124] vmstate: Test for VMSTATE_UINT32_SUB_ARRAY, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 090/124] vmstate: Test for VMSTATE_BUFFER, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 088/124] vmstate: Test for VMSTATE_UINT8_SUB_ARRAY, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 091/124] vmstate: Test for VMSTATE_PARTIAL_BUFFER, Juan Quintela, 2014/04/21