mirror of
https://github.com/qemu/qemu.git
synced 2026-09-23 15:04:20 +00:00
There are a few special cases of vmstate usage: The vmstate_msix and vmstate_scsi_device have fields that contain no data, only a vmstate_info structure. The VMSTATE_VALIDATE macro serves only to invoke the .field_exists routine for validation. Regardless whether these scenarios are valid, add a separate flag to identify them so we can enforce common constraints for the normal vmstates such as having a size greater than zero. Note that n_elems is hardcoded to 1 for all vmstates, except VMS_[V]ARRAY, so VMSTATE_VALIDATE needed to set VMS_ARRAY to be able to force n_elems to 0. This patch now checks the flag at vmstate_n_elems(). Acked-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>