From patchwork Sun Mar 24 13:02:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 230451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C717B2C00C4 for ; Mon, 25 Mar 2013 00:00:27 +1100 (EST) Received: from localhost ([::1]:34980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJkXC-0006wP-4m for incoming@patchwork.ozlabs.org; Sun, 24 Mar 2013 09:00:26 -0400 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 Received: from shalem.localdomain.com (vpn1-5-143.ams2.redhat.com [10.36.5.143]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2OCxAdY009948; Sun, 24 Mar 2013 08:59:12 -0400 From: Hans de Goede To: Amit Shah 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Hans de Goede , Alon Levy , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] virtio-serial: propagate guest_connected to the port on post_load X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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);