| 
    
 [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 14:45, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> On 03/12/13 12:54, Jan Beulich wrote:
>> 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.
> 
> Hmm yes - perhaps that would be better, and more in line with the
> current options such as dom0_mem
> 
> So something like this?
That didn't take into account all issues I had named.
static void __init parse_pqos_param(char *s)
{
    char *ss, *val_str;
    int val;
    do {
        ss = strchr(s, ',');
        if ( ss )
            *ss = '\0';
        val = parse_bool(s);
        if ( val >= 0 )
            opt_pqos = val;
        else
        {
            val = !!strncmp(s, "no-", 3);
            if ( !val )
                s += 3;
            val_str = strchr(s, ':');
            if ( val_str )
                *val_str++ = '\0';
            if ( !val_str && !strcmp(s, "cqm") )
                opt_cqm = val;
            else if ( val_str && !strcmp(s, "cqm_max_rmid") )
                opt_cqm_max_rmid = simple_strtoul(val_str, NULL, 0);
        }
        s = ss + 1;
    } while ( ss );
}
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |