@@ -550,6 +550,18 @@ static void ics_dispatch_pre_save(void *opaque)
}
}
+static int ics_dispatch_pre_load(void *opaque)
+{
+ ICSState *ics = opaque;
+ ICSStateClass *info = ICS_GET_CLASS(ics);
+
+ if (info->pre_load) {
+ return info->pre_load(ics);
+ }
+
+ return 0;
+}
+
static int ics_dispatch_post_load(void *opaque, int version_id)
{
ICSState *ics = opaque;
@@ -582,6 +594,7 @@ static const VMStateDescription vmstate_ics = {
.minimum_version_id = 1,
.minimum_version_id_old = 1,
.pre_save = ics_dispatch_pre_save,
+ .pre_load = ics_dispatch_pre_load,
.post_load = ics_dispatch_post_load,
.fields = (VMStateField []) {
/* Sanity check */
@@ -126,6 +126,7 @@ struct ICSStateClass {
DeviceClass parent_class;
void (*pre_save)(ICSState *s);
+ int (*pre_load)(ICSState *s);
int (*post_load)(ICSState *s, int version_id);
};
This adds a hook which will be used to reset ICS state before incoming migration. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- hw/intc/xics.c | 13 +++++++++++++ include/hw/ppc/xics.h | 1 + 2 files changed, 14 insertions(+)