Have the job set ->terminate when runtime is exceeded
[fio.git] / init.c
diff --git a/init.c b/init.c
index 0151c9bd4b2979626e17c592c76938c9e2b68b35..b5f9abcef122f618f546540380f546d1f21db6af 100644 (file)
--- a/init.c
+++ b/init.c
@@ -17,7 +17,7 @@
 #include "fio.h"
 #include "parse.h"
 
-static char fio_version_string[] = "fio 1.15.1";
+static char fio_version_string[] = "fio 1.15.2";
 
 #define FIO_RANDSEED           (0xb1899bedUL)
 
@@ -274,6 +274,11 @@ static int fixup_options(struct thread_data *td)
                return 1;
        }
 
+       if (!o->timeout && o->time_based) {
+               log_err("fio: time_based requires a runtime/timeout setting\n");
+               o->time_based = 0;
+       }
+
        return 0;
 }
 
@@ -427,6 +432,13 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
        if (fixup_options(td))
                goto err;
 
+       if (td->io_ops->flags & FIO_DISKLESSIO) {
+               struct fio_file *f;
+
+               for_each_file(td, f, i)
+                       f->real_file_size = -1ULL;
+       }
+
        td->mutex = fio_sem_init(0);
 
        td->ts.clat_stat[0].min_val = td->ts.clat_stat[1].min_val = ULONG_MAX;