Commit 2a8a3ad2 authored by Joel Cunningham's avatar Joel Cunningham Committed by Jim Harris
Browse files

vfio-user: call init_cb if getcwd fails



spdk_vfu_init() will hang SPDK subsystem init if getcwd() fails. init_cb
should be invoked to report the error and fail initialization.

I don't have a good way to test this right now, but the correctness
is straight forward.

Fixes #3589
Change-Id: Id5108443512282e4948e9dce00cbdd1e9a086b07
Signed-off-by: default avatarJoel Cunningham <joel.cunningham@oracle.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26324


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarChangpeng Liu <changpeliu@tencent.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz@tzawadzki.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
parent bc6e91d1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -759,6 +759,7 @@ spdk_vfu_init(spdk_vfu_init_cb init_cb)
	if (g_endpoint_path_dirname[0] == '\0') {
		if (getcwd(g_endpoint_path_dirname, sizeof(g_endpoint_path_dirname) - 2) == NULL) {
			SPDK_ERRLOG("getcwd failed\n");
			init_cb(-errno);
			return;
		}