On Wed, Mar 11, 2015 at 12:59:40PM +0100, Kevin Wolf wrote:
> 
> def_value_str exists in the current codebase, and it seems to take
> precedence when a different default is specified by the caller.

So I've now added .def_value_str fields:

static QemuOptsList qemu_foo_opts = {
    .name = "foo",
    .head = QTAILQ_HEAD_INITIALIZER(qemu_foo_opts.head),
    .desc = {
        {
            .name = "name",
            .type = QEMU_OPT_STRING,
            .def_value_str = "abc",
        }, {
            .name = "file",
            .type = QEMU_OPT_STRING,
            .def_value_str = "xyz",
        },
        { /* end of list */ }
    },
};

but "-foo name,file" still results in qemu_opt_get(opts, "name")
returning "on", rather than "abc". Is that a bug, or am I missing
something, or doing something wrong ?

Thanks,
--Gabriel

Reply via email to