Received: from eggs.gnu.org ([2001:4830:134:3::10]:33073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr2oa-0004Wd-1G for qemu-devel@nongnu.org; Tue, 27 Oct 2015 07:53:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zr2oZ-0002kn-1p for qemu-devel@nongnu.org; Tue, 27 Oct 2015 07:53:19 -0400 Received: from mail-vk0-x232.google.com ([2607:f8b0:400c:c05::232]:36026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr2oY-0002ka-TP for qemu-devel@nongnu.org; Tue, 27 Oct 2015 07:53:18 -0400 Received: by vkex70 with SMTP id x70so117662857vke.3 for ; Tue, 27 Oct 2015 04:53:18 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <562F64C9.3050100@vivier.eu> References: <1444151509-5047-1-git-send-email-laurent@vivier.eu> <562EEAD4.7070706@vivier.eu> <562F564A.5040902@vivier.eu> <562F64C9.3050100@vivier.eu> From: Peter Maydell Date: Tue, 27 Oct 2015 11:52:59 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] linux-user: manage SOCK_PACKET socket type. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Riku Voipio , QEMU Developers On 27 October 2015 at 11:49, Laurent Vivier wrote: > > > Le 27/10/2015 12:39, Peter Maydell a =C3=A9crit : >> On 27 October 2015 at 11:35, Peter Maydell wr= ote: >>> Still thinking about the other part of your patch, because >>> "does this start with 'eth'" is not very pretty... > > I agree with you, but I didn't find better. > >> ...can we use the TargetFdTrans machinery from your signalfd >> patch to associate custom sockaddr conversion functions with >> a file descriptor if it's created via socket(PF_PACKET, SOCK_PACKET, ...= )? > > It was my first idea, but it didn't fit well: this machinery is to > translate data (recv/send), not the parameters, but as you say we can > add some functions in the structure. I'll have a look at this. Yes, now we have a generic "special case magic for an fd" we can start to use it for a wider set of things. You might want to separate the "fix the protocol value in socket() calls" change into a different patch from the "fix the sockaddr conversion" change (since the former is easy to review now) -- up to you. thanks -- PMM