From patchwork Wed Mar 20 09:55:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 229304 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 C01102C00B7 for ; Wed, 20 Mar 2013 21:00:36 +1100 (EST) Received: from localhost ([::1]:51354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIFow-0004zQ-4o for incoming@patchwork.ozlabs.org; Wed, 20 Mar 2013 06:00:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIFk2-0005zz-J6 for qemu-devel@nongnu.org; Wed, 20 Mar 2013 05:55:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIFk0-0002DC-Rx for qemu-devel@nongnu.org; Wed, 20 Mar 2013 05:55:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIFk0-0002D7-IQ for qemu-devel@nongnu.org; Wed, 20 Mar 2013 05:55:28 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2K9tRr3002297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Mar 2013 05:55:27 -0400 Received: from localhost.localdomain (vpn1-4-179.ams2.redhat.com [10.36.4.179]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2K9tFGL019828; Wed, 20 Mar 2013 05:55:25 -0400 From: Alon Levy To: qemu-devel@nongnu.org Date: Wed, 20 Mar 2013 11:55:14 +0200 Message-Id: <1363773314-32332-5-git-send-email-alevy@redhat.com> In-Reply-To: <1363773314-32332-1-git-send-email-alevy@redhat.com> References: <1363773314-32332-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: amit.shah@redhat.com, hdegoede@redhat.com, aliguori@us.ibm.com, kraxel@redhat.com Subject: [Qemu-devel] [PATCH 4/4] spice-qemu-char: register interface 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 The target has not seen the guest_connected event via spice_chr_guest_open or spice_chr_write, and so spice server wrongly assumes there is no agent active, while the client continues to send motion events only by the agent channel, which the server ignores. The net effect is that the mouse is static in the guest. By registering the interface on post load spice server will pass on the agent messages fixing the mouse behavior after migration. RHBZ #725965 Signed-off-by: Alon Levy --- spice-qemu-char.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spice-qemu-char.c b/spice-qemu-char.c index 8a9236d..c6aed58 100644 --- a/spice-qemu-char.c +++ b/spice-qemu-char.c @@ -205,6 +205,14 @@ static void print_allowed_subtypes(void) fprintf(stderr, "\n"); } +static void spice_chr_post_load(struct CharDriverState *chr, + int connected) +{ + if (connected) { + spice_chr_guest_open(chr); + } +} + static CharDriverState *chr_open(const char *subtype) { CharDriverState *chr; @@ -220,6 +228,7 @@ static CharDriverState *chr_open(const char *subtype) chr->chr_close = spice_chr_close; chr->chr_guest_open = spice_chr_guest_open; chr->chr_guest_close = spice_chr_guest_close; + chr->chr_post_load = spice_chr_post_load; QLIST_INSERT_HEAD(&spice_chars, s, next);