From patchwork Sun Nov 25 13:39:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 201544 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 3B5132C008C for ; Mon, 26 Nov 2012 00:39:35 +1100 (EST) Received: from localhost ([::1]:42493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TccQm-0005k2-MV for incoming@patchwork.ozlabs.org; Sun, 25 Nov 2012 08:39:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TccQg-0005jt-7e for qemu-devel@nongnu.org; Sun, 25 Nov 2012 08:39:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TccQY-00075W-PG for qemu-devel@nongnu.org; Sun, 25 Nov 2012 08:39:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TccQY-00075E-I7 for qemu-devel@nongnu.org; Sun, 25 Nov 2012 08:39:18 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAPDdGYZ028105 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 25 Nov 2012 08:39:17 -0500 Received: from garlic.tlv.redhat.com (spice-ovirt.tlv.redhat.com [10.35.4.71]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qAPDdETW018012; Sun, 25 Nov 2012 08:39:15 -0500 From: Alon Levy To: qemu-devel@nongnu.org Date: Sun, 25 Nov 2012 15:39:14 +0200 Message-Id: <1353850754-22704-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: amit.shah@redhat.com Subject: [Qemu-devel] [PATCH] hw/virtio-serial-bus: replay guest open on destination 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 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 if the client is using semi-seamless or switch host migration. After migration the target client has never received the guest_open initiated spice message. Virtio-serial holds this state information and migrates it, so replay that over the chardev post migration. Fix is not spice specific but spice is the only client that cares about it. rhbz #725965. --- hw/virtio-serial-bus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index efa8a81..ccce1fa 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -641,6 +641,7 @@ static void virtio_serial_post_load_timer_cb(void *opaque) VirtIOSerial *s = opaque; VirtIOSerialPort *port; uint8_t host_connected; + VirtIOSerialPortClass *vsc; for (i = 0 ; i < s->post_load.nr_active_ports; ++i) { port = s->post_load.connected[i].port; @@ -653,6 +654,11 @@ static void virtio_serial_post_load_timer_cb(void *opaque) send_control_event(port, VIRTIO_CONSOLE_PORT_OPEN, port->host_connected); } + vsc = VIRTIO_SERIAL_PORT_GET_CLASS(port); + if (port->guest_connected && vsc->guest_open) { + /* replay guest open */ + vsc->guest_open(port); + } } g_free(s->post_load.connected); s->post_load.connected = NULL;