goldfish/battery: Properly restore IRQ on reload.
Change-Id: I84d41136325e3a4b9f6deef6fd17c360e8fa55ef
diff --git a/hw/android/goldfish/battery.c b/hw/android/goldfish/battery.c
index 41abcba..796d5dc 100644
--- a/hw/android/goldfish/battery.c
+++ b/hw/android/goldfish/battery.c
@@ -80,7 +80,11 @@
if (version_id != BATTERY_STATE_SAVE_VERSION)
return -1;
- return qemu_get_struct(f, goldfish_battery_fields, s);
+ if (qemu_get_struct(f, goldfish_battery_fields, s) < 0)
+ return -1;
+
+ goldfish_device_set_irq(&s->dev, 0, (s->int_status & s->int_enable));
+ return 0;
}
static struct goldfish_battery_state *battery_state;