Content-Type: multipart/mixed; boundary="===============4251649554033346173==" MIME-Version: 1.0 From: ramesh.thomas at intel.com Subject: [Accel-config] [PATCH v1 1/2] accel-config: Make remove-mdev cmd "remove all" option more intuitive Date: Fri, 07 May 2021 19:38:27 -0400 Message-ID: <20210507233828.842577-2-ramesh.thomas@intel.com> In-Reply-To: 20210507233828.842577-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============4251649554033346173== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ramesh Thomas Currently user needs to pass a null uuid to remove all mdevs. Null uuid string is too long and needs to be in the uuid format which is not easy for user to remember and type. Add support for a special parameter "all" to indicate removall of all mdevs. Signed-off-by: Ramesh Thomas --- accfg/mdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/accfg/mdev.c b/accfg/mdev.c index 3bde7eb..3b74efd 100644 --- a/accfg/mdev.c +++ b/accfg/mdev.c @@ -130,7 +130,7 @@ int cmd_remove_mdev(int argc, const char **argv, void *= ctx) = const char *const u[] =3D { "accfg remove-mdev [|]", - "Pass null uuid to remove all mdevs", + "Pass \"all\" to remove all mdevs", NULL }; = @@ -152,7 +152,9 @@ int cmd_remove_mdev(int argc, const char **argv, void *= ctx) if (opt_called) return 0; = - if (uuid_parse(argv[1], uuid) < 0) { + if (!strcmp(argv[1], "all")) + uuid_clear(uuid); + else if (uuid_parse(argv[1], uuid) < 0) { fprintf(stderr, "Invalid uuid\n"); usage_with_options(u, options); } -- = 2.26.3 --===============4251649554033346173==--