From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFkFz-0001da-UR for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:40:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFkFy-00007t-TD for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:39:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFkFy-00007d-LL for qemu-devel@nongnu.org; Wed, 22 Jun 2016 11:39:58 -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 2FBCDC05B1EF for ; Wed, 22 Jun 2016 15:39:58 +0000 (UTC) References: <1464712247-11655-2-git-send-email-wexu@redhat.com> <576AAE03.3000403@redhat.com> From: Eric Blake Message-ID: <576AB14D.7050304@redhat.com> Date: Wed, 22 Jun 2016 09:39:57 -0600 MIME-Version: 1.0 In-Reply-To: <576AAE03.3000403@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="w6WjBftAftwJugrerESNXjx9pTKiLAi20" Subject: Re: [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: Wei Xu , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --w6WjBftAftwJugrerESNXjx9pTKiLAi20 From: Eric Blake To: Wei Xu , qemu-devel@nongnu.org Message-ID: <576AB14D.7050304@redhat.com> Subject: Re: [Qemu-devel] [RFC Patch 1/3] chardev: add new socket fd parameter for unix socket References: <1464712247-11655-2-git-send-email-wexu@redhat.com> <576AAE03.3000403@redhat.com> In-Reply-To: <576AAE03.3000403@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/22/2016 09:25 AM, Wei Xu wrote: > There has been comments on this patch, but i forgot adding this patch t= o > the list, just forward it again. >=20 > 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. >=20 > Signed-off-by: Wei Xu > --- > qapi-schema.json | 3 ++- > qemu-char.c | 3 +++ > 2 files changed, 5 insertions(+), 1 deletion(-) >=20 > 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' } } Missing documentation. This makes the new 'sockfd' parameter mandatory, but SocketAddress is an input type. This is not backwards compatible. At best, you'd want to make it optional, but I'm not even convinced you want to add it, since we already can use the magic /dev/fdset/nnn in 'path' to pass an arbitrary fd if the underlying code uses qemu_open(). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --w6WjBftAftwJugrerESNXjx9pTKiLAi20 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXarFNAAoJEKeha0olJ0NqqegIAIZtqdM6yloew0UM0Ks3TCdr 5qcn4LYX/+8Ve/iqSdNKjvXzJtElYSbQY3hmfKDoAy/nSOei33l+1DfMZVNgM28n 3uihJ8/An61cfYiHs8s/DjUoIIfbYbrPMImlcKaYly9hQuQ2DYk8geaUm+KZ70WJ VWw3I9ZaO8lTtXNOiInjJhP8pKUCmk3bGLW7I0XEayIKZw/2gn/Cd+bPCyn2EjQj 9qxNavoGZR2a+Uw23AUm+BbuvQEo3jpWtvK3C5DlVf9fQtkdSbmoNrznkWlb8aZW XuyW2LBKEvsYVy+2/Ghvv9nZSHn8snGnTaJ8f8EReWTpY/gwmlT9mh7nW9P/uoM= =T7aH -----END PGP SIGNATURE----- --w6WjBftAftwJugrerESNXjx9pTKiLAi20--