From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zx0br-0008EH-64 for qemu-devel@nongnu.org; Thu, 12 Nov 2015 17:44:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zx0bn-00057l-4n for qemu-devel@nongnu.org; Thu, 12 Nov 2015 17:44:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zx0bm-00057h-Sy for qemu-devel@nongnu.org; Thu, 12 Nov 2015 17:44:47 -0500 References: <1447323728-2427-1-git-send-email-prasanna.kalever@redhat.com> <1447323728-2427-4-git-send-email-prasanna.kalever@redhat.com> From: Eric Blake Message-ID: <5645165C.2000906@redhat.com> Date: Thu, 12 Nov 2015 15:44:44 -0700 MIME-Version: 1.0 In-Reply-To: <1447323728-2427-4-git-send-email-prasanna.kalever@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IFrECgSOECO1xwRrwLFBOD8XPwCUcd9cN" Subject: Re: [Qemu-devel] [PATCH 3/4] block/gluster: using new qapi schema List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Prasanna Kumar Kalever , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pkrempa@redhat.com, stefanha@gmail.com, jcody@redhat.com, deepakcs@redhat.com, bharata@linux.vnet.ibm.com, rtalur@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IFrECgSOECO1xwRrwLFBOD8XPwCUcd9cN Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/12/2015 03:22 AM, Prasanna Kumar Kalever wrote: > this patch adds GlusterConf to qapi/block-core.json >=20 > Signed-off-by: Prasanna Kumar Kalever > --- > block/gluster.c | 104 +++++++++++++++++++++++++------------------= -------- > qapi/block-core.json | 60 +++++++++++++++++++++++++++-- > 2 files changed, 109 insertions(+), 55 deletions(-) >=20 Pointing it out here for completeness, even though I first stumbled on it when reviewing 4/4: > @@ -190,13 +180,23 @@ static int qemu_gluster_parseuri(GlusterConf *gco= nf, const char *filename) > ret =3D -EINVAL; > goto out; > } > - gconf->host =3D g_strdup(qp->p[0].value); > + gconf->server->host =3D g_strdup(qp->p[0].value); This is abusing the 'host' field of GlusterServer to track a socket path, and ignores the fact that port is meaningless for a gluster+unix:// connection. > @@ -224,8 +225,9 @@ static struct glfs *qemu_gluster_init(GlusterConf *= gconf, const char *filename, > goto out; > } > =20 > - ret =3D glfs_set_volfile_server(glfs, gconf->transport, gconf->hos= t, > - gconf->port); > + ret =3D glfs_set_volfile_server(glfs, > + GlusterTransport_lookup[gconf->serve= r->transport], > + gconf->server->host, gconf->server->= port); At least gluster itself has the same overloaded abuse of terminology; I'm hoping that a port of 0 is okay when requesting a "unix" volfile_server. [I don't know, because I didn't read the docs for glfs_set_volfile_server()] > +## > +# @GlusterServer > +# > +# Details for connecting to a gluster server > +# > +# @host: host address (hostname/ipv4/ipv6 addresses) > +# > +# @port: #optional port number on which glusterd is listening > +# (default 24007) > +# > +# @transport: #optional transport type used to connect to gluster man= agement > +# daemon (default 'tcp') > +# > +# Since: 2.5 > +## > +{ 'struct': 'GlusterServer', > + 'data': { 'host': 'str', > + '*port': 'int', > + '*transport': 'GlusterTransport' } } And my idea on patch 4/4 was that converting this from simple struct to flat union might be a more realistic view of things (if transport is 'unix', there can't be a port; and rather than abusing the name 'host' we could use the name 'socket'; similarly for 'rdma') - but without additional qapi support, I don't know that we can have an optional 'transport' and still have a discriminated union in time for 2.5. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IFrECgSOECO1xwRrwLFBOD8XPwCUcd9cN 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/ iQEcBAEBCAAGBQJWRRZcAAoJEKeha0olJ0NqQtkH/Ajx1Ne6XWe5vVe6taSkBqEv 12nvipaA8RQhC0Aobn3/l3yyMFC9eMaHqkJrRFYEyS9wl58YIdoe59Rs6+0ydHFV kW8IFlBIAYJ1kTVUOAVaOMnYkaLfMj8zjWt8UKDUEUeKpxNyBHZSoKyPrRRbT7Pm 7762LwhW1kBPqfDTY8G8/IW4cMMb5lYjOz1akokKXXQOjF22KCO1sZETfdYreNa/ 8R/QFDAcVuNiyHkXo9EaHb2Pgr5OZN8D0duxBHAdZuKq3zK4S+YeAKHNa63IinaQ L2ulZSMOEpuoXiDj9aZ0ntvnnNuKWCr39ylyCeGflLzrNMk/XveB//IBC8P/roY= =fem+ -----END PGP SIGNATURE----- --IFrECgSOECO1xwRrwLFBOD8XPwCUcd9cN--