qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, berrange@redhat.com,
	imbrenda@linux.vnet.ibm.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH 3/9] char: add qemu_chr_remove_handlers()
Date: Thu, 13 Oct 2016 15:14:43 +0400	[thread overview]
Message-ID: <20161013111449.29387-4-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20161013111449.29387-1-marcandre.lureau@redhat.com>

Remove the handlers associated with a frontend tag.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 qemu-char.c           | 9 +++++++++
 include/sysemu/char.h | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/qemu-char.c b/qemu-char.c
index 168af69..a7fec6a 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -526,6 +526,15 @@ int qemu_chr_add_handlers(CharDriverState *s,
                                       fd_event, opaque, NULL);
 }
 
+void qemu_chr_remove_handlers(CharDriverState *s, int tag)
+{
+    if (tag < 0) {
+        return;
+    }
+    /* FIXME: recycle mux tag */
+    qemu_chr_set_handlers(s, NULL, NULL, NULL, NULL, NULL, tag);
+}
+
 static int null_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
 {
     return len;
diff --git a/include/sysemu/char.h b/include/sysemu/char.h
index bdd61ea..36d82b1 100644
--- a/include/sysemu/char.h
+++ b/include/sysemu/char.h
@@ -453,6 +453,15 @@ int qemu_chr_add_handlers_full(CharDriverState *s,
                                 void *opaque,
                                 GMainContext *context);
 
+/**
+ * @qemu_chr_remove_handlers:
+ *
+ * @tag: the tag returned from qemu_chr_add_handlers()
+ *
+ * Remove the frontend callbacks.
+ */
+void qemu_chr_remove_handlers(CharDriverState *s, int tag);
+
 void qemu_chr_be_generic_open(CharDriverState *s);
 void qemu_chr_accept_input(CharDriverState *s);
 int qemu_chr_add_client(CharDriverState *s, int fd);
-- 
2.10.0

  parent reply	other threads:[~2016-10-13 11:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13 11:14 [Qemu-devel] [PATCH 0/9] Fix mux regression (commit 949055a2) Marc-André Lureau
2016-10-13 11:14 ` [Qemu-devel] [PATCH 1/9] Revert "char: use a fixed idx for child muxed chr" Marc-André Lureau
2016-10-13 11:14 ` [Qemu-devel] [PATCH 2/9] char: return a tag when adding the fe handlers Marc-André Lureau
2016-10-13 11:14 ` Marc-André Lureau [this message]
2016-10-13 11:14 ` [Qemu-devel] [PATCH 4/9] char: keep track of qemu_chr_add_handlers() Marc-André Lureau
2016-10-13 11:14 ` [Qemu-devel] [PATCH 5/9] char: warn on unused qemu_chr_add_handlers() result Marc-André Lureau
2016-10-13 11:14 ` [Qemu-devel] [PATCH 6/9] qdev: remove call to qemu_chr_add_handlers() Marc-André Lureau
2016-10-13 11:14 ` [Qemu-devel] [PATCH 7/9] char: handle qemu_chr_add_handlers() error Marc-André Lureau
2016-10-13 11:14 ` [Qemu-devel] [PATCH 8/9] ringbuf: fix chr_write return value Marc-André Lureau
2016-10-13 11:14 ` [Qemu-devel] [PATCH 9/9] tests: start chardev unit tests Marc-André Lureau
2016-10-13 11:36 ` [Qemu-devel] [PATCH 0/9] Fix mux regression (commit 949055a2) Paolo Bonzini
2016-10-13 11:50   ` Marc-André Lureau
2016-10-13 11:58     ` Paolo Bonzini
2016-10-13 13:27 ` Peter Maydell

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=20161013111449.29387-4-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=berrange@redhat.com \
    --cc=imbrenda@linux.vnet.ibm.com \
    --cc=pbonzini@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).