qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] v3 revamp acpitable parsing and allow to specif


From: Michael Tokarev
Subject: Re: [Qemu-devel] [PATCH] v3 revamp acpitable parsing and allow to specify complete (headerful) table
Date: Wed, 30 Mar 2011 22:27:51 +0400
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11

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

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