From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFk2V-00031n-Tv for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:26:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFk2Q-0004dr-St for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:26:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFk2Q-0004dn-NA for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:25:58 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 5AFF8D47B6 for ; Wed, 22 Jun 2016 15:25:58 +0000 (UTC) Received: from wei-thinkpad.nay.redhat.com (vpn1-6-208.pek2.redhat.com [10.72.6.208]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5MFPuXE002607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 22 Jun 2016 11:25:57 -0400 References: <1464712247-11655-2-git-send-email-wexu@redhat.com> From: Wei Xu Message-ID: <576AAE03.3000403@redhat.com> Date: Wed, 22 Jun 2016 23:25:55 +0800 MIME-Version: 1.0 In-Reply-To: <1464712247-11655-2-git-send-email-wexu@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC Patch 1/3] chardev: add new socket fd parameter 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. When manage VMs via libvirt, qemu ofter runs with limited permission, thus qemu can't create a file/socket, this patch is to add a new parameter 'sockfd' to accept fd opened and passed in from libvirt. Signed-off-by: Wei Xu --- qapi-schema.json | 3 ++- qemu-char.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qapi-schema.json b/qapi-schema.json index 8483bdf..e9f0268 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2921,7 +2921,8 @@ ## { 'struct': 'UnixSocketAddress', 'data': { - 'path': 'str' } } + 'path': 'str', + 'sockfd': 'int32' } } ## # @SocketAddress diff --git a/qemu-char.c b/qemu-char.c index b597ee1..ea9c02e 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -4116,6 +4116,9 @@ QemuOptsList qemu_chardev_opts = { .name = "path", .type = QEMU_OPT_STRING, },{ + .name = "sockfd", + .type = QEMU_OPT_NUMBER, + },{ .name = "host", .type = QEMU_OPT_STRING, },{ -- 2.7.1