summaryrefslogtreecommitdiffstats
path: root/include/chardev/char.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/chardev/char.h')
-rw-r--r--include/chardev/char.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/chardev/char.h b/include/chardev/char.h
index 66dde4637e..43aabccef5 100644
--- a/include/chardev/char.h
+++ b/include/chardev/char.h
@@ -55,6 +55,7 @@ struct Chardev {
int logfd;
int be_open;
GSource *gsource;
+ GMainContext *gcontext;
DECLARE_BITMAP(features, QEMU_CHAR_FEATURE_LAST);
};
@@ -169,6 +170,16 @@ void qemu_chr_be_write(Chardev *s, uint8_t *buf, int len);
void qemu_chr_be_write_impl(Chardev *s, uint8_t *buf, int len);
/**
+ * @qemu_chr_be_update_read_handlers:
+ *
+ * Invoked when frontend read handlers are setup
+ *
+ * @context the gcontext that will be used to attach the watch sources
+ */
+void qemu_chr_be_update_read_handlers(Chardev *s,
+ GMainContext *context);
+
+/**
* @qemu_chr_be_event:
*
* Send an event from the back end to the front end.
@@ -227,7 +238,7 @@ typedef struct ChardevClass {
int (*chr_write)(Chardev *s, const uint8_t *buf, int len);
int (*chr_sync_read)(Chardev *s, const uint8_t *buf, int len);
GSource *(*chr_add_watch)(Chardev *s, GIOCondition cond);
- void (*chr_update_read_handler)(Chardev *s, GMainContext *context);
+ void (*chr_update_read_handler)(Chardev *s);
int (*chr_ioctl)(Chardev *s, int cmd, void *arg);
int (*get_msgfds)(Chardev *s, int* fds, int num);
int (*set_msgfds)(Chardev *s, int *fds, int num);