diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-09-14 18:14:56 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-09-14 18:14:56 +0100 |
commit | 831aaf24967a49d7750090b9dcfd6bf356f16529 (patch) | |
tree | a3565c0b50a7509f2a30c902e50903eb2506b7bd /include | |
parent | 4c9af1ea1457782cf0adb293179335ef6de942aa (diff) | |
parent | 78e3e1d046e64b86e8c9bf3011d5a2a795b5e373 (diff) | |
download | qemu-831aaf24967a49d7750090b9dcfd6bf356f16529.zip qemu-831aaf24967a49d7750090b9dcfd6bf356f16529.tar.gz qemu-831aaf24967a49d7750090b9dcfd6bf356f16529.tar.bz2 |
Merge remote-tracking branch 'remotes/marcandre/tags/misc-pull-request' into staging
chardev & doc misc
# gpg: Signature made Tue 14 Sep 2021 13:59:10 BST
# gpg: using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg: issuer "marcandre.lureau@redhat.com"
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5
* remotes/marcandre/tags/misc-pull-request:
chardev: add some comments about the class methods
chardev: remove needless class method
chardev: Propagate error from logfile opening
meson.build: fix comment typo
docs: add supported host CPU architectures section
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/chardev/char.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/include/chardev/char.h b/include/chardev/char.h index 7c0444f..a319b5f 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -254,26 +254,58 @@ struct ChardevClass { bool internal; /* TODO: eventually use TYPE_USER_CREATABLE */ bool supports_yank; + + /* parse command line options and populate QAPI @backend */ void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error **errp); + /* called after construction, open/starts the backend */ void (*open)(Chardev *chr, ChardevBackend *backend, bool *be_opened, Error **errp); + /* write buf to the backend */ int (*chr_write)(Chardev *s, const uint8_t *buf, int len); + + /* + * Read from the backend (blocking). A typical front-end will instead rely + * on chr_can_read/chr_read being called when polling/looping. + */ int (*chr_sync_read)(Chardev *s, const uint8_t *buf, int len); + + /* create a watch on the backend */ GSource *(*chr_add_watch)(Chardev *s, GIOCondition cond); + + /* update the backend internal sources */ void (*chr_update_read_handler)(Chardev *s); + + /* send an ioctl to the backend */ int (*chr_ioctl)(Chardev *s, int cmd, void *arg); + + /* get ancillary-received fds during last read */ int (*get_msgfds)(Chardev *s, int* fds, int num); + + /* set ancillary fds to be sent with next write */ int (*set_msgfds)(Chardev *s, int *fds, int num); + + /* accept the given fd */ int (*chr_add_client)(Chardev *chr, int fd); + + /* wait for a connection */ int (*chr_wait_connected)(Chardev *chr, Error **errp); + + /* disconnect a connection */ void (*chr_disconnect)(Chardev *chr); + + /* called by frontend when it can read */ void (*chr_accept_input)(Chardev *chr); + + /* set terminal echo */ void (*chr_set_echo)(Chardev *chr, bool echo); + + /* notify the backend of frontend open state */ void (*chr_set_fe_open)(Chardev *chr, int fe_open); + + /* handle various events */ void (*chr_be_event)(Chardev *s, QEMUChrEvent event); - void (*chr_options_parsed)(Chardev *chr); }; Chardev *qemu_chardev_new(const char *id, const char *typename, |