DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ray Kinsella <mdr@ashroe.eu>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org, weiyuanx.li@intel.com,
	xuemingx.zhang@intel.com, Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [PATCH 1/2] cmdline: add function to verify valid commands
Date: Tue, 24 May 2022 15:57:07 +0100	[thread overview]
Message-ID: <87pmk3yo58.fsf@mdr78.vserver.site> (raw)
In-Reply-To: <20220520145631.137962-2-bruce.richardson@intel.com>


Bruce Richardson <bruce.richardson@intel.com> writes:

> 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@intel.com>
> ---
>  lib/cmdline/cmdline_parse.c | 20 +++++++++++++++++---
>  lib/cmdline/cmdline_parse.h | 17 +++++++++++++++--
>  lib/cmdline/version.map     |  3 +++
>  3 files changed, 35 insertions(+), 5 deletions(-)

Acked-by: Ray Kinsella <mdr@ashroe.eu>

  reply	other threads:[~2022-05-24 14:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 14:56 [PATCH 0/2] fix uncallable unit tests (Bugzilla 1002) Bruce Richardson
2022-05-20 14:56 ` [PATCH 1/2] cmdline: add function to verify valid commands Bruce Richardson
2022-05-24 14:57   ` Ray Kinsella [this message]
2022-05-20 14:56 ` [PATCH 2/2] test: use cmdline library to validate args Bruce Richardson
2022-05-20 15:12 ` [PATCH v2 0/2] fix uncallable unit tests (Bugzilla 1002) Bruce Richardson
2022-05-20 15:12   ` [PATCH v2 1/2] cmdline: add function to verify valid commands Bruce Richardson
2022-05-23  6:52     ` Li, WeiyuanX
2022-06-07  8:08     ` Olivier Matz
2022-06-10 14:08       ` Bruce Richardson
2022-06-10 14:21         ` Olivier Matz
2022-05-20 15:12   ` [PATCH v2 2/2] test: use cmdline library to validate args Bruce Richardson
2022-06-07  8:08     ` Olivier Matz
2022-06-10 14:24 ` [PATCH v3 0/2] fix uncallable unit tests (Bugzilla 1002) Bruce Richardson
2022-06-10 14:24   ` [PATCH v3 1/2] cmdline: add function to verify valid commands Bruce Richardson
2022-06-10 14:24   ` [PATCH v3 2/2] test: use cmdline library to validate args Bruce Richardson
2022-06-13  9:22   ` [PATCH v3 0/2] fix uncallable unit tests (Bugzilla 1002) David Marchand

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=87pmk3yo58.fsf@mdr78.vserver.site \
    --to=mdr@ashroe.eu \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    --cc=stable@dpdk.org \
    --cc=weiyuanx.li@intel.com \
    --cc=xuemingx.zhang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).