static void nbd_refresh_filename(BlockDriverState *bs)

{

    QDict *opts = qdict_new();

    const char *path   = qdict_get_try_str(bs->options, "path");

    const char *host   = qdict_get_try_str(bs->options, "host");

    const char *port   = qdict_get_try_str(bs->options, "port");

    const char *export = qdict_get_try_str(bs->options, "export");



    qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("nbd")));



    if (path && export) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd+unix:///%s?socket=%s", export, path);

    } else if (path && !export) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd+unix://?socket=%s", path);

    } else if (!path && export && port) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd://%s:%s/%s", host, port, export);

    } else if (!path && export && !port) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd://%s/%s", host, export);

    } else if (!path && !export && port) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd://%s:%s", host, port);

    } else if (!path && !export && !port) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd://%s", host);

    }



    if (path) {

        qdict_put_obj(opts, "path", QOBJECT(qstring_from_str(path)));

    } else if (port) {

        qdict_put_obj(opts, "host", QOBJECT(qstring_from_str(host)));

        qdict_put_obj(opts, "port", QOBJECT(qstring_from_str(port)));

    } else {

        qdict_put_obj(opts, "host", QOBJECT(qstring_from_str(host)));

    }

    if (export) {

        qdict_put_obj(opts, "export", QOBJECT(qstring_from_str(export)));

    }



    bs->full_open_options = opts;

}

static void nbd_refresh_filename(BlockDriverState *bs)

{

    QDict *opts = qdict_new();

    const char *path   = qdict_get_try_str(bs->options, "path");

    const char *host   = qdict_get_try_str(bs->options, "host");

    const char *port   = qdict_get_try_str(bs->options, "port");

    const char *export = qdict_get_try_str(bs->options, "export");



    qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("nbd")));



    if (path && export) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd+unix:

    } else if (path && !export) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd+unix:

    } else if (!path && export && port) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd:

    } else if (!path && export && !port) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd:

    } else if (!path && !export && port) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd:

    } else if (!path && !export && !port) {

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),

                 "nbd:

    }



    if (path) {

        qdict_put_obj(opts, "path", QOBJECT(qstring_from_str(path)));

    } else if (port) {

        qdict_put_obj(opts, "host", QOBJECT(qstring_from_str(host)));

        qdict_put_obj(opts, "port", QOBJECT(qstring_from_str(port)));

    } else {

        qdict_put_obj(opts, "host", QOBJECT(qstring_from_str(host)));

    }

    if (export) {

        qdict_put_obj(opts, "export", QOBJECT(qstring_from_str(export)));

    }



    bs->full_open_options = opts;

}

static void FUNC_0(BlockDriverState *VAR_0)

{

    QDict *opts = qdict_new();

    const char *VAR_1   = qdict_get_try_str(VAR_0->options, "VAR_1");

    const char *VAR_2   = qdict_get_try_str(VAR_0->options, "VAR_2");

    const char *VAR_3   = qdict_get_try_str(VAR_0->options, "VAR_3");

    const char *VAR_4 = qdict_get_try_str(VAR_0->options, "VAR_4");



    qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("nbd")));



    if (VAR_1 && VAR_4) {

        snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),

                 "nbd+unix:

    } else if (VAR_1 && !VAR_4) {

        snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),

                 "nbd+unix:

    } else if (!VAR_1 && VAR_4 && VAR_3) {

        snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),

                 "nbd:

    } else if (!VAR_1 && VAR_4 && !VAR_3) {

        snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),

                 "nbd:

    } else if (!VAR_1 && !VAR_4 && VAR_3) {

        snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),

                 "nbd:

    } else if (!VAR_1 && !VAR_4 && !VAR_3) {

        snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),

                 "nbd:

    }



    if (VAR_1) {

        qdict_put_obj(opts, "VAR_1", QOBJECT(qstring_from_str(VAR_1)));

    } else if (VAR_3) {

        qdict_put_obj(opts, "VAR_2", QOBJECT(qstring_from_str(VAR_2)));

        qdict_put_obj(opts, "VAR_3", QOBJECT(qstring_from_str(VAR_3)));

    } else {

        qdict_put_obj(opts, "VAR_2", QOBJECT(qstring_from_str(VAR_2)));

    }

    if (VAR_4) {

        qdict_put_obj(opts, "VAR_4", QOBJECT(qstring_from_str(VAR_4)));

    }



    VAR_0->full_open_options = opts;

}

static void FUNC_0(BlockDriverState *VAR_0)
{ QDict *opts = qdict_new(); const char *VAR_1   = qdict_get_try_str(VAR_0->options, "VAR_1"); const char *VAR_2   = qdict_get_try_str(VAR_0->options, "VAR_2"); const char *VAR_3   = qdict_get_try_str(VAR_0->options, "VAR_3"); const char *VAR_4 = qdict_get_try_str(VAR_0->options, "VAR_4"); qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("nbd"))); if (VAR_1 && VAR_4) { snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),
"nbd+unix:
} else if (VAR_1 && !VAR_4) { snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),
"nbd+unix:
} else if (!VAR_1 && VAR_4 && VAR_3) { snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),
"nbd:
} else if (!VAR_1 && VAR_4 && !VAR_3) { snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),
"nbd:
} else if (!VAR_1 && !VAR_4 && VAR_3) { snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),
"nbd:
} else if (!VAR_1 && !VAR_4 && !VAR_3) { snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),
"nbd:
} if (VAR_1) { qdict_put_obj(opts, "VAR_1", QOBJECT(qstring_from_str(VAR_1))); } else if (VAR_3) { qdict_put_obj(opts, "VAR_2", QOBJECT(qstring_from_str(VAR_2))); qdict_put_obj(opts, "VAR_3", QOBJECT(qstring_from_str(VAR_3))); } else { qdict_put_obj(opts, "VAR_2", QOBJECT(qstring_from_str(VAR_2))); } if (VAR_4) { qdict_put_obj(opts, "VAR_4", QOBJECT(qstring_from_str(VAR_4))); } VAR_0->full_open_options = opts; }