@@ -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;
}
Signed-off-by: Alon Levy <alevy@redhat.com> --- hw/virtio-console.c | 11 +++++++++++ 1 file changed, 11 insertions(+)