Expand continue_on_error to select which type of error to allow
This expands the continue_on_error option to take a string specifying
what type of error to continue on, breaking out errors into read,
write, and verify. (Sync, trim, and anything else not specifically a
read are considered write operations for the sake of error
continuation.)
Backwards compatibility is retained by allowing =0 and =1 values to
specify none and all, respectively.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/options.c b/options.c
index 53c3a82..2e1e709 100644
--- a/options.c
+++ b/options.c
@@ -2057,10 +2057,44 @@
},
{
.name = "continue_on_error",
- .type = FIO_OPT_BOOL,
+ .type = FIO_OPT_STR,
.off1 = td_var_offset(continue_on_error),
.help = "Continue on non-fatal errors during IO",
- .def = "0",
+ .def = "none",
+ .posval = {
+ { .ival = "none",
+ .oval = ERROR_TYPE_NONE,
+ .help = "Exit when an error is encountered",
+ },
+ { .ival = "read",
+ .oval = ERROR_TYPE_READ,
+ .help = "Continue on read errors only",
+ },
+ { .ival = "write",
+ .oval = ERROR_TYPE_WRITE,
+ .help = "Continue on write errors only",
+ },
+ { .ival = "io",
+ .oval = ERROR_TYPE_READ | ERROR_TYPE_WRITE,
+ .help = "Continue on any IO errors",
+ },
+ { .ival = "verify",
+ .oval = ERROR_TYPE_VERIFY,
+ .help = "Continue on verify errors only",
+ },
+ { .ival = "all",
+ .oval = ERROR_TYPE_ANY,
+ .help = "Continue on all io and verify errors",
+ },
+ { .ival = "0",
+ .oval = ERROR_TYPE_NONE,
+ .help = "Alias for 'none'",
+ },
+ { .ival = "1",
+ .oval = ERROR_TYPE_ANY,
+ .help = "Alias for 'all'",
+ },
+ },
},
{
.name = "profile",