From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJkW4-0005uo-Aq for qemu-devel@nongnu.org; Sun, 24 Mar 2013 08:59:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJkW2-00078F-Cl for qemu-devel@nongnu.org; Sun, 24 Mar 2013 08:59:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJkW2-000783-4y for qemu-devel@nongnu.org; Sun, 24 Mar 2013 08:59:14 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2OCxDkI029405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 24 Mar 2013 08:59:13 -0400 From: Hans de Goede Date: Sun, 24 Mar 2013 14:02:37 +0100 Message-Id: <1364130157-13177-2-git-send-email-hdegoede@redhat.com> In-Reply-To: <1364130157-13177-1-git-send-email-hdegoede@redhat.com> References: <1364130157-13177-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH] virtio-serial: propagate guest_connected to the port on post_load List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Hans de Goede , Alon Levy , qemu-devel@nongnu.org From: Alon Levy 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 --- hw/virtio-serial-bus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index eb7af21..a9cb114 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); -- 1.8.1.4