diff options
author | Alon Levy <alevy@redhat.com> | 2013-03-26 11:08:02 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-03-27 10:26:50 -0500 |
commit | bc6b815d9e34778aa7fbe785ecfa0b216c96f576 (patch) | |
tree | 8c499fec7465dc11543c0256eaf46baf178d7b66 /hw/virtio-serial-bus.c | |
parent | b2c1394af13b46a72cd27ff580cdd1d9bb1e8934 (diff) |
virtio-serial: propagate guest_connected to the port on post_load
When migrating a host with with a spice agent running the mouse becomes
non operational after the migration due to the agent state being
inconsistent between the guest and the client.
After migration the spicevmc backend on the destination has never been notified
of the (non 0) guest_connected state. Virtio-serial holds this state
information and migrates it, this patch properly propagates this information
to virtio-console and through that to interested chardev backends.
rhbz #725965
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-11-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-serial-bus.c')
-rw-r--r-- | hw/virtio-serial-bus.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index eb7af21a02..a9cb114649 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -579,6 +579,7 @@ static void virtio_serial_post_load_timer_cb(void *opaque) VirtIOSerial *s = opaque; VirtIOSerialPort *port; uint8_t host_connected; + VirtIOSerialPortClass *vsc; if (!s->post_load) { return; @@ -594,6 +595,10 @@ static void virtio_serial_post_load_timer_cb(void *opaque) send_control_event(s, port->id, VIRTIO_CONSOLE_PORT_OPEN, port->host_connected); } + vsc = VIRTIO_SERIAL_PORT_GET_CLASS(port); + if (vsc->set_guest_connected) { + vsc->set_guest_connected(port, port->guest_connected); + } } g_free(s->post_load->connected); qemu_free_timer(s->post_load->timer); |