From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Slutz Subject: Re: [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM Date: Fri, 01 Aug 2014 08:36:32 -0400 Message-ID: <53DB89D0.5080906@terremark.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> <53DB56690200007800028477@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53DB56690200007800028477@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Tim Deegan , Keir Fraser , Ian Campbell , Andrew Cooper , Ian Jackson , Don Slutz , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 08/01/14 02:57, Jan Beulich wrote: >>>> 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 > Looks good to me. -Don Slutz