From patchwork Sun May 22 16:56:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 9130987 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9E0EE60459 for ; Sun, 22 May 2016 16:57:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D36F281AE for ; Sun, 22 May 2016 16:57:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51A3D281B9; Sun, 22 May 2016 16:57:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D81FA281AE for ; Sun, 22 May 2016 16:57:14 +0000 (UTC) Received: from localhost ([::1]:43901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4Wgk-0007pQ-0y for patchwork-qemu-devel@patchwork.kernel.org; Sun, 22 May 2016 12:57:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4WgK-0007nR-Al for qemu-devel@nongnu.org; Sun, 22 May 2016 12:56:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4WgG-0004sC-5K for qemu-devel@nongnu.org; Sun, 22 May 2016 12:56:47 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:51417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4WgF-0004s5-RH for qemu-devel@nongnu.org; Sun, 22 May 2016 12:56:44 -0400 Received: from Quad.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0M4qhJ-1bTMhK0UtJ-00yzql; Sun, 22 May 2016 18:56:35 +0200 From: Laurent Vivier To: Riku Voipio Date: Sun, 22 May 2016 18:56:20 +0200 Message-Id: <1463936181-23683-3-git-send-email-laurent@vivier.eu> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1463936181-23683-1-git-send-email-laurent@vivier.eu> References: <1463936181-23683-1-git-send-email-laurent@vivier.eu> X-Provags-ID: V03:K0:t5NTL7VEOqAH0IM7R0stg7W5kNVAlGFAD2G/kalY7moMjfPl6v8 gZ9XGJrOf4Ey/a0kYJfCa6hFjBi4P6GTCi3mdWlBxUz/QPq9lx1oQhsjwhSRod3uazrIgdi 3Er6+iu4oFlvJ44ONHaOQAFJ+54FGFIBhX1Q7uhq8N4+I0SS6AOuCp7ew8vIYO1Ya+e7juL MbwKh165x6v6x6m8C/1ng== X-UI-Out-Filterresults: notjunk:1; V01:K0:rkcv3+3C9sc=:BWFEaRbP3UW0IHZqB9qpqp hJFWyWPRDm8Jw3byZsytyt0X3iOA2GG/U2d2MobEOhgwYpUgMLMBKxWJhuWE20hBMXIiPhE4Z 51XtP4HKpI3QuMvikmECiUFWq1hcdnJ1m81okNbsSOrGgtmElGq6ww0n5eEvnSJdYE9NDnMLJ 6lquPSG0tJhdl+v594kqyy0bh/HZEL366thsiyTUchylD9WsNFimRHLpaYsQOD1bPK7kjK5ZZ L9fXT+UOZMdoKHnS+UnpMSfKtxuEi47DNo989SpEStQ8Cx4b9FxU8qGsHYp63Q0v6abToIuBs +Ii1pyR+JbyKShesyE/3cocNwQ+GQIh88smDny1L/KFi/HhA2hJIH+CdnpNqDARjcjaosXjit 4XQyum+mfFSPq8RWx/19gew4urrZXbVAF0rnUP7fOg+8JVWv4QSFZV3OLFlQNUf6Dlefv2cxM 2YA4vlsq2790x1XHgCoiBxaZ2wVE1LxL11ijT37fXoUTCcM1gq/8snACGDOXrgJt+1ThtjZku 2SdkwPoKlS97NW1ue//R803ZDyUOvtli0uRIdObDvDG2/kVrXmVQfkxKOdzlQnFxHGsfjSBXN A9ZDch+61mVB3tXUKfCn61OlrylNZEXLHTHt0joJZJPFLhDc6ZrvriN15JOg9CWt1N3osrNX/ LD4k3DXN/BLYwxBtA6OIu4QK44fMMu+rXiLhs8RsQVl5bCx8wdBD3l0+4lEhqsNb1jJg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.24 Subject: [Qemu-devel] [PATCH v2 2/3] linux-user: support netlink protocol NETLINK_KOBJECT_UEVENT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is the protocol used by udevd to manage kernel events. Signed-off-by: Laurent Vivier --- v2: Check domain before opening socket linux-user/syscall.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 3f1b2cc..ff63bf5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2679,7 +2679,8 @@ static abi_long do_socket(int domain, int type, int protocol) } if (domain == PF_NETLINK && - protocol != NETLINK_ROUTE) { + !(protocol == NETLINK_ROUTE || + protocol == NETLINK_KOBJECT_UEVENT)) { return -EPFNOSUPPORT; } @@ -2701,6 +2702,9 @@ static abi_long do_socket(int domain, int type, int protocol) case NETLINK_ROUTE: fd_trans_register(ret, &target_netlink_route_trans); break; + case NETLINK_KOBJECT_UEVENT: + /* nothing to do: messages are strings */ + break; default: g_assert_not_reached(); }