Commit be619872 authored by Jim Harris's avatar Jim Harris
Browse files

test/app/stub: enforce stub to only run as a primary process



The stub process is only meant to be run as a primary process, it is not useful
at all as a secondary process. We can use spdk_app_opts::env_context
to specify to DPDK that the process should be initialized as a primary process.
That way if a stub process is already running at the same shm_id it will exit
with error immediately.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: I9091ebc4b996c55531e82fc6231aebb210e5810b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22476


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 687da749
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ main(int argc, char **argv)

	opts.name = "stub";
	opts.rpc_addr = NULL;
	opts.env_context = "--proc-type=primary";

	while ((ch = getopt(argc, argv, "i:m:n:p:q:s:t:H")) != -1) {
		if (ch == 'm') {