parse: ensure that an option has a category
authorJens Axboe <axboe@kernel.dk>
Fri, 16 Mar 2012 17:58:39 +0000 (18:58 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 16 Mar 2012 17:58:39 +0000 (18:58 +0100)
If not, set it to misc and complain.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
parse.c

diff --git a/parse.c b/parse.c
index 9891974..dd4e4dd 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -1047,6 +1047,10 @@ void option_init(struct fio_option *o)
                      (o->roff1 || o->roff2 || o->roff3 || o->roff4))) {
                log_err("Option %s: both cb and offset given\n", o->name);
        }
+       if (!o->category) {
+               log_info("Options %s: no category defined. Setting to misc\n", o->name);
+               o->category = FIO_OPT_G_MISC;
+       }
 }
 
 /*