[PATCH v2 1/2] cmdline: add function to verify valid commands
Li, WeiyuanX
weiyuanx.li at intel.com
Mon May 23 08:52:53 CEST 2022
> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson at intel.com>
> Sent: Friday, May 20, 2022 11:13 PM
> To: dev at dpdk.org
> Cc: stable at dpdk.org; Li, WeiyuanX <weiyuanx.li at intel.com>; Richardson,
> Bruce <bruce.richardson at intel.com>; Olivier Matz
> <olivier.matz at 6wind.com>; Ray Kinsella <mdr at ashroe.eu>
> Subject: [PATCH v2 1/2] cmdline: add function to verify valid commands
>
> The cmdline library cmdline_parse() function parses a command and
> executes the action automatically too. The cmdline_valid_buffer function
> also uses this function to validate commands, meaning that there is no
> function to validate a command as ok without executing it.
>
> To fix this omission, we extract the body of cmdline_parse into a new static
> inline function with an extra parameter to indicate whether the action should
> be performed or not. Then we create two wrappers around that - a
> replacement for the existing cmdline_parse function where the extra
> parameter is "true" to execute the command, and a new function
> "cmdline_parse_check" which passes the parameter as "false" to perform
> cmdline validation only.
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
Tested-by: Weiyuan Li <weiyuanx.li at intel.com>
Regards,
Li, Weiyuan
More information about the dev
mailing list