diff mbox

[1/2] vmstate: Add VMSTATE_BUFFER_UNSAFE

Message ID 66e892f9cc8b3f13b11b2a516cd8ba658be4d487.1256054223.git.quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Oct. 20, 2009, 3:59 p.m. UTC
Just sent <anything> as a buffer.  We put the pointer and the size
code does the rest.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/hw.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/hw/hw.h b/hw/hw.h
index b98f0c9..9e6ef09 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -484,6 +484,15 @@  extern const VMStateInfo vmstate_info_unused_buffer;
     .offset     = vmstate_offset_buffer(_state, _field) + _start,    \
 }

+#define VMSTATE_BUFFER_UNSAFE(_field, _state, _version, _size) {     \
+    .name       = (stringify(_field)),                               \
+    .version_id = (_version),                                        \
+    .size       = (_size),                                           \
+    .info       = &vmstate_info_buffer,                              \
+    .flags      = VMS_BUFFER,                                        \
+    .offset     = offsetof(_state, _field),                          \
+}
+
 #define VMSTATE_UNUSED_BUFFER(_test, _version, _size) {              \
     .name         = "unused",                                        \
     .field_exists = (_test),                                         \