goldfish/tty: Restore IRQ properly on reload.
Change-Id: I9cfaa73034ae5e16ca144902d1f64402abefb677
diff --git a/hw/android/goldfish/tty.c b/hw/android/goldfish/tty.c
index 9e04c6c..27c9c70 100644
--- a/hw/android/goldfish/tty.c
+++ b/hw/android/goldfish/tty.c
@@ -69,8 +69,11 @@
s->ptr_len = qemu_get_be32(f);
s->ready = qemu_get_byte(f);
s->data_count = qemu_get_byte(f);
- qemu_get_buffer(f, s->data, s->data_count);
+ if (qemu_get_buffer(f, s->data, s->data_count) < 0)
+ return -1;
+
+ goldfish_device_set_irq(&s->dev, 0, s->ready && s->data_count > 0);
return 0;
}