Add support for limiting only rate in only one direction
[fio.git] / options.c
index a45d1af6b7d9f17c316def4b0bfa6d48b515763e..b2dd4de6f9202f44454c0e38ec6a8d20337547a8 100644 (file)
--- a/options.c
+++ b/options.c
@@ -11,6 +11,7 @@
 #include <sys/stat.h>
 
 #include "fio.h"
+#include "verify.h"
 #include "parse.h"
 #include "lib/fls.h"
 
@@ -1258,27 +1259,31 @@ static struct fio_option options[] = {
        },
        {
                .name   = "rate",
-               .type   = FIO_OPT_INT,
-               .off1   = td_var_offset(rate),
+               .type   = FIO_OPT_STR_VAL_INT,
+               .off1   = td_var_offset(rate[0]),
+               .off2   = td_var_offset(rate[1]),
                .help   = "Set bandwidth rate",
        },
        {
                .name   = "ratemin",
-               .type   = FIO_OPT_INT,
-               .off1   = td_var_offset(ratemin),
+               .type   = FIO_OPT_STR_VAL_INT,
+               .off1   = td_var_offset(ratemin[0]),
+               .off2   = td_var_offset(ratemin[1]),
                .help   = "Job must meet this rate or it will be shutdown",
                .parent = "rate",
        },
        {
                .name   = "rate_iops",
-               .type   = FIO_OPT_INT,
-               .off1   = td_var_offset(rate_iops),
+               .type   = FIO_OPT_STR_VAL_INT,
+               .off1   = td_var_offset(rate_iops[0]),
+               .off2   = td_var_offset(rate_iops[1]),
                .help   = "Limit IO used to this number of IO operations/sec",
        },
        {
                .name   = "rate_iops_min",
-               .type   = FIO_OPT_INT,
-               .off1   = td_var_offset(rate_iops_min),
+               .type   = FIO_OPT_STR_VAL_INT,
+               .off1   = td_var_offset(rate_iops_min[0]),
+               .off2   = td_var_offset(rate_iops_min[1]),
                .help   = "Job must meet this rate or it will be shutdown",
                .parent = "rate_iops",
        },