goldfish/interrupt: Properly restore IRQ on reload.
Change-Id: Iea925eab83271d6ca84981e37edb017500772770
diff --git a/hw/android/goldfish/interrupt.c b/hw/android/goldfish/interrupt.c
index 23a1610..5b60151 100644
--- a/hw/android/goldfish/interrupt.c
+++ b/hw/android/goldfish/interrupt.c
@@ -50,16 +50,6 @@
qemu_put_struct(f, goldfish_int_fields, s);
}
-static int goldfish_int_load(QEMUFile* f, void* opaque, int version_id)
-{
- struct goldfish_int_state* s = opaque;
-
- if (version_id != GOLDFISH_INT_SAVE_VERSION)
- return -1;
-
- return qemu_get_struct(f, goldfish_int_fields, s);
-}
-
static void goldfish_int_update(struct goldfish_int_state *s)
{
uint32_t flags;
@@ -71,6 +61,20 @@
qemu_set_irq(s->parent_fiq, flags != 0);
}
+static int goldfish_int_load(QEMUFile* f, void* opaque, int version_id)
+{
+ struct goldfish_int_state* s = opaque;
+
+ if (version_id != GOLDFISH_INT_SAVE_VERSION)
+ return -1;
+
+ if (qemu_get_struct(f, goldfish_int_fields, s) < 0)
+ return -1;
+
+ goldfish_int_update(s);
+ return 0;
+}
+
static void goldfish_int_set_irq(void *opaque, int irq, int level)
{
struct goldfish_int_state *s = (struct goldfish_int_state *)opaque;