Patchwork [02/16] vmstate: Add support for partial buffers transmission

login
register
mail settings
Submitter Juan Quintela
Date Oct. 14, 2009, 5:34 p.m.
Message ID <a3a7188ee20a66e6c5bbfdfe9e867b3cc5e63e27.1255541443.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/36000/
State New
Headers show

Comments

Juan Quintela - Oct. 14, 2009, 5:34 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/hw.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/hw.h b/hw/hw.h
index 8c223f8..6f7b7d4 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -464,6 +464,16 @@  extern const VMStateInfo vmstate_info_buffer;
         + type_check_array(uint8_t,typeof_field(_state, _field),sizeof(typeof_field(_state,_field))) \
 }

+#define VMSTATE_PARTIAL_BUFFER(_field, _state, _version, _size) {    \
+    .name       = (stringify(_field)),                               \
+    .version_id = (_version),                                        \
+    .size       = (_size),                                           \
+    .info       = &vmstate_info_buffer,                              \
+    .flags      = VMS_BUFFER,                                        \
+    .offset     = offsetof(_state, _field)                           \
+        + type_check_array(uint8_t,typeof_field(_state, _field),sizeof(typeof_field(_state,_field))) \
+}
+
 #define VMSTATE_BUFFER_START_MIDDLE(_field, _state, start) {         \
     .name       = (stringify(_field)),                               \
     .size       = sizeof(typeof_field(_state,_field)) - start,       \