From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG4wM-0000w5-Pp for qemu-devel@nongnu.org; Mon, 24 Sep 2012 05:27:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TG4wL-0005cF-PM for qemu-devel@nongnu.org; Mon, 24 Sep 2012 05:26:58 -0400 Received: from mx3-phx2.redhat.com ([209.132.183.24]:59920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG4wL-0005c5-H2 for qemu-devel@nongnu.org; Mon, 24 Sep 2012 05:26:57 -0400 Date: Mon, 24 Sep 2012 05:26:53 -0400 (EDT) From: Paolo Bonzini Message-ID: <1188499798.360668.1348478813655.JavaMail.root@redhat.com> In-Reply-To: <20120924091340.GN18470@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v9 4/4] block: Support GlusterFS as a QEMU block backend. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: bharata@linux.vnet.ibm.com Cc: Kevin Wolf , Anthony Liguori , Anand Avati , Vijay Bellur , qemu-devel@nongnu.org, Stefan Hajnoczi , Harsh Bora , Amar Tumballi , "Richard W.M. Jones" , Daniel Veillard , Blue Swirl , Avi Kivity > +static int qemu_gluster_parseuri(GlusterConf *gconf, const char *filename) > +{ > + URI *uri; > + QueryParams *qp = NULL; > + bool is_unix = false; > + int ret = 0; > + char *unescape_str = NULL; > + > + uri = uri_parse(filename); > + if (!uri) { > + return -EINVAL; > + } > + > + /* transport */ > + if (!strcmp(uri->scheme, "gluster")) { > + gconf->transport = g_strdup("tcp"); > + } else if (!strcmp(uri->scheme, "gluster+tcp")) { > + gconf->transport = g_strdup("tcp"); > + } else if (!strcmp(uri->scheme, "gluster+unix")) { > + gconf->transport = g_strdup("unix"); > + is_unix = true; > + } else if (!strcmp(uri->scheme, "gluster+rdma")) { > + gconf->transport = g_strdup("rdma"); > + } else { > + ret = -EINVAL; > + goto out; > + } > + > + ret = parse_volume_options(gconf, uri->path); > + if (ret < 0) { > + goto out; > + } > + > + if (uri->query) { > + unescape_str = uri_string_unescape(uri->query, -1, NULL); > + if (!unescape_str) { > + ret = -EINVAL; > + goto out; > + } > + } > + > + qp = query_params_parse(unescape_str); query_params_parse already does the unescaping. Paolo