[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] xen/cmdline: Extend parse_boolean() to signal a name match
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 11 Jul 2022 08:27:08 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pWLBQmHfGuHpotrsQwgdjey05YgjSg/pkJoyOWwi5j8=; b=Qq6Lh57Fqzy0WmGg1tbofD10t5ADjSyfXtbJ71fOIR9o35kBiQfqdSCaylF4C+GBS/43Xnc8wFHutNmajgT42xcqLGlXi3YWGmsT9z+JWktTwrQeLLzsIISa37crdu0IUOzFBI1GGDg4+P9yl3GbNrWK2AUTvwsFfzoYnvitDQJePCKyHvm/FB5HzZjIQOGqLWcBTEfTRNMyuXvvXVftYyeguMMOhgYk0armRyeMxqrmlg3cT4w4tLpy13DbKNF7BxcvwT4RHTjLKEDBeJGra1iQYFBaOb4nRHpIZO0zM4fZN3m5izlNnS5fADn/+p7vo1Ky4MMiuMWjQq8QSoE+vA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y1PAAqTpvpjrTe1FNqZZELMdSSPZnmrx+ZrkA60ABV3ywbfd4OU+SNB5gy/Q1Ji1MAbLD896pHG86b9k7IBVSgQ2LdinMmXP0EbtIEpXyQ7DNHQ9LdUayWYjttbQcUTjV0vrGSQ8JHS0GicQyswf/eFmmxFcxjwVW8MxK6TQAkmwzu2iB/Kkr81vxozMdPqGW6/GkVpNDebvmb6sb/s+pjKk7XYGnaYw/8CugGEkqgnU3oCGGkevuWx2M+4CArFXaphzw+g0G7xw6FvS3T8CD9G9BPWseYK3NACI07AMtD/X5otQ/EzbJLphCbdibLMuULpF/q97GwaJM6OyJ+A1yg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 11 Jul 2022 06:27:17 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 08.07.2022 18:19, Andrew Cooper wrote:
> This will help parsing a sub-option which has boolean and non-boolean options
> available.
>
> First, rework 'int val' into 'bool has_neg_prefix'. This inverts it's value,
> but the resulting logic is far easier to follow.
>
> Second, reject anything of the form 'no-$FOO=' which excludes ambiguous
> constructs such as 'no-$foo=yes' which have never been valid.
>
> This just leaves the case where everything is otherwise fine, but parse_bool()
> can't interpret the provided string.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
|