Patchwork [3/4] virtio-console: implement post_load to call to qemu_chr_fe_post_load

login
register
mail settings
Submitter Alon Levy
Date March 20, 2013, 9:55 a.m.
Message ID <1363773314-32332-4-git-send-email-alevy@redhat.com>
Download mbox | patch
Permalink /patch/229303/
State New
Headers show

Comments

Alon Levy - March 20, 2013, 9:55 a.m.
Signed-off-by: Alon Levy <alevy@redhat.com>
---
 hw/virtio-console.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Patch

diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index e2d1c58..a6ff2f7 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -88,6 +88,16 @@  static void guest_close(VirtIOSerialPort *port)
     qemu_chr_fe_close(vcon->chr);
 }
 
+static void post_load(VirtIOSerialPort *port)
+{
+    VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
+
+    if (!vcon->chr) {
+        return;
+    }
+    qemu_chr_fe_post_load(vcon->chr, port->guest_connected);
+}
+
 /* Readiness of the guest to accept data on a port */
 static int chr_can_read(void *opaque)
 {
@@ -177,6 +187,7 @@  static void virtserialport_class_init(ObjectClass *klass, void *data)
     k->have_data = flush_buf;
     k->guest_open = guest_open;
     k->guest_close = guest_close;
+    k->post_load = post_load;
     dc->props = virtserialport_properties;
 }