vmstate: Add pre_load() hook
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/savevm.c b/savevm.c
index 38f9946..8ae8d16 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1028,6 +1028,11 @@
if (version_id < vmsd->minimum_version_id) {
return vmsd->load_state_old(f, opaque, version_id);
}
+ if (vmsd->pre_load) {
+ int ret = vmsd->pre_load(opaque);
+ if (ret)
+ return ret;
+ }
while(field->name) {
if (field->version_id <= version_id) {
void *base_addr = opaque + field->offset;