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>
This commit is contained in:
Mark Cave-Ayland 2021-01-28 22:17:28 +00:00
parent f71407ed2f
commit cdf01ca481
1 changed files with 10 additions and 6 deletions

View File

@ -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 */