Error out gracefully if we don't find the replay device for log replay

It would segfault before because no files got added to replay
against. Handle this more gracefully and ensure that fio exits
with a non-zero exit status.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/blktrace.c b/blktrace.c
index 04648a0..9e4e599 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -220,6 +220,7 @@
 		trace_add_open_close_event(td, fileno, FIO_LOG_OPEN_FILE);
 		last_fileno = fileno;
 	}
+
 	return last_fileno;
 }
 
@@ -450,13 +451,18 @@
 	} while (1);
 
 	for (i = 0; i < td->files_index; i++) {
-		f= td->files[i];
+		f = td->files[i];
 		trace_add_open_close_event(td, f->fileno, FIO_LOG_CLOSE_FILE);
 	}
 
 	fifo_free(fifo);
 	close(fd);
 
+	if (!td->files_index) {
+		log_err("fio: did not find replay device(s)\n");
+		return 1;
+	}
+
 	if (skipped_writes)
 		log_err("fio: %s skips replay of %lu writes due to read-only\n",
 						td->o.name, skipped_writes);
diff --git a/iolog.c b/iolog.c
index dadbf0f..6593367 100644
--- a/iolog.c
+++ b/iolog.c
@@ -493,6 +493,9 @@
 	} else if (td->o.write_iolog_file)
 		ret = init_iolog_write(td);
 
+	if (ret)
+		td_verror(td, EINVAL, "failed initializing iolog");
+
 	return ret;
 }