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: 9193177 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 08DA46075C for ; Wed, 22 Jun 2016 15:35:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDBC3283FD for ; Wed, 22 Jun 2016 15:35:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2BB628409; Wed, 22 Jun 2016 15:35:28 +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 8DC6E283FD for ; Wed, 22 Jun 2016 15:35:28 +0000 (UTC) Received: from localhost ([::1]:59149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFkBb-0005TA-3K for patchwork-qemu-devel@patchwork.kernel.org; Wed, 22 Jun 2016 11:35:27 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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, },{