From 8fb0791d30bea0f2ca071ab571e71dfa1cc49085 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Thu, 10 Sep 2009 03:04:32 +0200 Subject: vmstate: Add pre/post_save() hooks Signed-off-by: Juan Quintela Signed-off-by: Anthony Liguori --- savevm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'savevm.c') diff --git a/savevm.c b/savevm.c index 8ae8d16..c4bee37 100644 --- a/savevm.c +++ b/savevm.c @@ -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) -- cgit v1.1