Set minimum value allowed for some options
authorJens Axboe <jens.axboe@oracle.com>
Fri, 20 Jul 2007 12:25:31 +0000 (14:25 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 20 Jul 2007 12:25:31 +0000 (14:25 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
options.c

index 94eacbaaebbb6e7ca448bfefe17b735db7c659cd..04ed548d97b5a992cf6e50e220f64c9d5b43075c 100644 (file)
--- a/options.c
+++ b/options.c
@@ -369,6 +369,7 @@ static struct fio_option options[] = {
                .name   = "size",
                .type   = FIO_OPT_STR_VAL,
                .off1   = td_var_offset(size),
                .name   = "size",
                .type   = FIO_OPT_STR_VAL,
                .off1   = td_var_offset(size),
+               .minval = 1,
                .help   = "Total size of device or files",
        },
        {
                .help   = "Total size of device or files",
        },
        {
@@ -376,6 +377,7 @@ static struct fio_option options[] = {
                .type   = FIO_OPT_STR_VAL,
                .off1   = td_var_offset(file_size_low),
                .off2   = td_var_offset(file_size_high),
                .type   = FIO_OPT_STR_VAL,
                .off1   = td_var_offset(file_size_low),
                .off2   = td_var_offset(file_size_high),
+               .minval = 1,
                .help   = "Size of individual files",
        },
        {
                .help   = "Size of individual files",
        },
        {
@@ -384,6 +386,7 @@ static struct fio_option options[] = {
                .type   = FIO_OPT_STR_VAL_INT,
                .off1   = td_var_offset(bs[DDIR_READ]),
                .off2   = td_var_offset(bs[DDIR_WRITE]),
                .type   = FIO_OPT_STR_VAL_INT,
                .off1   = td_var_offset(bs[DDIR_READ]),
                .off2   = td_var_offset(bs[DDIR_WRITE]),
+               .minval = 1,
                .help   = "Block size unit",
                .def    = "4k",
        },
                .help   = "Block size unit",
                .def    = "4k",
        },
@@ -395,6 +398,7 @@ static struct fio_option options[] = {
                .off2   = td_var_offset(max_bs[DDIR_READ]),
                .off3   = td_var_offset(min_bs[DDIR_WRITE]),
                .off4   = td_var_offset(max_bs[DDIR_WRITE]),
                .off2   = td_var_offset(max_bs[DDIR_READ]),
                .off3   = td_var_offset(min_bs[DDIR_WRITE]),
                .off4   = td_var_offset(max_bs[DDIR_WRITE]),
+               .minval = 1,
                .help   = "Set block size range (in more detail than bs)",
        },
        {
                .help   = "Set block size range (in more detail than bs)",
        },
        {