From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WClkE-0001ox-7F for qemu-devel@nongnu.org; Mon, 10 Feb 2014 02:57:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WClk8-0006AC-7o for qemu-devel@nongnu.org; Mon, 10 Feb 2014 02:57:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WClk7-0006A8-Vc for qemu-devel@nongnu.org; Mon, 10 Feb 2014 02:57:28 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1A7vR70010229 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Feb 2014 02:57:27 -0500 Date: Mon, 10 Feb 2014 15:57:34 +0800 From: Fam Zheng Message-ID: <20140210075734.GI15707@T430.nay.redhat.com> References: <1391939335-31580-1-git-send-email-pbonzini@redhat.com> <1391939335-31580-8-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1391939335-31580-8-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 07/20] gluster: default scheme to gluster:// and host to localhost. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com On Sun, 02/09 10:48, Paolo Bonzini wrote: > Currently, "gluster:///volname/img" and (using file. options) > "file.driver=gluster,file.filename=foo" will segfault. Also, > "//host/volname/img" will be rejected, but it is a valid URL > that should be accepted just fine with "file.driver=gluster". > Accept all of these, by inferring missing transport and host > as TCP and localhost respectively. > > Signed-off-by: Paolo Bonzini > --- > block/gluster.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/block/gluster.c b/block/gluster.c > index a009b15..f9dd37f 100644 > --- a/block/gluster.c > +++ b/block/gluster.c > @@ -127,7 +127,7 @@ static int qemu_gluster_parseuri(GlusterConf *gconf, const char *filename) > } > > /* transport */ > - if (!strcmp(uri->scheme, "gluster")) { > + if (!uri->scheme || !strcmp(uri->scheme, "gluster")) { > gconf->transport = g_strdup("tcp"); > } else if (!strcmp(uri->scheme, "gluster+tcp")) { > gconf->transport = g_strdup("tcp"); > @@ -163,7 +163,7 @@ static int qemu_gluster_parseuri(GlusterConf *gconf, const char *filename) > } > gconf->server = g_strdup(qp->p[0].value); > } else { > - gconf->server = g_strdup(uri->server); > + gconf->server = g_strdup(uri->server ? uri->server : "localhost"); > gconf->port = uri->port; > } > > -- > 1.8.5.3 > > > Reviewed-by: Fam Zheng