public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Doug Goldstein" <cardoe@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/qemu-kvm:qemu-kvm-0.14.1-gentoo commit in: /
Date: Thu, 21 Jul 2011 20:19:46 +0000 (UTC)	[thread overview]
Message-ID: <2a4c10d4fe8cbaba9d59410931e082f2c0844dbc.cardoe@gentoo> (raw)

commit:     2a4c10d4fe8cbaba9d59410931e082f2c0844dbc
Author:     Amit Shah <amit.shah <AT> redhat <DOT> com>
AuthorDate: Mon Mar 21 20:41:42 2011 +0000
Commit:     Doug Goldstein <cardoe <AT> gentoo <DOT> org>
CommitDate: Thu Jul 21 20:17:06 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/qemu-kvm.git;a=commit;h=2a4c10d4

char: Add framework for a 'write unblocked' callback

The char layer can let users know that the driver will block on further
input.  For users interested in not blocking, they can assign a function
pointer that will be called back when the driver becomes writable.  This
patch just adds the function pointers to the CharDriverState structure,
future patches will enable the nonblocking and callback functionality.

Signed-off-by: Amit Shah <amit.shah <AT> redhat.com>

---
 qemu-char.c |    3 +++
 qemu-char.h |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 3a31d8b..ce76411 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -206,11 +206,14 @@ void qemu_chr_add_handlers(CharDriverState *s,
     }
     s->chr_can_read = handlers->fd_can_read;
     s->chr_read = handlers->fd_read;
+    s->chr_write_unblocked = handlers->fd_write_unblocked;
     s->chr_event = handlers->fd_event;
     s->handler_opaque = opaque;
     if (s->chr_update_read_handler)
         s->chr_update_read_handler(s);
 
+    s->write_blocked = false;
+
     /* We're connecting to an already opened device, so let's make sure we
        also get the open event */
     if (s->opened) {

diff --git a/qemu-char.h b/qemu-char.h
index 185377c..bf06da0 100644
--- a/qemu-char.h
+++ b/qemu-char.h
@@ -61,6 +61,9 @@ struct CharDriverState {
     IOEventHandler *chr_event;
     IOCanReadHandler *chr_can_read;
     IOReadHandler *chr_read;
+    IOHandler *chr_write_unblocked;
+    void (*chr_enable_write_fd_handler)(struct CharDriverState *chr);
+    void (*chr_disable_write_fd_handler)(struct CharDriverState *chr);
     void *handler_opaque;
     void (*chr_send_event)(struct CharDriverState *chr, int event);
     void (*chr_close)(struct CharDriverState *chr);
@@ -71,6 +74,8 @@ struct CharDriverState {
     char *label;
     char *filename;
     int opened;
+    /* Are we in a blocked state? */
+    bool write_blocked;
     QTAILQ_ENTRY(CharDriverState) next;
 };
 



             reply	other threads:[~2011-07-21 20:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21 20:19 Doug Goldstein [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-07-26 17:16 [gentoo-commits] proj/qemu-kvm:qemu-kvm-0.14.1-gentoo commit in: / Doug Goldstein
2011-07-21 20:19 Doug Goldstein
2011-07-21 20:19 Doug Goldstein
2011-07-21 20:19 Doug Goldstein
2011-07-21 20:19 Doug Goldstein
2011-07-21 20:19 Doug Goldstein
2011-07-21 20:19 Doug Goldstein
2011-07-21 20:19 Doug Goldstein
2011-07-21 20:19 Doug Goldstein
2011-07-21 20:19 Doug Goldstein

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=2a4c10d4fe8cbaba9d59410931e082f2c0844dbc.cardoe@gentoo \
    --to=cardoe@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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