vmstate: Add pre/post_save() hooks

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 8ae8d16..c4bee37 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1073,6 +1073,9 @@
 {
     VMStateField *field = vmsd->fields;
 
+    if (vmsd->pre_save) {
+        vmsd->pre_save(opaque);
+    }
     while(field->name) {
         const void *base_addr = opaque + field->offset;
         int i, n_elems = 1;
@@ -1096,6 +1099,9 @@
         }
         field++;
     }
+    if (vmsd->post_save) {
+        vmsd->post_save(opaque);
+    }
 }
 
 static int vmstate_load(QEMUFile *f, SaveStateEntry *se, int version_id)