From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Gerd Hoffmann 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 2/4] 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann From: Marc-Andr=C3=A9 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=C3=A9 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 =3D { #if SPICE_SERVER_VERSION >=3D 0x000c02 .event =3D vmc_event, #endif +#if SPICE_SERVER_VERSION >=3D 0x000c06 + .flags =3D SPICE_CHAR_DEVICE_NOTIFY_WRITABLE, +#endif }; =20 =20 @@ -260,6 +263,13 @@ static void print_allowed_subtypes(void) fprintf(stderr, "\n"); } =20 +static void spice_chr_accept_input(struct CharDriverState *chr) +{ + SpiceCharDriver *s =3D chr->opaque; + + spice_server_char_device_wakeup(&s->sin); +} + static CharDriverState *chr_open(const char *subtype, void (*set_fe_open)(struct CharDriverState *, int)) =20 @@ -279,6 +289,7 @@ static CharDriverState *chr_open(const char *subtype, chr->chr_set_fe_open =3D set_fe_open; chr->explicit_be_open =3D true; chr->chr_fe_event =3D spice_chr_fe_event; + chr->chr_accept_input =3D spice_chr_accept_input; =20 QLIST_INSERT_HEAD(&spice_chars, s, next); =20 --=20 1.8.3.1