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. Michael S. Tsirkin (5): vmstate: reduce code duplication vmstate: add VMS_NONE vmstate: add VMS_MUST_EXIST vmstate: add VMSTATE_TEST hpet: fix buffer overrun on invalid state load include/migration/vmstate.h | 8 ++++ hw/timer/hpet.c | 17 +++++++ vmstate.c | 107 +++++++++++++++++++++++++------------------- 3 files changed, 87 insertions(+), 45 deletions(-) -- MST