Commit 37b3b045 authored by Jim Harris's avatar Jim Harris Committed by Konrad Sztyber
Browse files

event: help user if env initialization fails as non-root



env_dpdk usually cannot initialize successfully without running as
root. If env init fails and the uid isn't root, print an error message
to help the user if they forgot to run as root.

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


Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarChangpeng Liu <changpeliu@tencent.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 2e29543d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -511,6 +511,9 @@ app_setup_env(struct spdk_app_opts *opts)

	if (rc < 0) {
		SPDK_ERRLOG("Unable to initialize SPDK env\n");
		if (getuid() != 0) {
			SPDK_ERRLOG("You may need to run as root\n");
		}
	}

	return rc;