In an attempt to provide a generic solution for this set of issues, this adds a way to add validators in the middle of the structure.
On failure, we assert on output (should never happen) and fail migration on input. The last patch in the series shows how the new infrastructure is used. I'll wait a bit for feedback, if there's none I'll go ahead and use this to fix the state loading CVEs. Changes from v2: address comments by dgilbert Michael S. Tsirkin (3): vmstate: add VMS_MUST_EXIST vmstate: add VMSTATE_TEST hpet: fix buffer overrun on invalid state load include/migration/vmstate.h | 7 +++++++ hw/timer/hpet.c | 13 +++++++++++++ vmstate.c | 10 ++++++++++ 3 files changed, 30 insertions(+) -- MST