qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v9 4/4] block: Support GlusterFS as a QEMU block


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v9 4/4] block: Support GlusterFS as a QEMU block backend.
Date: Mon, 24 Sep 2012 05:26:53 -0400 (EDT)

> +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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]