Patchwork [qom-next,for-next,v2,3/6] vmstate: Introduce VMSTATE_BUFFER_UNSAFE_INFO_TEST()

login
register
mail settings
Submitter Andreas Färber
Date July 29, 2013, 12:26 a.m.
Message ID <1375057621-19961-4-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/262629/
State New
Headers show

Comments

Andreas Färber - July 29, 2013, 12:26 a.m.
To be used by PCIDevice.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 include/migration/vmstate.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch

diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 1c31b5d..3590e1f 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -444,9 +444,10 @@  extern const VMStateInfo vmstate_info_bitmap;
     .start        = (_start),                                        \
 }
 
-#define VMSTATE_BUFFER_UNSAFE_INFO(_field, _state, _version, _info, _size) { \
+#define VMSTATE_BUFFER_UNSAFE_INFO_TEST(_field, _state, _version, _test, _info, _size) { \
     .name       = (stringify(_field)),                               \
     .version_id = (_version),                                        \
+    .field_exists = (_test),                                         \
     .size       = (_size),                                           \
     .info       = &(_info),                                          \
     .flags      = VMS_BUFFER,                                        \
@@ -696,6 +697,9 @@  extern const VMStateInfo vmstate_info_bitmap;
 #define VMSTATE_BUFFER_TEST(_f, _s, _test)                            \
     VMSTATE_STATIC_BUFFER(_f, _s, 0, _test, 0, sizeof(typeof_field(_s, _f)))
 
+#define VMSTATE_BUFFER_UNSAFE_INFO(_field, _state, _version, _info, _size) \
+    VMSTATE_BUFFER_UNSAFE_INFO_TEST(_field, _state, _version, NULL, _info, _size)
+
 #define VMSTATE_BUFFER_UNSAFE(_field, _state, _version, _size)        \
     VMSTATE_BUFFER_UNSAFE_INFO(_field, _state, _version, vmstate_info_buffer, _size)