提交 bc6b815d 编写于 作者: A Alon Levy 提交者: Anthony Liguori

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: NHans de Goede <hdegoede@redhat.com>
Message-id: 1364292483-16564-11-git-send-email-hdegoede@redhat.com
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 b2c1394a
...@@ -579,6 +579,7 @@ static void virtio_serial_post_load_timer_cb(void *opaque) ...@@ -579,6 +579,7 @@ static void virtio_serial_post_load_timer_cb(void *opaque)
VirtIOSerial *s = opaque; VirtIOSerial *s = opaque;
VirtIOSerialPort *port; VirtIOSerialPort *port;
uint8_t host_connected; uint8_t host_connected;
VirtIOSerialPortClass *vsc;
if (!s->post_load) { if (!s->post_load) {
return; return;
...@@ -594,6 +595,10 @@ static void virtio_serial_post_load_timer_cb(void *opaque) ...@@ -594,6 +595,10 @@ static void virtio_serial_post_load_timer_cb(void *opaque)
send_control_event(s, port->id, VIRTIO_CONSOLE_PORT_OPEN, send_control_event(s, port->id, VIRTIO_CONSOLE_PORT_OPEN,
port->host_connected); 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); g_free(s->post_load->connected);
qemu_free_timer(s->post_load->timer); qemu_free_timer(s->post_load->timer);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册