mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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 <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
9977c8943a
commit
7d1740590b
2 changed files with 56 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue