[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 56/59] Add VMSTATE_STRUCT_VARRAY_KNOWN
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 56/59] Add VMSTATE_STRUCT_VARRAY_KNOWN |
Date: |
Sat, 9 Jan 2016 23:42:11 +0200 |
From: "Dr. David Alan Gilbert" <address@hidden>
At the moment we have VMSTATE_STRUCT_ARRAY that requires
the field is declared as an array of fixed size.
We also have VMSTATE_STRUCT_VARRAY_UINT* that allows
a field declared as a pointer, but requires that the length
is a field member in the structure being loaded/saved.
VMSTATE_STRUCT_VARRAY_KNOWN is for arrays defined as pointers
yet we somehow know the length of.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Amit Shah <address@hidden>
---
include/migration/vmstate.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 7267e38..97d44d3 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -374,6 +374,19 @@ extern const VMStateInfo vmstate_info_bitmap;
.offset = vmstate_offset_array(_state, _field, _type, _num),\
}
+/* a variable length array (i.e. _type *_field) but we know the
+ * length
+ */
+#define VMSTATE_STRUCT_VARRAY_KNOWN(_field, _state, _num, _version, _vmsd,
_type) { \
+ .name = (stringify(_field)), \
+ .num = (_num), \
+ .version_id = (_version), \
+ .vmsd = &(_vmsd), \
+ .size = sizeof(_type), \
+ .flags = VMS_STRUCT|VMS_ARRAY, \
+ .offset = offsetof(_state, _field), \
+}
+
#define VMSTATE_STRUCT_VARRAY_UINT8(_field, _state, _field_num, _version,
_vmsd, _type) { \
.name = (stringify(_field)), \
.num_offset = vmstate_offset_value(_state, _field_num, uint8_t), \
--
MST
- [Qemu-devel] [PULL v2 46/59] pc: acpi: q35: move _PRT() into SSDT, (continued)
- [Qemu-devel] [PULL v2 46/59] pc: acpi: q35: move _PRT() into SSDT, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 45/59] pc: acpi: q35: move ISA bridge into SSDT, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 47/59] pc: acpi: q35: move PRTA routing table into SSDT, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 49/59] pc: acpi: q35: move _PIC() method into SSDT, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 48/59] pc: acpi: q35: move PRTP routing table into SSDT, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 50/59] pc: acpi: q35: move PCI0._OSC() method into SSDT, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 51/59] pc: acpi: q35: move PCI0 device definition into SSDT, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 52/59] pc: acpi: q35: PCST, PCSB opregions and PCIB field into SSDT, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 53/59] pc: acpi: switch to AML API composed DSDT, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 55/59] i386/pc: expose identifying the floppy controller, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 56/59] Add VMSTATE_STRUCT_VARRAY_KNOWN,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 57/59] migration/virtio: Remove simple .get/.put use, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 58/59] ivshmem: Store file descriptor for vhost-user negotiation, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 59/59] virtio: fix error message for number of queues, Michael S. Tsirkin, 2016/01/09
- [Qemu-devel] [PULL v2 54/59] pc: acpi: remove unused ASL templates and related blobs/utils, Michael S. Tsirkin, 2016/01/09
- Re: [Qemu-devel] [PULL v2 00/59] acpi dsdt rework, misc fixes, Peter Maydell, 2016/01/11