From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1ZJI-0004dM-Lx for qemu-devel@nongnu.org; Wed, 15 Aug 2012 04:50:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1ZJH-0001PL-9X for qemu-devel@nongnu.org; Wed, 15 Aug 2012 04:50:40 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:48279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1ZJG-0001P9-M3 for qemu-devel@nongnu.org; Wed, 15 Aug 2012 04:50:39 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 15 Aug 2012 14:20:35 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7F8oUjt39780602 for ; Wed, 15 Aug 2012 14:20:30 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7FEK5iC022538 for ; Wed, 15 Aug 2012 19:50:05 +0530 Date: Wed, 15 Aug 2012 14:21:58 +0530 From: Bharata B Rao Message-ID: <20120815085158.GL24944@in.ibm.com> References: <20120809130010.GA7960@in.ibm.com> <20120809130216.GC7960@in.ibm.com> <5028F815.40309@redhat.com> <20120814043801.GB24944@in.ibm.com> <502A0C66.3060107@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <502A0C66.3060107@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 2/2] block: Support GlusterFS as a QEMU block backend Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Anthony Liguori , Anand Avati , Stefan Hajnoczi , Vijay Bellur , Amar Tumballi , qemu-devel@nongnu.org, Blue Swirl , Paolo Bonzini On Tue, Aug 14, 2012 at 10:29:26AM +0200, Kevin Wolf wrote: > Am 14.08.2012 06:38, schrieb Bharata B Rao: > > Kevin, Thanks for your review. I will address all of your comments > > in the next iteration, but have a few questions/comments on the others... > > > > On Mon, Aug 13, 2012 at 02:50:29PM +0200, Kevin Wolf wrote: > >>> +static int parse_server(GlusterURI *uri, char *server) > >>> +{ > >>> + int ret = -EINVAL; > >>> + char *token, *saveptr; > >>> + char *p, *q = server; > >>> + > >>> + p = strchr(server, '['); > >>> + if (p) { > >>> + /* [ipv6] */ > >>> + if (p != server) { > >>> + /* [ not in the beginning */ > >>> + goto out; > >>> + } > >>> + q++; > >>> + p = strrchr(p, ']'); > >>> + if (!p) { > >>> + /* No matching ] */ > >>> + goto out; > >>> + } > >>> + *p++ = '\0'; > >>> + uri->server = g_strdup(q); > >>> + > >>> + if (*p) { > >>> + if (*p != ':') { > >>> + /* [ipv6] followed by something other than : */ > >>> + goto out; > >>> + } > >>> + uri->port = strtoul(++p, NULL, 0); > >>> + if (uri->port < 0) { > >>> + goto out; > >>> + } > >> > > > In any case, let me see if I can get rid of this altogether and reuse > > qemu-sockets.c:inet_parse(). Using inet_parse() outside of qemu-sockets.c needs some work like making it non-static, defining QemuOptsList for inet opts and fixing some issues with inet_parse(like making it successfully parse 'hostname' also instead of just 'hostname:port'). I will give this a try and send a patch. Regards, Bharata.