static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)

{

    BDRVBlkdebugState *s = bs->opaque;

    QDict *opts;

    const QDictEntry *e;

    bool force_json = false;



    for (e = qdict_first(options); e; e = qdict_next(options, e)) {

        if (strcmp(qdict_entry_key(e), "config") &&

            strcmp(qdict_entry_key(e), "x-image"))

        {

            force_json = true;

            break;

        }

    }



    if (force_json && !bs->file->bs->full_open_options) {

        /* The config file cannot be recreated, so creating a plain filename

         * is impossible */

        return;

    }



    if (!force_json && bs->file->bs->exact_filename[0]) {

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

                 "blkdebug:%s:%s", s->config_file ?: "",

                 bs->file->bs->exact_filename);

    }



    opts = qdict_new();

    qdict_put_str(opts, "driver", "blkdebug");



    QINCREF(bs->file->bs->full_open_options);

    qdict_put(opts, "image", bs->file->bs->full_open_options);



    for (e = qdict_first(options); e; e = qdict_next(options, e)) {

        if (strcmp(qdict_entry_key(e), "x-image")) {

            qobject_incref(qdict_entry_value(e));

            qdict_put_obj(opts, qdict_entry_key(e), qdict_entry_value(e));

        }

    }



    bs->full_open_options = opts;

}

static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)

{

    BDRVBlkdebugState *s = bs->opaque;

    QDict *opts;

    const QDictEntry *e;

    bool force_json = false;



    for (e = qdict_first(options); e; e = qdict_next(options, e)) {

        if (strcmp(qdict_entry_key(e), "config") &&

            strcmp(qdict_entry_key(e), "x-image"))

        {

            force_json = true;

            break;

        }

    }



    if (force_json && !bs->file->bs->full_open_options) {

        



        return;

    }



    if (!force_json && bs->file->bs->exact_filename[0]) {

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

                 "blkdebug:%s:%s", s->config_file ?: "",

                 bs->file->bs->exact_filename);

    }



    opts = qdict_new();

    qdict_put_str(opts, "driver", "blkdebug");



    QINCREF(bs->file->bs->full_open_options);

    qdict_put(opts, "image", bs->file->bs->full_open_options);



    for (e = qdict_first(options); e; e = qdict_next(options, e)) {

        if (strcmp(qdict_entry_key(e), "x-image")) {

            qobject_incref(qdict_entry_value(e));

            qdict_put_obj(opts, qdict_entry_key(e), qdict_entry_value(e));

        }

    }



    bs->full_open_options = opts;

}

        snprintf(bs->exact_filename, sizeof(bs->exact_filename),                  "blkdebug:%s:%s", s->config_file ?: "",                  bs->file->bs->exact_filename);
static void FUNC_0(BlockDriverState *VAR_0, QDict *VAR_1)

{

    BDRVBlkdebugState *s = VAR_0->opaque;

    QDict *opts;

    const QDictEntry *VAR_2;

    bool force_json = false;



    for (VAR_2 = qdict_first(VAR_1); VAR_2; VAR_2 = qdict_next(VAR_1, VAR_2)) {

        if (strcmp(qdict_entry_key(VAR_2), "config") &&

            strcmp(qdict_entry_key(VAR_2), "x-image"))

        {

            force_json = true;

            break;

        }

    }



    if (force_json && !VAR_0->file->VAR_0->full_open_options) {

        



        return;

    }



    if (!force_json && VAR_0->file->VAR_0->exact_filename[0]) {

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

                 "blkdebug:%s:%s", s->config_file ?: "",

                 VAR_0->file->VAR_0->exact_filename);

    }



    opts = qdict_new();

    qdict_put_str(opts, "driver", "blkdebug");



    QINCREF(VAR_0->file->VAR_0->full_open_options);

    qdict_put(opts, "image", VAR_0->file->VAR_0->full_open_options);



    for (VAR_2 = qdict_first(VAR_1); VAR_2; VAR_2 = qdict_next(VAR_1, VAR_2)) {

        if (strcmp(qdict_entry_key(VAR_2), "x-image")) {

            qobject_incref(qdict_entry_value(VAR_2));

            qdict_put_obj(opts, qdict_entry_key(VAR_2), qdict_entry_value(VAR_2));

        }

    }



    VAR_0->full_open_options = opts;

}

static void FUNC_0(BlockDriverState *VAR_0, QDict *VAR_1)
{ BDRVBlkdebugState *s = VAR_0->opaque; QDict *opts; const QDictEntry *VAR_2; bool force_json = false; for (VAR_2 = qdict_first(VAR_1); VAR_2; VAR_2 = qdict_next(VAR_1, VAR_2)) { if (strcmp(qdict_entry_key(VAR_2), "config") &&
strcmp(qdict_entry_key(VAR_2), "x-image"))
{ force_json = true; break; } } if (force_json && !VAR_0->file->VAR_0->full_open_options) { return; } if (!force_json && VAR_0->file->VAR_0->exact_filename[0]) { snprintf(VAR_0->exact_filename, sizeof(VAR_0->exact_filename),
"blkdebug:%s:%s", s->config_file ?: "",
VAR_0->file->VAR_0->exact_filename); } opts = qdict_new(); qdict_put_str(opts, "driver", "blkdebug"); QINCREF(VAR_0->file->VAR_0->full_open_options); qdict_put(opts, "image", VAR_0->file->VAR_0->full_open_options); for (VAR_2 = qdict_first(VAR_1); VAR_2; VAR_2 = qdict_next(VAR_1, VAR_2)) { if (strcmp(qdict_entry_key(VAR_2), "x-image")) { qobject_incref(qdict_entry_value(VAR_2)); qdict_put_obj(opts, qdict_entry_key(VAR_2), qdict_entry_value(VAR_2)); } } VAR_0->full_open_options = opts; }