Commit 8c3e71f0 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Jim Harris
Browse files

script/gen_nvme: do not generate legacy configuration



gen_nvme.sh will no longer generate the legacy configuration.
"--json" option will still work for any current users of the script.

Tests were modified to no longer use the "--json" option.
Meanwhile others were simplified with switch to "--json-with-subsystems".

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8450be98660e54c64c27d8401fc40d649f9403ea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4802


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
parent 2903c655
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1523,7 +1523,7 @@ main(int argc, char **argv)
	if (access(cli_context->config_file, F_OK) == -1) {
		printf("Error: No config file found.\n");
		printf("To create a config file named 'blobcli.json' for your NVMe device:\n");
		printf("   <path to spdk>/scripts/gen_nvme.sh --json > blobcli.json\n");
		printf("   <path to spdk>/scripts/gen_nvme.sh --json-with-subsystems > blobcli.json\n");
		printf("and then re-run the cli tool.\n");
		exit(-1);
	}
+2 −11
Original line number Diff line number Diff line
@@ -5,13 +5,6 @@ set -e
rootdir=$(readlink -f $(dirname $0))/..
source "$rootdir/scripts/common.sh"

function create_classic_config() {
	echo "[Nvme]"
	for ((i = 0; i < ${#bdfs[@]}; i++)); do
		echo "  TransportID \"trtype:PCIe traddr:${bdfs[i]}\" Nvme$i"
	done
}

function create_json_config() {
	local bdev_json_cfg=()

@@ -53,10 +46,8 @@ function create_json_config_with_subsystems() {

bdfs=($(nvme_in_userspace))

if [ "$1" = "--json" ]; then
	create_json_config
elif [ "$1" = "--json-with-subsystems" ]; then
if [[ "$1" = "--json-with-subsystems" ]]; then
	create_json_config_with_subsystems
else
	create_classic_config
	create_json_config
fi
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ function setup_bdev_conf() {
}

function setup_nvme_conf() {
	"$rootdir/scripts/gen_nvme.sh" --json | "$rpc_py" load_subsystem_config
	"$rootdir/scripts/gen_nvme.sh" | "$rpc_py" load_subsystem_config
}

function setup_gpt_conf() {
+1 −3
Original line number Diff line number Diff line
@@ -75,9 +75,7 @@ popd

timing_exit db_bench_build

echo '{"subsystems": [' > $ROCKSDB_CONF
$rootdir/scripts/gen_nvme.sh --json >> $ROCKSDB_CONF
echo ']}' >> $ROCKSDB_CONF
$rootdir/scripts/gen_nvme.sh --json-with-subsystems > $ROCKSDB_CONF

trap 'dump_db_bench_on_err; run_bsdump || :; rm -f $ROCKSDB_CONF; sanitize_results; exit 1' SIGINT SIGTERM EXIT

+1 −3
Original line number Diff line number Diff line
@@ -11,9 +11,7 @@ rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh

# Nvme0 target configuration
echo '{"subsystems": [' > $testdir/blobcli.json
$rootdir/scripts/gen_nvme.sh --json | jq -r "del(.config[] | select(.params.name!=\"Nvme0\"))" >> $testdir/blobcli.json
echo ']}' >> $testdir/blobcli.json
$rootdir/scripts/gen_nvme.sh --json-with-subsystems > $testdir/blobcli.json

# generate random data file for import/export diff
dd if=/dev/urandom of=$testdir/test.pattern bs=1M count=1
Loading