char: rename remaining CharDriver to Chardev

CharDriver no longer exists, it has been replaced with Chardev.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Marc-André Lureau 2016-12-14 13:27:58 +03:00
parent 88cace9f11
commit 279b066e4c
2 changed files with 25 additions and 26 deletions

View File

@ -74,7 +74,7 @@ typedef enum {
QEMU_CHAR_FEATURE_REPLAY, QEMU_CHAR_FEATURE_REPLAY,
QEMU_CHAR_FEATURE_LAST, QEMU_CHAR_FEATURE_LAST,
} CharDriverFeature; } ChardevFeature;
/* This is the backend as seen by frontend, the actual backend is /* This is the backend as seen by frontend, the actual backend is
* Chardev */ * Chardev */
@ -141,7 +141,7 @@ Chardev *qemu_chr_new(const char *label, const char *filename);
* @qemu_chr_fe_disconnect: * @qemu_chr_fe_disconnect:
* *
* Close a fd accpeted by character backend. * Close a fd accpeted by character backend.
* Without associated CharDriver, do nothing. * Without associated Chardev, do nothing.
*/ */
void qemu_chr_fe_disconnect(CharBackend *be); void qemu_chr_fe_disconnect(CharBackend *be);
@ -156,7 +156,7 @@ void qemu_chr_cleanup(void);
* @qemu_chr_fe_wait_connected: * @qemu_chr_fe_wait_connected:
* *
* Wait for characted backend to be connected, return < 0 on error or * Wait for characted backend to be connected, return < 0 on error or
* if no assicated CharDriver. * if no assicated Chardev.
*/ */
int qemu_chr_fe_wait_connected(CharBackend *be, Error **errp); int qemu_chr_fe_wait_connected(CharBackend *be, Error **errp);
@ -188,7 +188,7 @@ void qemu_chr_delete(Chardev *chr);
* Ask the backend to override its normal echo setting. This only really * Ask the backend to override its normal echo setting. This only really
* applies to the stdio backend and is used by the QMP server such that you * applies to the stdio backend and is used by the QMP server such that you
* can see what you type if you try to type QMP commands. * can see what you type if you try to type QMP commands.
* Without associated CharDriver, do nothing. * Without associated Chardev, do nothing.
* *
* @echo true to enable echo, false to disable echo * @echo true to enable echo, false to disable echo
*/ */
@ -199,7 +199,7 @@ void qemu_chr_fe_set_echo(CharBackend *be, bool echo);
* *
* Set character frontend open status. This is an indication that the * Set character frontend open status. This is an indication that the
* front end is ready (or not) to begin doing I/O. * front end is ready (or not) to begin doing I/O.
* Without associated CharDriver, do nothing. * Without associated Chardev, do nothing.
*/ */
void qemu_chr_fe_set_open(CharBackend *be, int fe_open); void qemu_chr_fe_set_open(CharBackend *be, int fe_open);
@ -208,7 +208,7 @@ void qemu_chr_fe_set_open(CharBackend *be, int fe_open);
* *
* Write to a character backend using a printf style interface. This * Write to a character backend using a printf style interface. This
* function is thread-safe. It does nothing without associated * function is thread-safe. It does nothing without associated
* CharDriver. * Chardev.
* *
* @fmt see #printf * @fmt see #printf
*/ */
@ -221,7 +221,7 @@ void qemu_chr_fe_printf(CharBackend *be, const char *fmt, ...)
* If the backend is connected, create and add a #GSource that fires * If the backend is connected, create and add a #GSource that fires
* when the given condition (typically G_IO_OUT|G_IO_HUP or G_IO_HUP) * when the given condition (typically G_IO_OUT|G_IO_HUP or G_IO_HUP)
* is active; return the #GSource's tag. If it is disconnected, * is active; return the #GSource's tag. If it is disconnected,
* or without associated CharDriver, return 0. * or without associated Chardev, return 0.
* *
* @cond the condition to poll for * @cond the condition to poll for
* @func the function to call when the condition happens * @func the function to call when the condition happens
@ -242,7 +242,7 @@ guint qemu_chr_fe_add_watch(CharBackend *be, GIOCondition cond,
* @buf the data * @buf the data
* @len the number of bytes to send * @len the number of bytes to send
* *
* Returns: the number of bytes consumed (0 if no assicated CharDriver) * Returns: the number of bytes consumed (0 if no assicated Chardev)
*/ */
int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len); int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len);
@ -257,7 +257,7 @@ int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len);
* @buf the data * @buf the data
* @len the number of bytes to send * @len the number of bytes to send
* *
* Returns: the number of bytes consumed (0 if no assicated CharDriver) * Returns: the number of bytes consumed (0 if no assicated Chardev)
*/ */
int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len); int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len);
@ -269,7 +269,7 @@ int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len);
* @buf the data buffer * @buf the data buffer
* @len the number of bytes to read * @len the number of bytes to read
* *
* Returns: the number of bytes read (0 if no assicated CharDriver) * Returns: the number of bytes read (0 if no assicated Chardev)
*/ */
int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len); int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len);
@ -282,7 +282,7 @@ int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len);
* @arg the data associated with @cmd * @arg the data associated with @cmd
* *
* Returns: if @cmd is not supported by the backend or there is no * Returns: if @cmd is not supported by the backend or there is no
* associated CharDriver, -ENOTSUP, otherwise the return * associated Chardev, -ENOTSUP, otherwise the return
* value depends on the semantics of @cmd * value depends on the semantics of @cmd
*/ */
int qemu_chr_fe_ioctl(CharBackend *be, int cmd, void *arg); int qemu_chr_fe_ioctl(CharBackend *be, int cmd, void *arg);
@ -322,7 +322,7 @@ int qemu_chr_fe_get_msgfds(CharBackend *be, int *fds, int num);
* result in overwriting the fd array with the new value without being send. * result in overwriting the fd array with the new value without being send.
* Upon writing the message the fd array is freed. * Upon writing the message the fd array is freed.
* *
* Returns: -1 if fd passing isn't supported or no associated CharDriver. * Returns: -1 if fd passing isn't supported or no associated Chardev.
*/ */
int qemu_chr_fe_set_msgfds(CharBackend *be, int *fds, int num); int qemu_chr_fe_set_msgfds(CharBackend *be, int *fds, int num);
@ -373,7 +373,7 @@ void qemu_chr_be_event(Chardev *s, int event);
* @qemu_chr_fe_init: * @qemu_chr_fe_init:
* *
* Initializes a front end for the given CharBackend and * Initializes a front end for the given CharBackend and
* CharDriver. Call qemu_chr_fe_deinit() to remove the association and * Chardev. Call qemu_chr_fe_deinit() to remove the association and
* release the driver. * release the driver.
* *
* Returns: false on error. * Returns: false on error.
@ -384,16 +384,16 @@ bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp);
* @qemu_chr_fe_get_driver: * @qemu_chr_fe_get_driver:
* *
* Returns the driver associated with a CharBackend or NULL if no * Returns the driver associated with a CharBackend or NULL if no
* associated CharDriver. * associated Chardev.
*/ */
Chardev *qemu_chr_fe_get_driver(CharBackend *be); Chardev *qemu_chr_fe_get_driver(CharBackend *be);
/** /**
* @qemu_chr_fe_deinit: * @qemu_chr_fe_deinit:
* *
* Dissociate the CharBackend from the CharDriver. * Dissociate the CharBackend from the Chardev.
* *
* Safe to call without associated CharDriver. * Safe to call without associated Chardev.
*/ */
void qemu_chr_fe_deinit(CharBackend *b); void qemu_chr_fe_deinit(CharBackend *b);
@ -412,7 +412,7 @@ void qemu_chr_fe_deinit(CharBackend *b);
* Set the front end char handlers. The front end takes the focus if * Set the front end char handlers. The front end takes the focus if
* any of the handler is non-NULL. * any of the handler is non-NULL.
* *
* Without associated CharDriver, nothing is changed. * Without associated Chardev, nothing is changed.
*/ */
void qemu_chr_fe_set_handlers(CharBackend *b, void qemu_chr_fe_set_handlers(CharBackend *b,
IOCanReadHandler *fd_can_read, IOCanReadHandler *fd_can_read,
@ -427,7 +427,7 @@ void qemu_chr_fe_set_handlers(CharBackend *b,
* *
* Take the focus (if the front end is muxed). * Take the focus (if the front end is muxed).
* *
* Without associated CharDriver, nothing is changed. * Without associated Chardev, nothing is changed.
*/ */
void qemu_chr_fe_take_focus(CharBackend *b); void qemu_chr_fe_take_focus(CharBackend *b);
@ -437,9 +437,9 @@ int qemu_chr_add_client(Chardev *s, int fd);
Chardev *qemu_chr_find(const char *name); Chardev *qemu_chr_find(const char *name);
bool qemu_chr_has_feature(Chardev *chr, bool qemu_chr_has_feature(Chardev *chr,
CharDriverFeature feature); ChardevFeature feature);
void qemu_chr_set_feature(Chardev *chr, void qemu_chr_set_feature(Chardev *chr,
CharDriverFeature feature); ChardevFeature feature);
QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename); QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename);
#define TYPE_CHARDEV "chardev" #define TYPE_CHARDEV "chardev"

View File

@ -3171,13 +3171,13 @@ typedef struct {
Chardev *chr; Chardev *chr;
char buf[12]; char buf[12];
size_t buflen; size_t buflen;
} TCPCharDriverTelnetInit; } TCPChardevTelnetInit;
static gboolean tcp_chr_telnet_init_io(QIOChannel *ioc, static gboolean tcp_chr_telnet_init_io(QIOChannel *ioc,
GIOCondition cond G_GNUC_UNUSED, GIOCondition cond G_GNUC_UNUSED,
gpointer user_data) gpointer user_data)
{ {
TCPCharDriverTelnetInit *init = user_data; TCPChardevTelnetInit *init = user_data;
ssize_t ret; ssize_t ret;
ret = qio_channel_write(ioc, init->buf, init->buflen, NULL); ret = qio_channel_write(ioc, init->buf, init->buflen, NULL);
@ -3204,8 +3204,7 @@ static gboolean tcp_chr_telnet_init_io(QIOChannel *ioc,
static void tcp_chr_telnet_init(Chardev *chr) static void tcp_chr_telnet_init(Chardev *chr)
{ {
SocketChardev *s = SOCKET_CHARDEV(chr); SocketChardev *s = SOCKET_CHARDEV(chr);
TCPCharDriverTelnetInit *init = TCPChardevTelnetInit *init = g_new0(TCPChardevTelnetInit, 1);
g_new0(TCPCharDriverTelnetInit, 1);
size_t n = 0; size_t n = 0;
init->chr = chr; init->chr = chr;
@ -4991,13 +4990,13 @@ static const TypeInfo char_udp_type_info = {
}; };
bool qemu_chr_has_feature(Chardev *chr, bool qemu_chr_has_feature(Chardev *chr,
CharDriverFeature feature) ChardevFeature feature)
{ {
return test_bit(feature, chr->features); return test_bit(feature, chr->features);
} }
void qemu_chr_set_feature(Chardev *chr, void qemu_chr_set_feature(Chardev *chr,
CharDriverFeature feature) ChardevFeature feature)
{ {
return set_bit(feature, chr->features); return set_bit(feature, chr->features);
} }