diff options
author | Anthony Liguori | 2013-03-26 16:04:17 +0100 |
---|---|---|
committer | Anthony Liguori | 2013-03-26 16:08:07 +0100 |
commit | cd18720a294bd7244ffda719677dd9c737317b67 (patch) | |
tree | d2e1a7f2dff2e0065e731a0ac27a81007d0da0ca /include/char/char.h | |
parent | hw/qdev: Abort rather than ignoring errors adding device properties (diff) | |
download | qemu-cd18720a294bd7244ffda719677dd9c737317b67.tar.gz qemu-cd18720a294bd7244ffda719677dd9c737317b67.tar.xz qemu-cd18720a294bd7244ffda719677dd9c737317b67.zip |
char: introduce a blocking version of qemu_chr_fe_write
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include/char/char.h')
-rw-r--r-- | include/char/char.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/char/char.h b/include/char/char.h index 0326b2a47b..5c3a7a5756 100644 --- a/include/char/char.h +++ b/include/char/char.h @@ -170,6 +170,21 @@ int qemu_chr_fe_add_watch(CharDriverState *s, GIOCondition cond, int qemu_chr_fe_write(CharDriverState *s, const uint8_t *buf, int len); /** + * @qemu_chr_fe_write_all: + * + * Write data to a character backend from the front end. This function will + * send data from the front end to the back end. Unlike @qemu_chr_fe_write, + * this function will block if the back end cannot consume all of the data + * attempted to be written. + * + * @buf the data + * @len the number of bytes to send + * + * Returns: the number of bytes consumed + */ +int qemu_chr_fe_write_all(CharDriverState *s, const uint8_t *buf, int len); + +/** * @qemu_chr_fe_ioctl: * * Issue a device specific ioctl to a backend. |