diff options
author | Juan Quintela <quintela@redhat.com> | 2009-09-10 03:04:32 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-09-11 11:10:05 -0500 |
commit | 8fb0791d30bea0f2ca071ab571e71dfa1cc49085 (patch) | |
tree | b51c8f0a366b01b5e839a63fbc5f66ffdccff2a4 /savevm.c | |
parent | fd4d52deab2b1e13c559fd8e4ed4d5eb515f30cb (diff) |
vmstate: Add pre/post_save() hooks
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r-- | savevm.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1073,6 +1073,9 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, { 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 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, } field++; } + if (vmsd->post_save) { + vmsd->post_save(opaque); + } } static int vmstate_load(QEMUFile *f, SaveStateEntry *se, int version_id) |