convert "no-" command line option prefix into "=no" for OPT_CUSTOM
authorJan Beulich <jbeulich@suse.com>
Mon, 4 Aug 2014 11:44:36 +0000 (13:44 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 Aug 2014 11:44:36 +0000 (13:44 +0200)
... to allow restoring/retaining previous behavior for options getting
converted from boolean to custom. 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).

Reported-by: Don Slutz <dslutz@verizon.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/common/kernel.c

index 7e83353a6e030a7f428d2c9717a78db858970dda..d23c4229df13c3ac9c5fb44bf64d142d19162c71 100644 (file)
@@ -135,6 +135,13 @@ void __init cmdline_parse(const char *cmdline)
                     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: