mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
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 <marcandre.lureau@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
246ca55faf
commit
e95e203c08
1 changed files with 11 additions and 0 deletions
|
@ -110,6 +110,9 @@ static SpiceCharDeviceInterface vmc_interface = {
|
||||||
#if SPICE_SERVER_VERSION >= 0x000c02
|
#if SPICE_SERVER_VERSION >= 0x000c02
|
||||||
.event = vmc_event,
|
.event = vmc_event,
|
||||||
#endif
|
#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");
|
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,
|
static CharDriverState *chr_open(const char *subtype,
|
||||||
void (*set_fe_open)(struct CharDriverState *, int))
|
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->chr_set_fe_open = set_fe_open;
|
||||||
chr->explicit_be_open = true;
|
chr->explicit_be_open = true;
|
||||||
chr->chr_fe_event = spice_chr_fe_event;
|
chr->chr_fe_event = spice_chr_fe_event;
|
||||||
|
chr->chr_accept_input = spice_chr_accept_input;
|
||||||
|
|
||||||
QLIST_INSERT_HEAD(&spice_chars, s, next);
|
QLIST_INSERT_HEAD(&spice_chars, s, next);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue