From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpWPe-0002xm-Ql for qemu-devel@nongnu.org; Thu, 29 Sep 2016 04:09:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpWPa-0008I3-IV for qemu-devel@nongnu.org; Thu, 29 Sep 2016 04:09:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpWPa-0008Hx-Bf for qemu-devel@nongnu.org; Thu, 29 Sep 2016 04:09:46 -0400 Date: Thu, 29 Sep 2016 09:09:40 +0100 From: "Daniel P. Berrange" Message-ID: <20160929080940.GC5312@redhat.com> Reply-To: "Daniel P. Berrange" References: <3E760422-9C3C-45BF-9D01-BCC7CA7411FF@nutanix.com> <58DC4427-DF6D-45C1-8083-2674424E6C4E@nutanix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Question on unixsocket-based chardevs and vhost-user List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Felipe Franciosi Cc: Paolo Bonzini , qemu-devel , "Michael S. Tsirkin" , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau On Wed, Sep 28, 2016 at 05:30:24PM +0000, Felipe Franciosi wrote: > > > On 28 Sep 2016, at 18:03, Felipe Franciosi wrote: > > > > Hi Paolo, > > > >> On 28 Sep 2016, at 17:59, Paolo Bonzini 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 > >>> AuthorDate: Tue Jan 19 11:14:29 2016 +0000 > >>> Commit: Paolo Bonzini > >>> 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. That comment is misleading - when it says "unix fd" is really means a POSIX file descriptor, as distinct from a Win32 file descriptor. It has nothing todo with UNIX sockets. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|