* @qemu_chr_fe_disconnect:
*
* Close a fd accpeted by character backend.
+ * Without associated CharDriver, do nothing.
*/
void qemu_chr_fe_disconnect(CharBackend *be);
/**
* @qemu_chr_fe_wait_connected:
*
- * Wait for characted backend to be connected.
+ * Wait for characted backend to be connected, return < 0 on error or
+ * if no assicated CharDriver.
*/
int qemu_chr_fe_wait_connected(CharBackend *be, Error **errp);
* 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
* can see what you type if you try to type QMP commands.
+ * Without associated CharDriver, do nothing.
*
* @echo true to enable echo, false to disable echo
*/
*
* Set character frontend open status. This is an indication that the
* front end is ready (or not) to begin doing I/O.
+ * Without associated CharDriver, do nothing.
*/
void qemu_chr_fe_set_open(CharBackend *be, int fe_open);
/**
* @qemu_chr_fe_event:
*
- * Send an event from the front end to the back end.
+ * Send an event from the front end to the back end. It does nothing
+ * without associated CharDriver.
*
* @event the event to send
*/
/**
* @qemu_chr_fe_printf:
*
- * Write to a character backend using a printf style interface.
- * This function is thread-safe.
+ * Write to a character backend using a printf style interface. This
+ * function is thread-safe. It does nothing without associated
+ * CharDriver.
*
* @fmt see #printf
*/
* 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)
* is active; return the #GSource's tag. If it is disconnected,
- * return 0.
+ * or without associated CharDriver, return 0.
*
* @cond the condition to poll for
* @func the function to call when the condition happens
* @buf the data
* @len the number of bytes to send
*
- * Returns: the number of bytes consumed
+ * Returns: the number of bytes consumed (0 if no assicated CharDriver)
*/
int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len);
* @buf the data
* @len the number of bytes to send
*
- * Returns: the number of bytes consumed
+ * Returns: the number of bytes consumed (0 if no assicated CharDriver)
*/
int qemu_chr_fe_write_all(CharBackend *be, const uint8_t *buf, int len);
* @buf the data buffer
* @len the number of bytes to read
*
- * Returns: the number of bytes read
+ * Returns: the number of bytes read (0 if no assicated CharDriver)
*/
int qemu_chr_fe_read_all(CharBackend *be, uint8_t *buf, int len);
* @cmd see CHR_IOCTL_*
* @arg the data associated with @cmd
*
- * Returns: if @cmd is not supported by the backend, -ENOTSUP, otherwise the
- * return value depends on the semantics of @cmd
+ * Returns: if @cmd is not supported by the backend or there is no
+ * associated CharDriver, -ENOTSUP, otherwise the return
+ * value depends on the semantics of @cmd
*/
int qemu_chr_fe_ioctl(CharBackend *be, int cmd, void *arg);
* result in overwriting the fd array with the new value without being send.
* Upon writing the message the fd array is freed.
*
- * Returns: -1 if fd passing isn't supported.
+ * Returns: -1 if fd passing isn't supported or no associated CharDriver.
*/
int qemu_chr_fe_set_msgfds(CharBackend *be, int *fds, int num);
/**
* @qemu_chr_fe_get_driver:
*
- * Returns the driver associated with a CharBackend or NULL.
+ * Returns the driver associated with a CharBackend or NULL if no
+ * associated CharDriver.
*/
CharDriverState *qemu_chr_fe_get_driver(CharBackend *be);
* @qemu_chr_fe_deinit:
*
* Dissociate the CharBackend from the CharDriver.
+ *
+ * Safe to call without associated CharDriver.
*/
void qemu_chr_fe_deinit(CharBackend *b);
*
* Set the front end char handlers. The front end takes the focus if
* any of the handler is non-NULL.
+ *
+ * Without associated CharDriver, nothing is changed.
*/
void qemu_chr_fe_set_handlers(CharBackend *b,
IOCanReadHandler *fd_can_read,
/**
* @qemu_chr_fe_take_focus:
*
- * Take the focus (if the front end is muxed)
+ * Take the focus (if the front end is muxed).
+ *
+ * Without associated CharDriver, nothing is changed.
*/
void qemu_chr_fe_take_focus(CharBackend *b);