aboutsummaryrefslogtreecommitdiff
path: root/hw/hw.h
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2011-03-10 12:33:56 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2011-03-10 16:12:26 -0600
commitf6317a6ef16841d9d4a90e3aa664f715e26f978c (patch)
treef123312ee3aba1c224f21a4a1d069ab5b8abcd8b /hw/hw.h
parent639f49b60cc399d753409734b011359fb71d8f7d (diff)
downloadqemu-f6317a6ef16841d9d4a90e3aa664f715e26f978c.zip
qemu-f6317a6ef16841d9d4a90e3aa664f715e26f978c.tar.gz
qemu-f6317a6ef16841d9d4a90e3aa664f715e26f978c.tar.bz2
vmstate: move timers to use test instead of version
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.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/hw/hw.h b/hw/hw.h
index 4e09f18..1b09039 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -399,6 +399,15 @@ extern const VMStateInfo vmstate_info_unused_buffer;
.offset = vmstate_offset_value(_state, _field, _type), \
}
+#define VMSTATE_POINTER_TEST(_field, _state, _test, _info, _type) { \
+ .name = (stringify(_field)), \
+ .info = &(_info), \
+ .field_exists = (_test), \
+ .size = sizeof(_type), \
+ .flags = VMS_SINGLE|VMS_POINTER, \
+ .offset = vmstate_offset_value(_state, _field, _type), \
+}
+
#define VMSTATE_ARRAY(_field, _state, _num, _version, _info, _type) {\
.name = (stringify(_field)), \
.version_id = (_version), \
@@ -766,11 +775,11 @@ extern const VMStateDescription vmstate_usb_device;
#define VMSTATE_UINT32_TEST(_f, _s, _t) \
VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_info_uint32, uint32_t)
-#define VMSTATE_TIMER_V(_f, _s, _v) \
- VMSTATE_POINTER(_f, _s, _v, vmstate_info_timer, QEMUTimer *)
+#define VMSTATE_TIMER_TEST(_f, _s, _test) \
+ VMSTATE_POINTER_TEST(_f, _s, _test, vmstate_info_timer, QEMUTimer *)
#define VMSTATE_TIMER(_f, _s) \
- VMSTATE_TIMER_V(_f, _s, 0)
+ VMSTATE_TIMER_TEST(_f, _s, NULL)
#define VMSTATE_TIMER_ARRAY(_f, _s, _n) \
VMSTATE_ARRAY_OF_POINTER(_f, _s, _n, 0, vmstate_info_timer, QEMUTimer *)