void qemu_opts_print(QemuOpts *opts, const char *separator)

{

    QemuOpt *opt;

    QemuOptDesc *desc = opts->list->desc;

    const char *sep = "";



    if (opts->id) {

        printf("id=%s", opts->id); /* passed id_wellformed -> no commas */

        sep = separator;

    }



    if (desc[0].name == NULL) {

        QTAILQ_FOREACH(opt, &opts->head, next) {

            printf("%s%s=", sep, opt->name);

            escaped_print(opt->str);

            sep = separator;

        }

        return;

    }

    for (; desc && desc->name; desc++) {

        const char *value;

        QemuOpt *opt = qemu_opt_find(opts, desc->name);



        value = opt ? opt->str : desc->def_value_str;

        if (!value) {

            continue;

        }

        if (desc->type == QEMU_OPT_STRING) {

            printf("%s%s=", sep, desc->name);

            escaped_print(value);

        } else if ((desc->type == QEMU_OPT_SIZE ||

                    desc->type == QEMU_OPT_NUMBER) && opt) {

            printf("%s%s=%" PRId64, sep, desc->name, opt->value.uint);

        } else {

            printf("%s%s=%s", sep, desc->name, value);

        }

        sep = separator;

    }

}

void qemu_opts_print(QemuOpts *opts, const char *separator)

{

    QemuOpt *opt;

    QemuOptDesc *desc = opts->list->desc;

    const char *sep = "";



    if (opts->id) {

        printf("id=%s", opts->id); 

        sep = separator;

    }



    if (desc[0].name == NULL) {

        QTAILQ_FOREACH(opt, &opts->head, next) {

            printf("%s%s=", sep, opt->name);

            escaped_print(opt->str);

            sep = separator;

        }

        return;

    }

    for (; desc && desc->name; desc++) {

        const char *value;

        QemuOpt *opt = qemu_opt_find(opts, desc->name);



        value = opt ? opt->str : desc->def_value_str;

        if (!value) {

            continue;

        }

        if (desc->type == QEMU_OPT_STRING) {

            printf("%s%s=", sep, desc->name);

            escaped_print(value);

        } else if ((desc->type == QEMU_OPT_SIZE ||

                    desc->type == QEMU_OPT_NUMBER) && opt) {

            printf("%s%s=%" PRId64, sep, desc->name, opt->value.uint);

        } else {

            printf("%s%s=%s", sep, desc->name, value);

        }

        sep = separator;

    }

}

void FUNC_0(QemuOpts *VAR_0, const char *VAR_1)

{

    QemuOpt *opt;

    QemuOptDesc *desc = VAR_0->list->desc;

    const char *VAR_2 = "";



    if (VAR_0->id) {

        printf("id=%s", VAR_0->id); 

        VAR_2 = VAR_1;

    }



    if (desc[0].name == NULL) {

        QTAILQ_FOREACH(opt, &VAR_0->head, next) {

            printf("%s%s=", VAR_2, opt->name);

            escaped_print(opt->str);

            VAR_2 = VAR_1;

        }

        return;

    }

    for (; desc && desc->name; desc++) {

        const char *value;

        QemuOpt *opt = qemu_opt_find(VAR_0, desc->name);



        value = opt ? opt->str : desc->def_value_str;

        if (!value) {

            continue;

        }

        if (desc->type == QEMU_OPT_STRING) {

            printf("%s%s=", VAR_2, desc->name);

            escaped_print(value);

        } else if ((desc->type == QEMU_OPT_SIZE ||

                    desc->type == QEMU_OPT_NUMBER) && opt) {

            printf("%s%s=%" PRId64, VAR_2, desc->name, opt->value.uint);

        } else {

            printf("%s%s=%s", VAR_2, desc->name, value);

        }

        VAR_2 = VAR_1;

    }

}

void FUNC_0(QemuOpts *VAR_0, const char *VAR_1)
{ QemuOpt *opt; QemuOptDesc *desc = VAR_0->list->desc; const char *VAR_2 = ""; if (VAR_0->id) { printf("id=%s", VAR_0->id); VAR_2 = VAR_1; } if (desc[0].name == NULL) { QTAILQ_FOREACH(opt, &VAR_0->head, next) { printf("%s%s=", VAR_2, opt->name); escaped_print(opt->str); VAR_2 = VAR_1; } return; } for (; desc && desc->name; desc++) { const char *value; QemuOpt *opt = qemu_opt_find(VAR_0, desc->name); value = opt ? opt->str : desc->def_value_str; if (!value) { continue; } if (desc->type == QEMU_OPT_STRING) { printf("%s%s=", VAR_2, desc->name); escaped_print(value); } else if ((desc->type == QEMU_OPT_SIZE || desc->type == QEMU_OPT_NUMBER) && opt) { printf("%s%s=%" PRId64, VAR_2, desc->name, opt->value.uint); } else { printf("%s%s=%s", VAR_2, desc->name, value); } VAR_2 = VAR_1; } }