[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 083/124] vmstate: Create VMSTATE_POINTER_UNSAFE
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 083/124] vmstate: Create VMSTATE_POINTER_UNSAFE |
Date: |
Mon, 21 Apr 2014 16:41:03 +0200 |
And use it on piix4 acpi.
Comment asks for why this things happen!
Signed-off-by: Juan Quintela <address@hidden>
---
hw/acpi/piix4.c | 15 +++++++--------
include/migration/vmstate.h | 8 ++++++++
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 527a5c8..267b611 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -163,15 +163,14 @@ static int vmstate_acpi_post_load(void *opaque, int
version_id)
return 0;
}
+/*
+ * Comment goes here why we are sending a uint16_t value through an
+ * uint8_t pointer. And why we call it an array, when we only sent
+ * a single value.
+ */
+
#define VMSTATE_GPE_ARRAY(_field, _state) \
- { \
- .name = (stringify(_field)), \
- .version_id = 0, \
- .info = &vmstate_info_uint16, \
- .size = sizeof(uint16_t), \
- .flags = VMS_SINGLE | VMS_POINTER, \
- .offset = vmstate_offset_pointer(_state, _field, uint8_t), \
- }
+ VMSTATE_POINTER_UNSAFE(_field, _state, vmstate_info_uint16, uint16_t)
static const VMStateDescription vmstate_gpe = {
.name = "gpe",
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 8de6988..a83aba9 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -210,6 +210,14 @@ extern const VMStateInfo vmstate_info_bitmap;
.offset = vmstate_offset_value(_state, _field, _type), \
}
+#define VMSTATE_POINTER_UNSAFE(_field, _state, _info, _type) { \
+ .name = (stringify(_field)), \
+ .info = &(_info), \
+ .size = sizeof(_type), \
+ .flags = VMS_SINGLE|VMS_POINTER, \
+ .offset = offsetof(_state, _field), \
+}
+
#define VMSTATE_2DARRAY(_field, _state, _n1, _n2, _test, _info, _type) { \
.name = (stringify(_field)), \
.field_exists = (_test), \
--
1.9.0
- [Qemu-devel] [PATCH 070/124] vmstate: Remove version parameter from VMSTATE_STATIC_BUFFER, (continued)
- [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, 2014/04/21
- [Qemu-devel] [PATCH 083/124] vmstate: Create VMSTATE_POINTER_UNSAFE,
Juan Quintela <=
- [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
- [Qemu-devel] [PATCH 093/124] vmstate: Test for VMSTATE_BUFFER_TEST, Juan Quintela, 2014/04/21
- [Qemu-devel] [PATCH 094/124] vmstate: Use VMSTATE_UINT8_2DARRAY instead of VMSTATE_BUFFER_TEST, Juan Quintela, 2014/04/21