From patchwork Fri May 29 08:26:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 477624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D4575140E45 for ; Fri, 29 May 2015 18:27:05 +1000 (AEST) Received: from localhost ([::1]:34319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyFd9-0007ph-35 for incoming@patchwork.ozlabs.org; Fri, 29 May 2015 04:27:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyFca-0006g2-Fa for qemu-devel@nongnu.org; Fri, 29 May 2015 04:26:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyFcW-0005ni-AP for qemu-devel@nongnu.org; Fri, 29 May 2015 04:26:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyFcW-0005nB-4M for qemu-devel@nongnu.org; Fri, 29 May 2015 04:26:24 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id AF039374A1E; Fri, 29 May 2015 08:26:23 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4T8QMiU030608; Fri, 29 May 2015 04:26:23 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 2AB0881DB1; Fri, 29 May 2015 10:26:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 29 May 2015 10:26:16 +0200 Message-Id: <1432887978-7411-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1432887978-7411-1-git-send-email-kraxel@redhat.com> References: <1432887978-7411-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [Qemu-devel] [PULL 2/4] spice-char: notify the server when chardev is writable 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: Marc-André Lureau The spice server is polling on write, unless SPICE_CHAR_DEVICE_NOTIFY_WRITABLE flag is set. In this case, qemu must call spice_server_char_device_wakeup() when the frontend is writable. Signed-off-by: Marc-André Lureau Signed-off-by: Gerd Hoffmann --- spice-qemu-char.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spice-qemu-char.c b/spice-qemu-char.c index a4f4e57..0f8903e 100644 --- a/spice-qemu-char.c +++ b/spice-qemu-char.c @@ -110,6 +110,9 @@ static SpiceCharDeviceInterface vmc_interface = { #if SPICE_SERVER_VERSION >= 0x000c02 .event = vmc_event, #endif +#if SPICE_SERVER_VERSION >= 0x000c06 + .flags = SPICE_CHAR_DEVICE_NOTIFY_WRITABLE, +#endif }; @@ -260,6 +263,13 @@ static void print_allowed_subtypes(void) fprintf(stderr, "\n"); } +static void spice_chr_accept_input(struct CharDriverState *chr) +{ + SpiceCharDriver *s = chr->opaque; + + spice_server_char_device_wakeup(&s->sin); +} + static CharDriverState *chr_open(const char *subtype, void (*set_fe_open)(struct CharDriverState *, int)) @@ -279,6 +289,7 @@ static CharDriverState *chr_open(const char *subtype, chr->chr_set_fe_open = set_fe_open; chr->explicit_be_open = true; chr->chr_fe_event = spice_chr_fe_event; + chr->chr_accept_input = spice_chr_accept_input; QLIST_INSERT_HEAD(&spice_chars, s, next);