From 7d1740590b6550b2b8ab4901e4f0b704d9733383 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Wed, 22 Jul 2009 09:11:39 +0100 Subject: Add SCM_RIGHTS support to unix socket character devices If a file descriptor is passed via a message with SCM_RIGHTS ancillary data on a unix socket, store the file descriptor for use in the chr_read() handler. Close the file descriptor if it was not used. The qemu_chr_get_msgfd() API provides access to the passed descriptor. Signed-off-by: Mark McLoughlin Signed-off-by: Anthony Liguori --- qemu-char.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qemu-char.h') diff --git a/qemu-char.h b/qemu-char.h index e1aa8db..77d4eda 100644 --- a/qemu-char.h +++ b/qemu-char.h @@ -51,6 +51,7 @@ struct CharDriverState { int (*chr_write)(struct CharDriverState *s, const uint8_t *buf, int len); void (*chr_update_read_handler)(struct CharDriverState *s); int (*chr_ioctl)(struct CharDriverState *s, int cmd, void *arg); + int (*get_msgfd)(struct CharDriverState *s); IOEventHandler *chr_event; IOCanRWHandler *chr_can_read; IOReadHandler *chr_read; @@ -81,6 +82,7 @@ void qemu_chr_reset(CharDriverState *s); void qemu_chr_initial_reset(void); int qemu_chr_can_read(CharDriverState *s); void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len); +int qemu_chr_get_msgfd(CharDriverState *s); void qemu_chr_accept_input(CharDriverState *s); void qemu_chr_info(Monitor *mon); -- cgit v1.1