From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecWsx-0007Zz-Sa for qemu-devel@nongnu.org; Fri, 19 Jan 2018 08:39:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecWrB-0003Cf-Iz for qemu-devel@nongnu.org; Fri, 19 Jan 2018 08:39:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51882) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ecWrB-0003C1-75 for qemu-devel@nongnu.org; Fri, 19 Jan 2018 08:37:21 -0500 Date: Fri, 19 Jan 2018 13:37:08 +0000 From: "Daniel P. Berrange" Message-ID: <20180119133708.GM16798@redhat.com> Reply-To: "Daniel P. Berrange" References: <425e38f28bba536cfb1ae389ffa963984990f306.1515960078.git.pisa@cmp.felk.cvut.cz> <65ff7759-2e09-fba6-e60e-41e8d89d0e7c@amsat.org> <201801152229.53520.pisa@cmp.felk.cvut.cz> <04fbdf17-6431-5d67-6681-3cc0f375b32a@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <04fbdf17-6431-5d67-6681-3cc0f375b32a@amsat.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V4 2/7] CAN bus support to connect bust to Linux host SocketCAN interface. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Cc: Pavel Pisa , Gerd Hoffmann , Paolo Bonzini , qemu-devel@nongnu.org, Marek Vasut , Oliver Hartkopp , Stefan Hajnoczi , Deniz Eren , Oleksij Rempel , Konrad Frederic , Jan Kiszka On Mon, Jan 15, 2018 at 09:12:09PM -0300, Philippe Mathieu-Daud=C3=A9 wro= te: > On 01/15/2018 06:29 PM, Pavel Pisa wrote: > >>> + /* open socket */ > >>> + s =3D socket(PF_CAN, SOCK_RAW, CAN_RAW); > >> > >> I never used it, but I think QEMU uses his socket API: "qemu/sockets= .h" > >=20 > > The SocketCAN host connection code is Linux specific, > > but I can switch to qemu_socket() if it is preferred. > > But address family has to be from Linux header file anyway. >=20 > qemu_socket() sockets are heavily tested and already solve many things, > like async I/O and error handling. NB that's just the low level system call wrapper. All it really does is ensure O_CLOSEXEC is set for all sockets. It should defintely be used just for that reason alone though.=20 Regards, Daniel --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :|