From: "Daniel P. Berrangé" <berrange@redhat.com>
To: marcandre.lureau@redhat.com
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH 4/4] chardev: add some comments about the class methods
Date: Tue, 3 Aug 2021 09:46:55 +0100 [thread overview]
Message-ID: <YQkCf9Mrky3uYp63@redhat.com> (raw)
In-Reply-To: <20210723102825.1790112-5-marcandre.lureau@redhat.com>
On Fri, Jul 23, 2021 at 02:28:25PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> include/chardev/char.h | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/include/chardev/char.h b/include/chardev/char.h
> index 589e7fe46d..2e4c16f82f 100644
> --- a/include/chardev/char.h
> +++ b/include/chardev/char.h
> @@ -254,24 +254,57 @@ 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 char_can_read/chr_read being called when polling/looping.
> + */
chr_can_read
> 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);
> };
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2021-08-03 8:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-23 10:28 [PATCH 0/4] chardev fixes marcandre.lureau
2021-07-23 10:28 ` [PATCH 1/4] chardev: fix qemu_chr_open_fd() being called with fd=-1 marcandre.lureau
2021-08-03 8:40 ` Daniel P. Berrangé
2021-08-04 11:11 ` Marc-André Lureau
2021-07-23 10:28 ` [PATCH 2/4] chardev: fix qemu_chr_open_fd() with fd_in==fd_out marcandre.lureau
2021-08-03 8:44 ` Daniel P. Berrangé
2021-07-23 10:28 ` [PATCH 3/4] chardev: remove needless class method marcandre.lureau
2021-08-02 18:53 ` Philippe Mathieu-Daudé
2021-08-03 8:45 ` Daniel P. Berrangé
2021-07-23 10:28 ` [PATCH 4/4] chardev: add some comments about the class methods marcandre.lureau
2021-08-03 8:46 ` Daniel P. Berrangé [this message]
2021-08-02 18:49 ` [PATCH 0/4] chardev fixes Marc-André Lureau
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=YQkCf9Mrky3uYp63@redhat.com \
--to=berrange@redhat.com \
--cc=marcandre.lureau@redhat.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).