30.03.2011 18:26, Gleb Natapov wrote:
> On Tue, Mar 29, 2011 at 10:41:11PM +0400, Michael Tokarev wrote:
>> [Cc'ing Gleb since he - it seems - wrote the original code]

Thank you for looking into this.

>> 17.03.2011 13:00, Michael Tokarev wrote:
>>> This patch almost rewrites acpi_table_add() function
>>> (but still leaves it using old get_param_value() interface).
>>> The result is that it's now possible to specify whole table
>>> (together with a header) in an external file, instead of just
>>> data portion, with a new file= parameter, but at the same time
>>> it's still possible to specify header fields as before.
>>>
[]
>>> +    if (get_param_value(buf, sizeof(buf), "data", t)) {
>>> +        has_header = false;
>>> +    } else if (get_param_value(buf, sizeof(buf), "file", t)) {
>>> +        has_header = true;
>>> +    } else {
>>> +        has_header = false;
>>> +        buf[0] = '\0';
>>> +    }
> Shouldn't we print some kind of error if user specify data and file
> param? Otherwise looks good to me.

This whole thing needs to be replaced with proper option
parsing.  Currently, it completely ignores any unknown
(such as mistyped) parameters among other things, or you
can specify the same parameter twice without it noticing.
So it needs more work when we'll decide which route to
take with option parsing.

I can rewrite it using QemuOpts, but I didn't want to
because it appears their lifetime is very limited too.

And sure, I can check for conflicting data= and file=,
I just thought it's not really necessary having in mind
all the above :)

/mjt

Reply via email to