static struct glfs *qemu_gluster_init(BlockdevOptionsGluster *gconf,

                                      const char *filename,

                                      QDict *options, Error **errp)

{

    int ret;

    if (filename) {

        ret = qemu_gluster_parse_uri(gconf, filename);

        if (ret < 0) {

            error_setg(errp, "invalid URI");

            error_append_hint(errp, "Usage: file=gluster[+transport]://"

                                    "[host[:port]]/volume/path[?socket=...]\n");

            errno = -ret;

            return NULL;

        }

    } else {

        ret = qemu_gluster_parse_json(gconf, options, errp);

        if (ret < 0) {

            error_append_hint(errp, "Usage: "

                             "-drive driver=qcow2,file.driver=gluster,"

                             "file.volume=testvol,file.path=/path/a.qcow2"

                             "[,file.debug=9],file.server.0.type=tcp,"

                             "file.server.0.host=1.2.3.4,"

                             "file.server.0.port=24007,"

                             "file.server.1.transport=unix,"

                             "file.server.1.socket=/var/run/glusterd.socket ..."

                             "\n");

            errno = -ret;

            return NULL;

        }



    }



    return qemu_gluster_glfs_init(gconf, errp);

}

static struct glfs *qemu_gluster_init(BlockdevOptionsGluster *gconf,

                                      const char *filename,

                                      QDict *options, Error **errp)

{

    int ret;

    if (filename) {

        ret = qemu_gluster_parse_uri(gconf, filename);

        if (ret < 0) {

            error_setg(errp, "invalid URI");

            error_append_hint(errp, "Usage: file=gluster[+transport]:

                                    "[host[:port]]/volume/path[?socket=...]\n");

            errno = -ret;

            return NULL;

        }

    } else {

        ret = qemu_gluster_parse_json(gconf, options, errp);

        if (ret < 0) {

            error_append_hint(errp, "Usage: "

                             "-drive driver=qcow2,file.driver=gluster,"

                             "file.volume=testvol,file.path=/path/a.qcow2"

                             "[,file.debug=9],file.server.0.type=tcp,"

                             "file.server.0.host=1.2.3.4,"

                             "file.server.0.port=24007,"

                             "file.server.1.transport=unix,"

                             "file.server.1.socket=/var/run/glusterd.socket ..."

                             "\n");

            errno = -ret;

            return NULL;

        }



    }



    return qemu_gluster_glfs_init(gconf, errp);

}

                                    "[host[:port]]/volume/path[?socket=...]\n");                              "[,file.debug=9],file.server.0.type=tcp,"
static struct glfs *FUNC_0(BlockdevOptionsGluster *VAR_0,

                                      const char *VAR_1,

                                      QDict *VAR_2, Error **VAR_3)

{

    int VAR_4;

    if (VAR_1) {

        VAR_4 = qemu_gluster_parse_uri(VAR_0, VAR_1);

        if (VAR_4 < 0) {

            error_setg(VAR_3, "invalid URI");

            error_append_hint(VAR_3, "Usage: file=gluster[+transport]:

                                    "[host[:port]]/volume/path[?socket=...]\n");

            errno = -VAR_4;

            return NULL;

        }

    } else {

        VAR_4 = qemu_gluster_parse_json(VAR_0, VAR_2, VAR_3);

        if (VAR_4 < 0) {

            error_append_hint(VAR_3, "Usage: "

                             "-drive driver=qcow2,file.driver=gluster,"

                             "file.volume=testvol,file.path=/path/a.qcow2"

                             "[,file.debug=9],file.server.0.type=tcp,"

                             "file.server.0.host=1.2.3.4,"

                             "file.server.0.port=24007,"

                             "file.server.1.transport=unix,"

                             "file.server.1.socket=/var/run/glusterd.socket ..."

                             "\n");

            errno = -VAR_4;

            return NULL;

        }



    }



    return qemu_gluster_glfs_init(VAR_0, VAR_3);

}

static struct glfs *FUNC_0(BlockdevOptionsGluster *VAR_0,
const char *VAR_1,
QDict *VAR_2, Error **VAR_3)
{ int VAR_4; if (VAR_1) { VAR_4 = qemu_gluster_parse_uri(VAR_0, VAR_1); if (VAR_4 < 0) { error_setg(VAR_3, "invalid URI"); error_append_hint(VAR_3, "Usage: file=gluster[+transport]:
"[host[:port]]/volume/path[?socket=...]\n"); errno = -VAR_4; return NULL; } } else { VAR_4 = qemu_gluster_parse_json(VAR_0, VAR_2, VAR_3); if (VAR_4 < 0) { error_append_hint(VAR_3, "Usage: "
"-drive driver=qcow2,file.driver=gluster,"
"file.volume=testvol,file.path=/path/a.qcow2"
"[,file.debug=9],file.server.0.type=tcp,"
"file.server.0.host=1.2.3.4,"
"file.server.0.port=24007,"
"file.server.1.transport=unix,"
"file.server.1.socket=/var/run/glusterd.socket ..."
"\n"); errno = -VAR_4; return NULL; } } return qemu_gluster_glfs_init(VAR_0, VAR_3); }