From patchwork Wed Jun 22 15:25:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Xu X-Patchwork-Id: 639242 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rZTFf4fGyz9t1C for ; Thu, 23 Jun 2016 01:35:50 +1000 (AEST) Received: from localhost ([::1]:59150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFkBw-0005qS-A7 for incoming@patchwork.ozlabs.org; Wed, 22 Jun 2016 11:35:48 -0400 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> To: qemu-devel@nongnu.org From: Wei Xu X-Forwarded-Message-Id: <1464712247-11655-2-git-send-email-wexu@redhat.com> Message-ID: <576AAE03.3000403@redhat.com> Date: Wed, 22 Jun 2016 23:25:55 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1464712247-11655-2-git-send-email-wexu@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 22 Jun 2016 15:25:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC Patch 1/3] chardev: add new socket fd parameter for unix socket 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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, },{