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

Re: [Xen-devel] [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM

On 08/01/14 02:57, Jan Beulich wrote:
On 31.07.14 at 02:59, <dslutz@xxxxxxxxxxx> 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));
               case OPT_CUSTOM:
+                if ( !bool_assert )
+                {
+                    if ( *optval )
+                        break;
+                    safe_strcpy(opt, "no");
+                    optval = opt;
+                }
                   ((void (*)(const char *))param->var)(optval);

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-"


Looks good to me.
    -Don Slutz

Xen-devel mailing list



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