summaryrefslogtreecommitdiffstats
path: root/include/qemu
diff options
context:
space:
mode:
authorMark Cave-Ayland2021-01-28 23:17:28 +0100
committerMark Cave-Ayland2021-02-07 21:38:34 +0100
commitcdf01ca4810203e229bcac822b42eba58e1abbf9 (patch)
treec61eff2b9cd95e3f7efb96281d52cba4ca2c9c06 /include/qemu
parentutils/fifo8: change fatal errors from abort() to assert() (diff)
downloadqemu-cdf01ca4810203e229bcac822b42eba58e1abbf9.tar.gz
qemu-cdf01ca4810203e229bcac822b42eba58e1abbf9.tar.xz
qemu-cdf01ca4810203e229bcac822b42eba58e1abbf9.zip
utils/fifo8: add VMSTATE_FIFO8_TEST macro
Rewrite the existing VMSTATE_FIFO8 macro to use VMSTATE_FIFO8_TEST as per the standard pattern in include/migration/vmstate.h. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20210128221728.14887-3-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/fifo8.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/qemu/fifo8.h b/include/qemu/fifo8.h
index 489c354291..28bf2cee57 100644
--- a/include/qemu/fifo8.h
+++ b/include/qemu/fifo8.h
@@ -148,12 +148,16 @@ uint32_t fifo8_num_used(Fifo8 *fifo);
extern const VMStateDescription vmstate_fifo8;
-#define VMSTATE_FIFO8(_field, _state) { \
- .name = (stringify(_field)), \
- .size = sizeof(Fifo8), \
- .vmsd = &vmstate_fifo8, \
- .flags = VMS_STRUCT, \
- .offset = vmstate_offset_value(_state, _field, Fifo8), \
+#define VMSTATE_FIFO8_TEST(_field, _state, _test) { \
+ .name = (stringify(_field)), \
+ .field_exists = (_test), \
+ .size = sizeof(Fifo8), \
+ .vmsd = &vmstate_fifo8, \
+ .flags = VMS_STRUCT, \
+ .offset = vmstate_offset_value(_state, _field, Fifo8), \
}
+#define VMSTATE_FIFO8(_field, _state) \
+ VMSTATE_FIFO8_TEST(_field, _state, NULL)
+
#endif /* QEMU_FIFO8_H */