From: Marc-André Lureau Date: Tue, 5 May 2015 14:58:56 +0000 (+0200) Subject: spice-char: notify the server when chardev is writable X-Git-Tag: v2.4.0-rc0~114^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e95e203c085b7731746e39c9b9f8bd2f6eaa0cd6;p=users%2Fdwmw2%2Fqemu.git spice-char: notify the server when chardev is writable 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 --- diff --git a/spice-qemu-char.c b/spice-qemu-char.c index a4f4e578fe..0f8903e1f7 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);