summaryrefslogtreecommitdiffstats
path: root/include/chardev/char.h
diff options
context:
space:
mode:
authorPeter Maydell2017-09-23 13:55:40 +0200
committerPeter Maydell2017-09-23 13:55:40 +0200
commit460b6c8e581aa06b86f59eebd9e52edfe7adf417 (patch)
tree9115b412fa484e5394ec05e27137849be5037daa /include/chardev/char.h
parentMerge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request'... (diff)
parentchardev: remove context in chr_update_read_handler (diff)
downloadqemu-460b6c8e581aa06b86f59eebd9e52edfe7adf417.tar.gz
qemu-460b6c8e581aa06b86f59eebd9e52edfe7adf417.tar.xz
qemu-460b6c8e581aa06b86f59eebd9e52edfe7adf417.zip
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* Speed up AddressSpaceDispatch creation (Alexey) * Fix kvm.c assert (David) * Memory fixes and further speedup (me) * Persistent reservation manager infrastructure (me) * virtio-serial: add enable_backend callback (Pavel) * chardev GMainContext fixes (Peter) # gpg: Signature made Fri 22 Sep 2017 20:07:33 BST # gpg: using RSA key 0xBFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: (32 commits) chardev: remove context in chr_update_read_handler chardev: use per-dev context for io_add_watch_poll chardev: add Chardev.gcontext field chardev: new qemu_chr_be_update_read_handlers() scsi: add persistent reservation manager using qemu-pr-helper scsi: add multipath support to qemu-pr-helper scsi: build qemu-pr-helper scsi, file-posix: add support for persistent reservation management memory: Share special empty FlatView memory: seek FlatView sharing candidates among children subregions memory: trace FlatView creation and destruction memory: Create FlatView directly memory: Get rid of address_space_init_shareable memory: Rework "info mtree" to print flat views and dispatch trees memory: Do not allocate FlatView in address_space_init memory: Share FlatView's and dispatch trees between address spaces memory: Move address_space_update_ioeventfds memory: Alloc dispatch tree where topology is generared memory: Store physical root MR in FlatView memory: Rename mem_begin/mem_commit/mem_add helpers ... # Conflicts: # configure
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);