qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Passing fds through a qemu char device


From: Anthony Liguori
Subject: Re: [Qemu-devel] Passing fds through a qemu char device
Date: Fri, 22 May 2009 21:10:41 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

Cam Macdonell wrote:

Hi,

I'm trying to pass eventfds between qemu processes and I'm trying to use a qemu char device to do this. AFAICT with a qemu_chr_device the polling handler only has support to call read()/write(), not send/recvmsg() which are necessary to send and receive fds with SCM_RIGHTS through the socket. Is this true or is there support in Qemu for recvmsg() that I'm not seeing?

The TCP/Unix implementations for CharDriverState use send/recv. You can convert the recv path to always use recvmsg() and introduce an qemu_chr_ioctl() to pass/recv fds.

You can be smart about storing the recv'd fd in the char driver state and that would allow qemu_chr_ioctl(CHR_IOCTL_GET_FD) to not block. qemu_chr_ioctl(CHR_IOCTL_SET_FD) would set the fd to be sent for the next qemu_chr_write() operation.

Just a thought, other interfaces could also work.

Regards,

Anthony Liguori





reply via email to

[Prev in Thread] Current Thread [Next in Thread]