qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/7] vl: New qemu_get_machine_opts()


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 3/7] vl: New qemu_get_machine_opts()
Date: Thu, 04 Jul 2013 17:03:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Peter Maydell <address@hidden> writes:

> On 4 July 2013 14:09, Markus Armbruster <address@hidden> wrote:
>>
>> +/**
>> + * Get machine options
>> + *
>> + * Returns: machine options (never null).
>> + */
>> +QemuOpts *qemu_get_machine_opts(void)
>> +{
>> +    QemuOptsList *list;
>> +    QemuOpts *opts;
>> +
>> +    list = qemu_find_opts("machine");
>> +    assert(list);
>> +    opts = qemu_opts_find(list, NULL);
>> +    if (!opts) {
>> +        opts = qemu_opts_create_nofail(list);
>> +    }
>> +    return opts;
>> +}
>
> This looks a bit odd -- why are we creating new
> options in a function that claims to only be querying
> them?

So we never return null.  If it bothers you, I can initialize the
options to empty somewhere else, and assert they exist here.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]