> On 28 Sep 2016, at 18:03, Felipe Franciosi <fel...@nutanix.com> wrote: > > Hi Paolo, > >> On 28 Sep 2016, at 17:59, Paolo Bonzini <pbonz...@redhat.com> wrote: >> >> On 28/09/2016 18:56, Felipe Franciosi wrote: >>> Hi Daniel/Paolo, >>> >>> >>> >>> I have a question regarding this commit: >>> >>> -------------8<------------- >>> Author: Daniel P. Berrange <berra...@redhat.com> >>> AuthorDate: Tue Jan 19 11:14:29 2016 +0000 >>> Commit: Paolo Bonzini <pbonz...@redhat.com> >>> CommitDate: Tue Jan 26 15:58:11 2016 +0100 >>> -------------8<------------- >>> >>> One of the hunks replace unix_send_msgfds() with io_channel_send_full(): >>> >>> According to the code (qemu-char.c:968), io_channel_send_full() is just >>> ignoring the s->write_msgfds parameter. >> >> Hmm, no, it's passing it down: >> >> ret = qio_channel_writev_full( >> ioc, &iov, 1, >> fds, nfds, NULL); >> >> See the implementation of qio_channel_socket_writev in io/channel-socket.c. > > Ah, so my socket has been plumbed with qio_channel_file_writev() for some > reason. That's definitely ignoring the fds. I'll look into why it's not > qio_channel_socket_writev().
Got to the bottom of it. So I was basing myself on this example: http://git.qemu.org/?p=qemu.git;a=blob;f=qemu-char.c;h=fb456cec345b10b12a051d44067cce29cb1bdf44;hb=HEAD#l1117 It says "open a character device to a unix fd" and then uses the QIO File API. Worth checking if that's correct. Thanks, Felipe > > Thanks! > Felipe > >> >> Thanks, >> >> Paolo >> >>> So my question is: when using a chardev implemented by unix sockets, how >>> does one pass file descriptors for vhost-user applications? >>> >>> I’m actually searching qemu-char.c for “write_msgfds” and scratching my >>> head. There are functions to set it, clear it, etc, but none to send it. >