summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-04-17 21:49:51 -0600
committerJens Axboe <axboe@kernel.dk>2018-04-17 21:49:51 -0600
commitc47537ee91cd4f73e575c371c28ca2ac6babd2c1 (patch)
tree6f52a3b5d6c9a1752829666afc98e0f5929e04bf
parenta2e313142546aa5cb95ba7cb3708b7e06f58518c (diff)
parse: add support for soft deprecated options
The currently deprecated option types will fail parsing. But we can also have options where we don't care, log an error for those but continue executing the job. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--parse.c10
-rw-r--r--parse.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/parse.c b/parse.c
index 539c602..9685f1e 100644
--- a/parse.c
+++ b/parse.c
@@ -36,6 +36,7 @@ static const char *opt_type_names[] = {
"OPT_FLOAT_LIST",
"OPT_STR_SET",
"OPT_DEPRECATED",
+ "OPT_SOFT_DEPRECATED",
"OPT_UNSUPPORTED",
};
@@ -876,8 +877,9 @@ static int __handle_option(const struct fio_option *o, const char *ptr,
break;
}
case FIO_OPT_DEPRECATED:
- log_info("Option %s is deprecated\n", o->name);
ret = 1;
+ case FIO_OPT_SOFT_DEPRECATED:
+ log_info("Option %s is deprecated\n", o->name);
break;
default:
log_err("Bad option type %u\n", o->type);
@@ -1235,7 +1237,8 @@ int show_cmd_help(const struct fio_option *options, const char *name)
for (o = &options[0]; o->name; o++) {
int match = 0;
- if (o->type == FIO_OPT_DEPRECATED)
+ if (o->type == FIO_OPT_DEPRECATED ||
+ o->type == FIO_OPT_SOFT_DEPRECATED)
continue;
if (!exec_profile && o->prof_name)
continue;
@@ -1309,7 +1312,8 @@ void fill_default_options(void *data, const struct fio_option *options)
static void option_init(struct fio_option *o)
{
- if (o->type == FIO_OPT_DEPRECATED || o->type == FIO_OPT_UNSUPPORTED)
+ if (o->type == FIO_OPT_DEPRECATED || o->type == FIO_OPT_UNSUPPORTED ||
+ o->type == FIO_OPT_SOFT_DEPRECATED)
return;
if (o->name && !o->lname)
log_err("Option %s: missing long option name\n", o->name);
diff --git a/parse.h b/parse.h
index 4ad92d9..4de5e77 100644
--- a/parse.h
+++ b/parse.h
@@ -20,6 +20,7 @@ enum fio_opt_type {
FIO_OPT_FLOAT_LIST,
FIO_OPT_STR_SET,
FIO_OPT_DEPRECATED,
+ FIO_OPT_SOFT_DEPRECATED,
FIO_OPT_UNSUPPORTED, /* keep this last */
};