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

Re: [Xen-devel] [PATCH v4 1/7] x86: detect and initialize Cache QoS Monitoring feature



>>> On 03.12.13 at 12:46, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> This currently won't do what you expect, and to get regular Xen boolean
> behaviour, you need tobe a little more cunning.
> 
> Here is some completely untested code...
> 
> static void __init parse_pqos_param(char *s)
> {
>     char *ss;
>     char *val_str;
>     int val;
> 
>     do {
>         val = !!strncmp(s, "no-", 3);
>         if ( !val )
>             s += 3;
> 
>         ss = strchr(s, ',');
>         if ( ss )
>             *ss = '\0';
> 
>         val_str = strchr(s, '=');
> 
>         if ( !parse_bool(s) )
>             opt_pqos = 0;

This won't either - parse_bool() returns the boolean value, or
negative if the input didn't match any of the boolean tokens.

Also, while I realize that you likely took this from elsewhere, I
think we should stop further propagation of bad things (like
allowing "pqos=no-true" or "pqos=no-cqm=on").

And using = for both the top level separator and the sub-option
ones looks odd to me generally too. I'd suggest using : instead.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.