Received: from eggs.gnu.org ([2001:4830:134:3::10]:46731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhakE-0001w3-P1 for qemu-devel@nongnu.org; Fri, 24 Oct 2014 05:01:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xhak5-0003KC-Ep for qemu-devel@nongnu.org; Fri, 24 Oct 2014 05:01:14 -0400 Received: from mail-la0-x230.google.com ([2a00:1450:4010:c03::230]:38942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xhak5-0003Ju-7f for qemu-devel@nongnu.org; Fri, 24 Oct 2014 05:01:05 -0400 Received: by mail-la0-f48.google.com with SMTP id gi9so2219576lab.7 for ; Fri, 24 Oct 2014 02:01:04 -0700 (PDT) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 24 Oct 2014 11:00:54 +0200 Message-Id: <1414141254-31960-2-git-send-email-marcandre.lureau@gmail.com> In-Reply-To: <1414141254-31960-1-git-send-email-marcandre.lureau@gmail.com> References: <1414141254-31960-1-git-send-email-marcandre.lureau@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , kraxel@redhat.com 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 --- spice-qemu-char.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spice-qemu-char.c b/spice-qemu-char.c index 8106e06..3de01d1 100644 --- a/spice-qemu-char.c +++ b/spice-qemu-char.c @@ -111,6 +111,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 }; @@ -261,6 +264,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)) @@ -280,6 +290,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); -- 1.9.3