summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNikolay Nikolaev <n.nikolaev@virtualopensystems.com>2014-05-27 15:04:02 +0300
committerMichael S. Tsirkin <mst@redhat.com>2014-06-19 16:41:54 +0300
commitd39aac7aac2abd78c483f8527c5aa9ae6156bd49 (patch)
tree5b2b8b15a54f6ba2d4ee5bf622eecb6636b8d5e4 /include
parent7b0bfdf52d694c9a3a96505aa42ce3f8d63acd35 (diff)
downloadqemu-d39aac7aac2abd78c483f8527c5aa9ae6156bd49.tar.gz
Add chardev API qemu_chr_fe_set_msgfds
This will set an array of file descriptors to the internal structures. The next time a message is send the array will be send as ancillary data. This feature works on the UNIX domain socket backend only. 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')
-rw-r--r--include/sysemu/char.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/sysemu/char.h b/include/sysemu/char.h
index 5281123c9a..1aa080e00a 100644
--- a/include/sysemu/char.h
+++ b/include/sysemu/char.h
@@ -62,6 +62,7 @@ struct CharDriverState {
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 (*set_msgfds)(struct CharDriverState *s, int *fds, int num);
int (*chr_add_client)(struct CharDriverState *chr, int fd);
IOEventHandler *chr_event;
IOCanReadHandler *chr_can_read;
@@ -229,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_set_msgfds:
+ *
+ * For backends capable of fd passing, set an array of fds to be passed with
+ * the next send operation.
+ * A subsequent call to this function before calling a write function will
+ * 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.
+ */
+int qemu_chr_fe_set_msgfds(CharDriverState *s, int *fds, int num);
+
+/**
* @qemu_chr_fe_claim:
*
* Claim a backend before using it, should be called before calling