Commit 9ad234a1 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Tomasz Zawadzki
Browse files

examples/fio_plugin: don't allow starting in daemonized fio server



A nice message about not supporting fio daemon mode is
better than seeing CRC errors.

Resolves #1118

Change-Id: I274e7a053e2fa464e26a19bf2b8b76395ad40e7c
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/575


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent abb942bd
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -405,6 +405,20 @@ spdk_fio_setup(struct thread_data *td)
	unsigned int i;
	struct fio_file *f;

	/* we might be running in a daemonized FIO instance where standard
	 * input and output were closed and fds 0, 1, and 2 are reused
	 * for something important by FIO. We can't ensure we won't print
	 * anything (and so will our dependencies, e.g. DPDK), so abort early.
	 * (is_backend is an fio global variable)
	 */
	if (is_backend) {
		char buf[1024];
		snprintf(buf, sizeof(buf),
			 "SPDK FIO plugin won't work with daemonized FIO server.");
		fio_server_text_output(FIO_LOG_ERR, buf, sizeof(buf));
		return -1;
	}

	if (!td->o.use_thread) {
		SPDK_ERRLOG("must set thread=1 when using spdk plugin\n");
		return -1;
+14 −0
Original line number Diff line number Diff line
@@ -372,6 +372,20 @@ static int spdk_fio_setup(struct thread_data *td)
	char *trid_info;
	unsigned int i;

	/* we might be running in a daemonized FIO instance where standard
	 * input and output were closed and fds 0, 1, and 2 are reused
	 * for something important by FIO. We can't ensure we won't print
	 * anything (and so will our dependencies, e.g. DPDK), so abort early.
	 * (is_backend is an fio global variable)
	 */
	if (is_backend) {
		char buf[1024];
		snprintf(buf, sizeof(buf),
			 "SPDK FIO plugin won't work with daemonized FIO server.");
		fio_server_text_output(FIO_LOG_ERR, buf, sizeof(buf));
		return -1;
	}

	if (!td->o.use_thread) {
		log_err("spdk: must set thread=1 when using spdk plugin\n");
		return 1;