From: "Jan Beulich" Subject: Re: [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM Date: Fri, 01 Aug 2014 07:57:13 +0100 Message-ID: <53DB56690200007800028477@mail.emea.novell.com> References: <1406663869-31522-1-git-send-email-dslutz@verizon.com> <1406663869-31522-2-git-send-email-dslutz@verizon.com> <53D8C1B50200007800027886@mail.emea.novell.com> <53D9950E.1060802@terremark.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53D9950E.1060802@terremark.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Don Slutz Cc: Keir Fraser , Ian Campbell , Andrew Cooper , Tim Deegan , xen-devel@lists.xen.org, Ian Jackson List-Id: xen-devel@lists.xenproject.org >>> On 31.07.14 at 02:59, 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-="... 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-=" will now be ignored as ambiguous (rather than being interpreted as "=", i.e. ignoring the "no-" prefix). Jan