Commit 80494b8e authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

test/vhost: Separate vhost_json_config from vhost_run



There are upcoming simplifications where it will be
better if these are two separate steps.

Change-Id: I618f947dc314b05a4f94ea98c63fe85539544704
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461386


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 0140c62b
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -130,7 +130,6 @@ function vhost_run()
				vhost_num="${param#*=}"
				assert_number "$vhost_num"
				;;
			--json-path=*) local vhost_json_path="${param#*=}" ;;
			--memory=*) local memory=${param#*=} ;;
			--no-pci*) local no_pci="-u" ;;
			*)
@@ -185,14 +184,19 @@ function vhost_run()
		 -s $vhost_dir/rpc.sock load_subsystem_config
	fi

	if [[ -n "$vhost_json_path" ]]; then
		$rootdir/scripts/rpc.py -s $vhost_dir/rpc.sock load_config < "$vhost_json_path/conf.json"
	fi

	notice "vhost started - pid=$vhost_pid"
	timing_exit vhost_start
}

function vhost_load_config()
{
	local vhost_num="$1"
	local vhost_json_conf="$2"
	local vhost_dir="$(get_vhost_dir $vhost_num)"

	$rootdir/scripts/rpc.py -s $vhost_dir/rpc.sock load_config < "$vhost_json_conf"
}

function vhost_kill()
{
	local rc=0
+2 −1
Original line number Diff line number Diff line
@@ -81,7 +81,8 @@ if [[ $test_type =~ "spdk_vhost" ]]; then
	notice ""
	notice "running SPDK"
	notice ""
	vhost_run --json-path=$testdir
	vhost_run
	vhost_json_config 0 $testdir/conf.json
	notice ""
fi

+2 −1
Original line number Diff line number Diff line
@@ -69,7 +69,8 @@ if [[ $RUN_NIGHTLY -eq 1 ]]; then
	notice ""
	notice "running SPDK"
	notice ""
	vhost_run --json-path=$testdir
	vhost_run
	vhost_json_config 0 $testdir/conf.json
	notice ""

	rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"