/* Create QemuOpts from a QDict. Use value of key "id" as ID if it exists and is a QString. Only QStrings, QInts, QFloats and QBools are copied. Entries with other types are silently ignored.  */
QemuOpts* qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict, Error **errp)
/* Create QemuOpts from a QDict. Use value of key "id" as ID if it exists and is a QString. Only QStrings, QInts, QFloats and QBools are copied. Entries with other types are silently ignored.  */
QemuOpts* qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict, Error **errp)
{
    OptsFromQDictState state;
    Error *local_err = NULL;
    QemuOpts *opts;
    opts = qemu_opts_create(list, qdict_get_try_str(qdict, "id"), 1,
                            &local_err);
    if (local_err) {
        error_propagate(errp, local_err);
        return NULL;
    }
    assert(opts != NULL);
    state.errp = &local_err;
    state.opts = opts;
    qdict_iter(qdict, qemu_opts_from_qdict_1, &state);
    if (local_err) {
        error_propagate(errp, local_err);
        qemu_opts_del(opts);
        return NULL;
    }
    return opts;
}