Patchwork [22/23] Add VMState support to run a function after load

login
register
mail settings
Submitter Juan Quintela
Date Aug. 20, 2009, 5:42 p.m.
Message ID <34fac607f3c2ef0ac14b0425cf089fdb1028d05d.1250788880.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/31769/
State Superseded
Headers show

Comments

Juan Quintela - Aug. 20, 2009, 5:42 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/hw.h  |    1 +
 savevm.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/hw.h b/hw/hw.h
index c77b1be..f097c2a 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -305,6 +305,7 @@  struct VMStateDescription {
     int minimum_version_id;
     int minimum_version_id_old;
     LoadStateHandler *load_state_old;
+    int (*run_after_load)(void *opaque);
     VMStateField *fields;
 };

diff --git a/savevm.c b/savevm.c
index 4879cf6..b5a0438 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1031,6 +1031,8 @@  int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
         }
         field++;
     }
+    if (vmsd->run_after_load)
+        return vmsd->run_after_load(opaque);
     return 0;
 }