@@ -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;
@@ -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);
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(+)