qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@gmail.com>, kraxel@redhat.com
Subject: [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable
Date: Tue,  5 May 2015 16:58:56 +0200	[thread overview]
Message-ID: <1430837936-24321-2-git-send-email-marcandre.lureau@gmail.com> (raw)
In-Reply-To: <1430837936-24321-1-git-send-email-marcandre.lureau@gmail.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 <marcandre.lureau@gmail.com>
---
 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);
 
-- 
2.1.0

  reply	other threads:[~2015-05-05 14:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05 14:58 [Qemu-devel] [PATCH 1/2] virtio-console: notify chardev when writable Marc-André Lureau
2015-05-05 14:58 ` Marc-André Lureau [this message]
2015-05-06  7:38 ` Gerd Hoffmann
  -- strict thread matches above, loose matches on Subject: below --
2014-10-24  9:00 Marc-André Lureau
2014-10-24  9:00 ` [Qemu-devel] [PATCH 2/2] spice-char: notify the server when chardev is writable Marc-André Lureau
2014-10-27  8:08   ` Gerd Hoffmann
2014-10-27 11:45     ` Marc-André Lureau
2014-10-27 11:57       ` Gerd Hoffmann
2015-05-04  9:31         ` Amit Shah
2015-05-05  9:45           ` Gerd Hoffmann
2014-10-27 12:43   ` Amit Shah
2014-10-27 16:32     ` Marc-André Lureau
2014-10-28 14:51       ` Amit Shah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430837936-24321-2-git-send-email-marcandre.lureau@gmail.com \
    --to=marcandre.lureau@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).