* [PATCH v2 0/2] parse_bool fixes
@ 2014-07-29 19:57 Don Slutz
2014-07-29 19:57 ` [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM Don Slutz
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Don Slutz @ 2014-07-29 19:57 UTC (permalink / raw)
To: xen-devel
Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Ian Jackson, Don Slutz,
Tim Deegan, Jan Beulich
Changes v1 to v2:
Jan Beulich, Keir Fraser, Andrew Cooper:
v1 #1 "cmdline_parse: Also pass bool_assert to OPT_CUSTOM..."
NAK (several ways of saying this) so drop this pacth.
As suggested by Jan Beulich:
v2 #1 "cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM"
V2 #2 "xen/console: Better handing of console_timestamps as a boolean_param"
Drop stacked inversions part of patch.
---
console_timestamps use to be a boolean_param. Now it is more. This
patch series is to make old xen command lines with
console_timestamps in them continue to work the way they did at 4.4.
Don Slutz (2):
cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM
xen/console: Better handing of console_timestamps as a boolean_param
xen/common/kernel.c | 15 ++++++++++++++-
xen/drivers/char/console.c | 26 ++++++++++++++++++--------
2 files changed, 32 insertions(+), 9 deletions(-)
--
1.8.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM
2014-07-29 19:57 [PATCH v2 0/2] parse_bool fixes Don Slutz
@ 2014-07-29 19:57 ` Don Slutz
2014-07-30 7:58 ` Jan Beulich
2014-07-29 19:57 ` [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param Don Slutz
2014-07-29 20:10 ` [PATCH v2 0/2] parse_bool fixes Andrew Cooper
2 siblings, 1 reply; 14+ messages in thread
From: Don Slutz @ 2014-07-29 19:57 UTC (permalink / raw)
To: xen-devel
Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Ian Jackson, Don Slutz,
Tim Deegan, Jan Beulich
This allows converting OPT_BOOL into OPT_CUSTOM and still do what is
expected.
Note: if both no- and = provided, pass provided = if not a zero
length string. Also log a warning about this.
Signed-off-by: Don Slutz <dslutz@verizon.com>
---
xen/common/kernel.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 7e83353..9857159 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -135,7 +135,20 @@ void __init cmdline_parse(const char *cmdline)
parse_size_and_unit(optval, NULL));
break;
case OPT_CUSTOM:
- ((void (*)(const char *))param->var)(optval);
+ if ( !bool_assert )
+ {
+ if ( *optval )
+ {
+ printk(XENLOG_WARNING
+ "Warning: ignored no- prefix for %s=%s\n",
+ param->name, optval);
+ ((void (*)(const char *))param->var)(optval);
+ }
+ else
+ ((void (*)(const char *))param->var)("no");
+ }
+ else
+ ((void (*)(const char *))param->var)(optval);
break;
default:
BUG();
--
1.8.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param
2014-07-29 19:57 [PATCH v2 0/2] parse_bool fixes Don Slutz
2014-07-29 19:57 ` [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM Don Slutz
@ 2014-07-29 19:57 ` Don Slutz
2014-07-30 8:01 ` Jan Beulich
2014-07-29 20:10 ` [PATCH v2 0/2] parse_bool fixes Andrew Cooper
2 siblings, 1 reply; 14+ messages in thread
From: Don Slutz @ 2014-07-29 19:57 UTC (permalink / raw)
To: xen-devel
Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Ian Jackson, Don Slutz,
Tim Deegan, Jan Beulich
In order to handle all the old ways, change to use parse_bool().
Signed-off-by: Don Slutz <dslutz@verizon.com>
---
v2:
Drop stacked inversions part of patch.
xen/drivers/char/console.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 2f6c090..4f473e3 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -559,15 +559,25 @@ static int printk_prefix_check(char *p, char **pp)
static void __init parse_console_timestamps(char *s)
{
- if ( *s == '\0' || /* Compat for old booleanparam() */
- !strcmp(s, "date") )
- opt_con_timestamp_mode = TSM_DATE;
- else if ( !strcmp(s, "datems") )
- opt_con_timestamp_mode = TSM_DATE_MS;
- else if ( !strcmp(s, "boot") )
- opt_con_timestamp_mode = TSM_BOOT;
- else if ( !strcmp(s, "none") )
+ switch ( parse_bool(s) )
+ {
+ case 0:
opt_con_timestamp_mode = TSM_NONE;
+ break;
+ case 1:
+ opt_con_timestamp_mode = TSM_DATE;
+ break;
+ default:
+ if ( *s == '\0' || /* Compat for old booleanparam() */
+ !strcmp(s, "date") )
+ opt_con_timestamp_mode = TSM_DATE;
+ else if ( !strcmp(s, "datems") )
+ opt_con_timestamp_mode = TSM_DATE_MS;
+ else if ( !strcmp(s, "boot") )
+ opt_con_timestamp_mode = TSM_BOOT;
+ else if ( !strcmp(s, "none") )
+ opt_con_timestamp_mode = TSM_NONE;
+ }
}
static void printk_start_of_line(const char *prefix)
--
1.8.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v2 0/2] parse_bool fixes
2014-07-29 19:57 [PATCH v2 0/2] parse_bool fixes Don Slutz
2014-07-29 19:57 ` [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM Don Slutz
2014-07-29 19:57 ` [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param Don Slutz
@ 2014-07-29 20:10 ` Andrew Cooper
2 siblings, 0 replies; 14+ messages in thread
From: Andrew Cooper @ 2014-07-29 20:10 UTC (permalink / raw)
To: Don Slutz, xen-devel
Cc: Keir Fraser, Ian Jackson, Ian Campbell, Jan Beulich, Tim Deegan
On 29/07/2014 20:57, Don Slutz wrote:
> Changes v1 to v2:
Much better!
Both Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Jan Beulich, Keir Fraser, Andrew Cooper:
> v1 #1 "cmdline_parse: Also pass bool_assert to OPT_CUSTOM..."
> NAK (several ways of saying this) so drop this pacth.
>
> As suggested by Jan Beulich:
> v2 #1 "cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM"
>
>
> V2 #2 "xen/console: Better handing of console_timestamps as a boolean_param"
> Drop stacked inversions part of patch.
>
> ---
>
> console_timestamps use to be a boolean_param. Now it is more. This
> patch series is to make old xen command lines with
> console_timestamps in them continue to work the way they did at 4.4.
>
>
> Don Slutz (2):
> cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM
> xen/console: Better handing of console_timestamps as a boolean_param
>
> xen/common/kernel.c | 15 ++++++++++++++-
> xen/drivers/char/console.c | 26 ++++++++++++++++++--------
> 2 files changed, 32 insertions(+), 9 deletions(-)
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM
2014-07-29 19:57 ` [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM Don Slutz
@ 2014-07-30 7:58 ` Jan Beulich
2014-07-31 0:59 ` Don Slutz
2014-08-04 10:58 ` Ian Campbell
0 siblings, 2 replies; 14+ messages in thread
From: Jan Beulich @ 2014-07-30 7:58 UTC (permalink / raw)
To: Don Slutz
Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Tim Deegan, xen-devel,
Ian Jackson
[-- Attachment #1: Type: text/plain, Size: 2840 bytes --]
>>> On 29.07.14 at 21:57, <dslutz@verizon.com> wrote:
> This allows converting OPT_BOOL into OPT_CUSTOM and still do what is
> expected.
>
> Note: if both no- and = provided, pass provided = if not a zero
> length string. Also log a warning about this.
>
> Signed-off-by: Don Slutz <dslutz@verizon.com>
> ---
> xen/common/kernel.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/xen/common/kernel.c b/xen/common/kernel.c
> index 7e83353..9857159 100644
> --- a/xen/common/kernel.c
> +++ b/xen/common/kernel.c
> @@ -135,7 +135,20 @@ void __init cmdline_parse(const char *cmdline)
> parse_size_and_unit(optval, NULL));
> break;
> case OPT_CUSTOM:
> - ((void (*)(const char *))param->var)(optval);
> + if ( !bool_assert )
> + {
> + if ( *optval )
> + {
> + printk(XENLOG_WARNING
> + "Warning: ignored no- prefix for %s=%s\n",
> + param->name, optval);
Log messages printed before the consoles get initialized are of limited
value (they would only show up in "xl dmesg" or equivalent output).
Therefore I'm not really certain this is worthwhile.
> + ((void (*)(const char *))param->var)(optval);
> + }
> + else
> + ((void (*)(const char *))param->var)("no");
> + }
> + else
> + ((void (*)(const char *))param->var)(optval);
Considering this repeated cast I'd prefer coding this quite
differently, not the least because you also can't pass a literal
"no" to the parsing functions (as they're permitted to alter the
string), and at once also ignoring bogus "no-<name>=<value>"
options instead of trying to assign a (perhaps unexpected)
meaning:
convert "no-" command line option prefix into "=no" for OPT_CUSTOM
... to allow restoring/retaining previous behavior for options getting
converted from boolean to custom.
Reported-by: Don Slutz <dslutz@verizon.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -135,6 +135,13 @@ void __init cmdline_parse(const char *cm
parse_size_and_unit(optval, NULL));
break;
case OPT_CUSTOM:
+ if ( !bool_assert )
+ {
+ if ( *optval )
+ break;
+ safe_strcpy(opt, "no");
+ optval = opt;
+ }
((void (*)(const char *))param->var)(optval);
break;
default:
[-- Attachment #2: cmdline-with-no-prefix.patch --]
[-- Type: text/plain, Size: 847 bytes --]
convert "no-" command line option prefix into "=no" for OPT_CUSTOM
... to allow restoring/retaining previous behavior for options getting
converted from boolean to custom.
Reported-by: Don Slutz <dslutz@verizon.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -135,6 +135,13 @@ void __init cmdline_parse(const char *cm
parse_size_and_unit(optval, NULL));
break;
case OPT_CUSTOM:
+ if ( !bool_assert )
+ {
+ if ( *optval )
+ break;
+ safe_strcpy(opt, "no");
+ optval = opt;
+ }
((void (*)(const char *))param->var)(optval);
break;
default:
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param
2014-07-29 19:57 ` [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param Don Slutz
@ 2014-07-30 8:01 ` Jan Beulich
2014-07-30 8:06 ` Jan Beulich
0 siblings, 1 reply; 14+ messages in thread
From: Jan Beulich @ 2014-07-30 8:01 UTC (permalink / raw)
To: Don Slutz
Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Tim Deegan, xen-devel,
Ian Jackson
>>> On 29.07.14 at 21:57, <dslutz@verizon.com> wrote:
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -559,15 +559,25 @@ static int printk_prefix_check(char *p, char **pp)
>
> static void __init parse_console_timestamps(char *s)
> {
> - if ( *s == '\0' || /* Compat for old booleanparam() */
> - !strcmp(s, "date") )
> - opt_con_timestamp_mode = TSM_DATE;
> - else if ( !strcmp(s, "datems") )
> - opt_con_timestamp_mode = TSM_DATE_MS;
> - else if ( !strcmp(s, "boot") )
> - opt_con_timestamp_mode = TSM_BOOT;
> - else if ( !strcmp(s, "none") )
> + switch ( parse_bool(s) )
> + {
> + case 0:
> opt_con_timestamp_mode = TSM_NONE;
> + break;
> + case 1:
> + opt_con_timestamp_mode = TSM_DATE;
> + break;
The patch could have been quite a bit smaller if you used "return"
instead of "break" in the two above cases.
Jan
> + default:
> + if ( *s == '\0' || /* Compat for old booleanparam() */
> + !strcmp(s, "date") )
> + opt_con_timestamp_mode = TSM_DATE;
> + else if ( !strcmp(s, "datems") )
> + opt_con_timestamp_mode = TSM_DATE_MS;
> + else if ( !strcmp(s, "boot") )
> + opt_con_timestamp_mode = TSM_BOOT;
> + else if ( !strcmp(s, "none") )
> + opt_con_timestamp_mode = TSM_NONE;
> + }
> }
>
> static void printk_start_of_line(const char *prefix)
> --
> 1.8.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param
2014-07-30 8:01 ` Jan Beulich
@ 2014-07-30 8:06 ` Jan Beulich
2014-07-31 0:36 ` Don Slutz
2014-08-04 11:00 ` Ian Campbell
0 siblings, 2 replies; 14+ messages in thread
From: Jan Beulich @ 2014-07-30 8:06 UTC (permalink / raw)
To: Jan Beulich, Don Slutz
Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Tim Deegan, xen-devel,
Ian Jackson
[-- Attachment #1: Type: text/plain, Size: 1910 bytes --]
>>> On 30.07.14 at 10:01, <JBeulich@suse.com> wrote:
>>>> On 29.07.14 at 21:57, <dslutz@verizon.com> wrote:
>> --- a/xen/drivers/char/console.c
>> +++ b/xen/drivers/char/console.c
>> @@ -559,15 +559,25 @@ static int printk_prefix_check(char *p, char **pp)
>>
>> static void __init parse_console_timestamps(char *s)
>> {
>> - if ( *s == '\0' || /* Compat for old booleanparam() */
>> - !strcmp(s, "date") )
>> - opt_con_timestamp_mode = TSM_DATE;
>> - else if ( !strcmp(s, "datems") )
>> - opt_con_timestamp_mode = TSM_DATE_MS;
>> - else if ( !strcmp(s, "boot") )
>> - opt_con_timestamp_mode = TSM_BOOT;
>> - else if ( !strcmp(s, "none") )
>> + switch ( parse_bool(s) )
>> + {
>> + case 0:
>> opt_con_timestamp_mode = TSM_NONE;
>> + break;
>> + case 1:
>> + opt_con_timestamp_mode = TSM_DATE;
>> + break;
>
> The patch could have been quite a bit smaller if you used "return"
> instead of "break" in the two above cases.
I.e.
console: better handing of console_timestamps as a boolean_param
In order to handle all the old ways, change to use parse_bool().
Signed-off-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Restructure code to limit churn.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -559,6 +559,15 @@ static int printk_prefix_check(char *p,
static void __init parse_console_timestamps(char *s)
{
+ switch ( parse_bool(s) )
+ {
+ case 0:
+ opt_con_timestamp_mode = TSM_NONE;
+ return;
+ case 1:
+ opt_con_timestamp_mode = TSM_DATE;
+ return;
+ }
if ( *s == '\0' || /* Compat for old booleanparam() */
!strcmp(s, "date") )
opt_con_timestamp_mode = TSM_DATE;
[-- Attachment #2: console_timestamps-boolean.patch --]
[-- Type: text/plain, Size: 859 bytes --]
console: better handing of console_timestamps as a boolean_param
In order to handle all the old ways, change to use parse_bool().
Signed-off-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Restructure code to limit churn.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -559,6 +559,15 @@ static int printk_prefix_check(char *p,
static void __init parse_console_timestamps(char *s)
{
+ switch ( parse_bool(s) )
+ {
+ case 0:
+ opt_con_timestamp_mode = TSM_NONE;
+ return;
+ case 1:
+ opt_con_timestamp_mode = TSM_DATE;
+ return;
+ }
if ( *s == '\0' || /* Compat for old booleanparam() */
!strcmp(s, "date") )
opt_con_timestamp_mode = TSM_DATE;
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param
2014-07-30 8:06 ` Jan Beulich
@ 2014-07-31 0:36 ` Don Slutz
2014-08-04 11:00 ` Ian Campbell
1 sibling, 0 replies; 14+ messages in thread
From: Don Slutz @ 2014-07-31 0:36 UTC (permalink / raw)
To: Jan Beulich, Don Slutz
Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Tim Deegan, xen-devel,
Ian Jackson
On 07/30/14 04:06, Jan Beulich wrote:
>>>> On 30.07.14 at 10:01, <JBeulich@suse.com> wrote:
>>>>> On 29.07.14 at 21:57, <dslutz@verizon.com> wrote:
>>> --- a/xen/drivers/char/console.c
>>> +++ b/xen/drivers/char/console.c
>> The patch could have been quite a bit smaller if you used "return"
>> instead of "break" in the two above cases.
> I.e.
>
> console: better handing of console_timestamps as a boolean_param
>
> In order to handle all the old ways, change to use parse_bool().
>
> Signed-off-by: Don Slutz <dslutz@verizon.com>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Restructure code to limit churn.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
This is fine with me.
-Don Slutz
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -559,6 +559,15 @@ static int printk_prefix_check(char *p,
>
> static void __init parse_console_timestamps(char *s)
> {
> + switch ( parse_bool(s) )
> + {
> + case 0:
> + opt_con_timestamp_mode = TSM_NONE;
> + return;
> + case 1:
> + opt_con_timestamp_mode = TSM_DATE;
> + return;
> + }
> if ( *s == '\0' || /* Compat for old booleanparam() */
> !strcmp(s, "date") )
> opt_con_timestamp_mode = TSM_DATE;
>
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM
2014-07-30 7:58 ` Jan Beulich
@ 2014-07-31 0:59 ` Don Slutz
2014-08-01 6:57 ` Jan Beulich
2014-08-04 10:58 ` Ian Campbell
1 sibling, 1 reply; 14+ messages in thread
From: Don Slutz @ 2014-07-31 0:59 UTC (permalink / raw)
To: Jan Beulich, Don Slutz
Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Tim Deegan, xen-devel,
Ian Jackson
On 07/30/14 03:58, Jan Beulich wrote:
>>>> On 29.07.14 at 21:57, <dslutz@verizon.com> wrote:
>> This allows converting OPT_BOOL into OPT_CUSTOM and still do what is
>> expected.
>>
>> Note: if both no- and = provided, pass provided = if not a zero
>> length string. Also log a warning about this.
>>
>> Signed-off-by: Don Slutz <dslutz@verizon.com>
>> ---
>> xen/common/kernel.c | 15 ++++++++++++++-
>> 1 file changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/common/kernel.c b/xen/common/kernel.c
>> index 7e83353..9857159 100644
>> --- a/xen/common/kernel.c
>> +++ b/xen/common/kernel.c
>> @@ -135,7 +135,20 @@ void __init cmdline_parse(const char *cmdline)
>> parse_size_and_unit(optval, NULL));
>> break;
>> case OPT_CUSTOM:
>> - ((void (*)(const char *))param->var)(optval);
>> + if ( !bool_assert )
>> + {
>> + if ( *optval )
>> + {
>> + printk(XENLOG_WARNING
>> + "Warning: ignored no- prefix for %s=%s\n",
>> + param->name, optval);
> Log messages printed before the consoles get initialized are of limited
> value (they would only show up in "xl dmesg" or equivalent output).
> Therefore I'm not really certain this is worthwhile.
I am happy to go either way.
>> + ((void (*)(const char *))param->var)(optval);
>> + }
>> + else
>> + ((void (*)(const char *))param->var)("no");
>> + }
>> + else
>> + ((void (*)(const char *))param->var)(optval);
> Considering this repeated cast I'd prefer coding this quite
> differently, not the least because you also can't pass a literal
> "no" to the parsing functions (as they're permitted to alter the
> string), and at once also ignoring bogus "no-<name>=<value>"
> options instead of trying to assign a (perhaps unexpected)
> meaning:
>
> convert "no-" command line option prefix into "=no" for OPT_CUSTOM
>
> ... to allow restoring/retaining previous behavior for options getting
> converted from boolean to custom.
>
> Reported-by: Don Slutz <dslutz@verizon.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/common/kernel.c
> +++ b/xen/common/kernel.c
> @@ -135,6 +135,13 @@ void __init cmdline_parse(const char *cm
> parse_size_and_unit(optval, NULL));
> break;
> case OPT_CUSTOM:
> + if ( !bool_assert )
> + {
> + if ( *optval )
> + break;
> + safe_strcpy(opt, "no");
> + optval = opt;
> + }
> ((void (*)(const char *))param->var)(optval);
> break;
> default:
>
>
Without the log message, I think it might help to include the part about
ignoring bogus "no-<name>=<value>"... aka stacked inversions in the
commit message. This is because boolean options do still support stacked
inversions, which is valid under the statement "Explicitly specifying any
value other than those listed above is undefined, as is stacking a `no-`
prefix with an explicit value."
I am happy with the actual code change.
-Don Slutz
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM
2014-07-31 0:59 ` Don Slutz
@ 2014-08-01 6:57 ` Jan Beulich
2014-08-01 12:36 ` Don Slutz
0 siblings, 1 reply; 14+ messages in thread
From: Jan Beulich @ 2014-08-01 6:57 UTC (permalink / raw)
To: Don Slutz
Cc: Keir Fraser, Ian Campbell, Andrew Cooper, Tim Deegan, xen-devel,
Ian Jackson
>>> On 31.07.14 at 02:59, <dslutz@verizon.com> wrote:
> On 07/30/14 03:58, Jan Beulich wrote:
>> --- a/xen/common/kernel.c
>> +++ b/xen/common/kernel.c
>> @@ -135,6 +135,13 @@ void __init cmdline_parse(const char *cm
>> parse_size_and_unit(optval, NULL));
>> break;
>> case OPT_CUSTOM:
>> + if ( !bool_assert )
>> + {
>> + if ( *optval )
>> + break;
>> + safe_strcpy(opt, "no");
>> + optval = opt;
>> + }
>> ((void (*)(const char *))param->var)(optval);
>> break;
>> default:
>>
>>
>
> Without the log message, I think it might help to include the part about
> ignoring bogus "no-<name>=<value>"... aka stacked inversions in the
> commit message. This is because boolean options do still support stacked
> inversions, which is valid under the statement "Explicitly specifying any
> value other than those listed above is undefined, as is stacking a `no-`
> prefix with an explicit value."
I added:
Obviously that'll work only when no
other argument was specified for the option. Command line settings of
the form "no-<name>=<value>" will now be ignored as ambiguous (rather
than being interpreted as "<name>=<value>", i.e. ignoring the "no-"
prefix).
Jan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM
2014-08-01 6:57 ` Jan Beulich
@ 2014-08-01 12:36 ` Don Slutz
0 siblings, 0 replies; 14+ messages in thread
From: Don Slutz @ 2014-08-01 12:36 UTC (permalink / raw)
To: Jan Beulich
Cc: Tim Deegan, Keir Fraser, Ian Campbell, Andrew Cooper, Ian Jackson,
Don Slutz, xen-devel
On 08/01/14 02:57, Jan Beulich wrote:
>>>> On 31.07.14 at 02:59, <dslutz@verizon.com> wrote:
>> On 07/30/14 03:58, Jan Beulich wrote:
>>> --- a/xen/common/kernel.c
>>> +++ b/xen/common/kernel.c
>>> @@ -135,6 +135,13 @@ void __init cmdline_parse(const char *cm
>>> parse_size_and_unit(optval, NULL));
>>> break;
>>> case OPT_CUSTOM:
>>> + if ( !bool_assert )
>>> + {
>>> + if ( *optval )
>>> + break;
>>> + safe_strcpy(opt, "no");
>>> + optval = opt;
>>> + }
>>> ((void (*)(const char *))param->var)(optval);
>>> break;
>>> default:
>>>
>>>
>> Without the log message, I think it might help to include the part about
>> ignoring bogus "no-<name>=<value>"... aka stacked inversions in the
>> commit message. This is because boolean options do still support stacked
>> inversions, which is valid under the statement "Explicitly specifying any
>> value other than those listed above is undefined, as is stacking a `no-`
>> prefix with an explicit value."
> I added:
>
> Obviously that'll work only when no
> other argument was specified for the option. Command line settings of
> the form "no-<name>=<value>" will now be ignored as ambiguous (rather
> than being interpreted as "<name>=<value>", i.e. ignoring the "no-"
> prefix).
>
> Jan
>
Looks good to me.
-Don Slutz
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM
2014-07-30 7:58 ` Jan Beulich
2014-07-31 0:59 ` Don Slutz
@ 2014-08-04 10:58 ` Ian Campbell
2014-08-04 11:39 ` Jan Beulich
1 sibling, 1 reply; 14+ messages in thread
From: Ian Campbell @ 2014-08-04 10:58 UTC (permalink / raw)
To: Jan Beulich
Cc: Keir Fraser, Andrew Cooper, Tim Deegan, Don Slutz, xen-devel,
Ian Jackson
On Wed, 2014-07-30 at 08:58 +0100, Jan Beulich wrote:
> convert "no-" command line option prefix into "=no" for OPT_CUSTOM
>
> ... to allow restoring/retaining previous behavior for options getting
> converted from boolean to custom.
>
> Reported-by: Don Slutz <dslutz@verizon.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/common/kernel.c
> +++ b/xen/common/kernel.c
> @@ -135,6 +135,13 @@ void __init cmdline_parse(const char *cm
> parse_size_and_unit(optval, NULL));
> break;
> case OPT_CUSTOM:
> + if ( !bool_assert )
> + {
> + if ( *optval )
> + break;
I think this results in silently ignoring mad combinations, rather than
reporting them as an error. If that was what you intended then:
Acked-by: Ian Campbell <ian.campbell@citrix.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param
2014-07-30 8:06 ` Jan Beulich
2014-07-31 0:36 ` Don Slutz
@ 2014-08-04 11:00 ` Ian Campbell
1 sibling, 0 replies; 14+ messages in thread
From: Ian Campbell @ 2014-08-04 11:00 UTC (permalink / raw)
To: Jan Beulich
Cc: Keir Fraser, Andrew Cooper, Tim Deegan, Don Slutz, xen-devel,
Ian Jackson
On Wed, 2014-07-30 at 09:06 +0100, Jan Beulich wrote:
> console: better handing of console_timestamps as a boolean_param
>
> In order to handle all the old ways, change to use parse_bool().
>
> Signed-off-by: Don Slutz <dslutz@verizon.com>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Restructure code to limit churn.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Ian
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM
2014-08-04 10:58 ` Ian Campbell
@ 2014-08-04 11:39 ` Jan Beulich
0 siblings, 0 replies; 14+ messages in thread
From: Jan Beulich @ 2014-08-04 11:39 UTC (permalink / raw)
To: Ian Campbell
Cc: KeirFraser, Andrew Cooper, Tim Deegan, Don Slutz, xen-devel,
Ian Jackson
>>> On 04.08.14 at 12:58, <Ian.Campbell@citrix.com> wrote:
> On Wed, 2014-07-30 at 08:58 +0100, Jan Beulich wrote:
>> convert "no-" command line option prefix into "=no" for OPT_CUSTOM
>>
>> ... to allow restoring/retaining previous behavior for options getting
>> converted from boolean to custom.
>>
>> Reported-by: Don Slutz <dslutz@verizon.com>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/common/kernel.c
>> +++ b/xen/common/kernel.c
>> @@ -135,6 +135,13 @@ void __init cmdline_parse(const char *cm
>> parse_size_and_unit(optval, NULL));
>> break;
>> case OPT_CUSTOM:
>> + if ( !bool_assert )
>> + {
>> + if ( *optval )
>> + break;
>
> I think this results in silently ignoring mad combinations, rather than
> reporting them as an error. If that was what you intended then:
Yes, it was (mentioned in the thread that led here): The resulting
message is only of limited use, as it wouldn't possibly make it to
the (serial) console.
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Thanks, Jan
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2014-08-04 11:39 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-29 19:57 [PATCH v2 0/2] parse_bool fixes Don Slutz
2014-07-29 19:57 ` [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM Don Slutz
2014-07-30 7:58 ` Jan Beulich
2014-07-31 0:59 ` Don Slutz
2014-08-01 6:57 ` Jan Beulich
2014-08-01 12:36 ` Don Slutz
2014-08-04 10:58 ` Ian Campbell
2014-08-04 11:39 ` Jan Beulich
2014-07-29 19:57 ` [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param Don Slutz
2014-07-30 8:01 ` Jan Beulich
2014-07-30 8:06 ` Jan Beulich
2014-07-31 0:36 ` Don Slutz
2014-08-04 11:00 ` Ian Campbell
2014-07-29 20:10 ` [PATCH v2 0/2] parse_bool fixes Andrew Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).