diff options
author | Nikolay Nikolaev <n.nikolaev@virtualopensystems.com> | 2014-05-27 15:04:15 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-19 16:41:55 +0300 |
commit | c76bf6bb8fbbb233a7d3641e09229d23747d5ee3 (patch) | |
tree | ae75adf51d292d0df339b6b82d194caa9e44c1f9 /include/sysemu/char.h | |
parent | d39aac7aac2abd78c483f8527c5aa9ae6156bd49 (diff) | |
download | hqemu-c76bf6bb8fbbb233a7d3641e09229d23747d5ee3.zip hqemu-c76bf6bb8fbbb233a7d3641e09229d23747d5ee3.tar.gz |
Add chardev API qemu_chr_fe_get_msgfds
This extends the existing qemu_chr_fe_get_msgfd by allowing to read a set
of fds. The function for receiving the fds - unix_process_msgfd is extended
to allocate the needed array size.
Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/sysemu/char.h')
-rw-r--r-- | include/sysemu/char.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/sysemu/char.h b/include/sysemu/char.h index 1aa080e..930aaf1 100644 --- a/include/sysemu/char.h +++ b/include/sysemu/char.h @@ -61,7 +61,7 @@ struct CharDriverState { GSource *(*chr_add_watch)(struct CharDriverState *s, GIOCondition cond); void (*chr_update_read_handler)(struct CharDriverState *s); int (*chr_ioctl)(struct CharDriverState *s, int cmd, void *arg); - int (*get_msgfd)(struct CharDriverState *s); + int (*get_msgfds)(struct CharDriverState *s, int* fds, int num); int (*set_msgfds)(struct CharDriverState *s, int *fds, int num); int (*chr_add_client)(struct CharDriverState *chr, int fd); IOEventHandler *chr_event; @@ -230,6 +230,19 @@ int qemu_chr_fe_ioctl(CharDriverState *s, int cmd, void *arg); int qemu_chr_fe_get_msgfd(CharDriverState *s); /** + * @qemu_chr_fe_get_msgfds: + * + * For backends capable of fd passing, return the number of file received + * descriptors and fills the fds array up to num elements + * + * Returns: -1 if fd passing isn't supported or there are no pending file + * descriptors. If file descriptors are returned, subsequent calls to + * this function will return -1 until a client sends a new set of file + * descriptors. + */ +int qemu_chr_fe_get_msgfds(CharDriverState *s, int *fds, int num); + +/** * @qemu_chr_fe_set_msgfds: * * For backends capable of fd passing, set an array of fds to be passed with |