From: Andrew Cooper <Andrew.Cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/cmdline: Interpret 'vpmu' as a positive boolean
Date: Thu, 3 Mar 2022 11:15:27 +0000 [thread overview]
Message-ID: <9377d616-e5ea-a3a5-0a90-e2ec81ca6fb8@citrix.com> (raw)
In-Reply-To: <3bbbe906-ca02-c748-23fe-7a98864cfb93@suse.com>
On 03/03/2022 11:04, Jan Beulich wrote:
> On 03.03.2022 11:48, Andrew Cooper wrote:
>> On 03/03/2022 07:44, Jan Beulich wrote:
>>> On 02.03.2022 23:11, Andrew Cooper wrote:
>>>> This makes it behave slightly more like a regular boolean option.
>>>>
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>>
>>>> Slightly RFC, because there is no easy way of making the opposite "normal
>>>> boolean" case work for no-vpmu.
>>> There's nothing to do to make this work afaict: Generic command line
>>> handling converts "no-<option>" to "<option>=no" for custom params.
>> Oh - I'd forgotten that, in which case this patch actually wants to be
>> simply:
>>
>> diff --git a/xen/common/kernel.c b/xen/common/kernel.c
>> index adff2d2c77f3..2cea1da781ac 100644
>> --- a/xen/common/kernel.c
>> +++ b/xen/common/kernel.c
>> @@ -162,6 +162,11 @@ static int parse_params(const char *cmdline, const
>> struct kernel_param *start,
>> safe_strcpy(opt, "no");
>> optval = opt;
>> }
>> + else if ( !*optval )
>> + {
>> + safe_strcpy(opt, "1");
>> + optval = opt;
>> + }
>> rctmp = param->par.func(optval);
>> break;
>> case OPT_IGNORE:
>>
>> to turn "option\0" into "option=1", no?
> Iirc extending this to the positive case was deliberately not done, for
> the risk of breaking custom handlers not expecting the standard boolean
> forms. We could likely go this route, but only after auditing all custom
> handlers, I'm afraid.
Well - I've already audited them all once recently. What's once more...
I'll have a go in due course; I'd definitely prefer to avoid special
casing the positive boolean form in individual handlers.
~Andrew
next prev parent reply other threads:[~2022-03-03 11:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 22:11 [PATCH] x86/cmdline: Interpret 'vpmu' as a positive boolean Andrew Cooper
2022-03-03 7:44 ` Jan Beulich
2022-03-03 10:48 ` Andrew Cooper
2022-03-03 11:04 ` Jan Beulich
2022-03-03 11:15 ` Andrew Cooper [this message]
2022-03-03 11:40 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9377d616-e5ea-a3a5-0a90-e2ec81ca6fb8@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.