From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFk1V-00027h-L6 for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:25:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFk1R-0004Dn-Kj for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:25:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFk1R-0004Df-EK for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:24:57 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94BC07F0B3 for ; Wed, 22 Jun 2016 15:24:56 +0000 (UTC) Received: from wei-thinkpad.nay.redhat.com (vpn1-6-208.pek2.redhat.com [10.72.6.208]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5MFOsIe021999 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 22 Jun 2016 11:24:56 -0400 References: <1464712247-11655-1-git-send-email-wexu@redhat.com> From: Wei Xu Message-ID: <576AADC5.3080506@redhat.com> Date: Wed, 22 Jun 2016 23:24:53 +0800 MIME-Version: 1.0 In-Reply-To: <1464712247-11655-1-git-send-email-wexu@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC Patch 0/3] Accept passed in socket 'fd' open from outside for unix socket List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org There has been comments on this patch, but i forgot adding this patch to the list, just forward it again. Recently I'm working on a fd passing issue, selinux forbids qemu to create a unix socket for a chardev when managing VMs with libvirt, because qemu don't have sufficient permissions in this case, and proposal from libvirt team is opening the 'fd' in libvirt and merely passing it to qemu. I finished a RFC patch for Unix socket after a glance of the code, and not sure if this is right or there maybe other side-effects, please point me out. I tested it for both server and client mode 'PF_UNIX' socket with a VM running vhost-user. Old command line: -chardev socket,id=char0,path=/var/run/openvswitch/vhost-user1,server New command line: -chardev socket,id=char0,path=/var/run/openvswitch/vhost-user1,server,sockfd=$n because unix socket is bundled with a path, so it should be kept even with the 'fd' is indicated, this looks odd, any comments? Wei Xu (3): chardev: add new socket fd parameter for unix socket chardev: save the passed in 'fd' parameter during parsing sockets: replace creating a new socket with the record one qapi-schema.json | 3 ++- qemu-char.c | 10 ++++++++++ util/qemu-sockets.c | 25 +++++++++++++++++-------- 3 files changed, 29 insertions(+), 9 deletions(-) -- 2.7.1