summaryrefslogtreecommitdiff
path: root/hw/hw.h
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-10-19 15:46:28 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:28:51 -0500
commit76507c754831bc6c01cc010255b992c7c9b57742 (patch)
tree7387e4d540e9a7ff1ee0c0aae82d6e3e141be4b9 /hw/hw.h
parentd4829d49920e123ce016a087571070268d6e8b2a (diff)
downloadqemu-76507c754831bc6c01cc010255b992c7c9b57742.tar.gz
vmstate: Add VMSTATE_BUFFER_UNUSED
It allows to have 'things' in savevm format not backed in the device state Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/hw.h')
-rw-r--r--hw/hw.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/hw.h b/hw/hw.h
index 4af0fd8370..f3b5160a4d 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -335,6 +335,7 @@ extern const VMStateInfo vmstate_info_uint64;
extern const VMStateInfo vmstate_info_timer;
extern const VMStateInfo vmstate_info_ptimer;
extern const VMStateInfo vmstate_info_buffer;
+extern const VMStateInfo vmstate_info_unused_buffer;
#define type_check_array(t1,t2,n) ((t1(*)[n])0 - (t2*)0)
#define type_check_pointer(t1,t2) ((t1**)0 - (t2*)0)
@@ -471,6 +472,14 @@ extern const VMStateInfo vmstate_info_buffer;
.offset = vmstate_offset_buffer(_state, _field) + _start, \
}
+#define VMSTATE_UNUSED_BUFFER(_test, _version, _size) { \
+ .name = "unused", \
+ .field_exists = (_test), \
+ .version_id = (_version), \
+ .size = (_size), \
+ .info = &vmstate_info_unused_buffer, \
+ .flags = VMS_BUFFER, \
+}
extern const VMStateDescription vmstate_pci_device;
#define VMSTATE_PCI_DEVICE(_field, _state) { \
@@ -621,6 +630,15 @@ extern const VMStateDescription vmstate_i2c_slave;
#define VMSTATE_BUFFER_TEST(_f, _s, _test) \
VMSTATE_STATIC_BUFFER(_f, _s, 0, _test, 0, sizeof(typeof_field(_s, _f)))
+#define VMSTATE_UNUSED_V(_v, _size) \
+ VMSTATE_UNUSED_BUFFER(NULL, _v, _size)
+
+#define VMSTATE_UNUSED(_size) \
+ VMSTATE_UNUSED_V(0, _size)
+
+#define VMSTATE_UNUSED_TEST(_test, _size) \
+ VMSTATE_UNUSED_BUFFER(_test, 0, _size)
+
#ifdef NEED_CPU_H
#if TARGET_LONG_BITS == 64
#define VMSTATE_UINTTL_V(_f, _s, _v) \