diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-03-27 20:29:39 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-04 19:21:25 -0500 |
commit | 44c473decd4de5559487430f876de53c607b1e9d (patch) | |
tree | 8b00d24b4297565dd29de621891b38e32f1706a3 /include | |
parent | 4dbb9ed3263e0f48282a2fc3d05099ba63e5b0e2 (diff) |
qemu-char: Add qemu_chr_fe_claim / _release helper functions
Add qemu_chr_fe_claim / _release helper functions for properly dealing with
avail_connections.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Message-id: 1364412581-3672-2-git-send-email-hdegoede@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/char/char.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/char/char.h b/include/char/char.h index 32c9999113..9d1ea46117 100644 --- a/include/char/char.h +++ b/include/char/char.h @@ -203,6 +203,35 @@ int qemu_chr_fe_ioctl(CharDriverState *s, int cmd, void *arg); int qemu_chr_fe_get_msgfd(CharDriverState *s); /** + * @qemu_chr_fe_claim: + * + * Claim a backend before using it, should be called before calling + * qemu_chr_add_handlers(). + * + * Returns: -1 if the backend is already in use by another frontend, 0 on + * success. + */ +int qemu_chr_fe_claim(CharDriverState *s); + +/** + * @qemu_chr_fe_claim_no_fail: + * + * Like qemu_chr_fe_claim, but will exit qemu with an error when the + * backend is already in use. + */ +void qemu_chr_fe_claim_no_fail(CharDriverState *s); + +/** + * @qemu_chr_fe_claim: + * + * Release a backend for use by another frontend. + * + * Returns: -1 if the backend is already in use by another frontend, 0 on + * success. + */ +void qemu_chr_fe_release(CharDriverState *s); + +/** * @qemu_chr_be_can_write: * * Determine how much data the front end can currently accept. This function |