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

event: deprecate opts.config_file member



Just always put the config file name in json_config_file,
since we now only support JSON.

If user specifies both -c and --json, it will just take
the latter of the two.  This is similar to if the user
specified --json twice.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Idc21d73acf0e190eda57a7b0c5d9bcfa14e87030
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4858


Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent a3c3c0b5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ typedef void (*spdk_sighandler_t)(int signal);
 */
struct spdk_app_opts {
	const char *name;
	const char *config_file;
	const char *config_file; /* deprecated */
	const char *json_config_file;
	bool json_config_ignore_errors;
	const char *rpc_addr; /* Can be UNIX domain socket path or IP address + TCP port */
+12 −12
Original line number Diff line number Diff line
@@ -401,6 +401,18 @@ spdk_app_start(struct spdk_app_opts *opts, spdk_msg_fn start_fn,
		return 1;
	}

	if (opts->config_file) {
		SPDK_ERRLOG("opts->config_file is deprecated.  Use opts->json_config_file instead.\n");
		/* For now we will just treat config_file as json_config_file.  But if both were
		 * specified we will return an error here.
		 */
		if (opts->json_config_file) {
			SPDK_ERRLOG("Setting both opts->config_file and opts->json_config_file not allowed.\n");
			return 1;
		}
		opts->json_config_file = opts->config_file;
	}

	if (!start_fn) {
		SPDK_ERRLOG("start_fn should not be NULL\n");
		return 1;
@@ -640,8 +652,6 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
	while ((ch = getopt_long(argc, argv, cmdline_short_opts, cmdline_options, &opt_idx)) != -1) {
		switch (ch) {
		case CONFIG_FILE_OPT_IDX:
			opts->config_file = optarg;
			break;
		case JSON_CONFIG_OPT_IDX:
			opts->json_config_file = optarg;
			break;
@@ -823,16 +833,6 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
		}
	}

	if (opts->config_file) {
		if (opts->json_config_file) {
			SPDK_ERRLOG("ERROR: --config and --json options can't be used together.\n");
			goto out;
		}

		opts->json_config_file = opts->config_file;
		opts->config_file = NULL;
	}

	if (opts->json_config_file && opts->delay_subsystem_init) {
		SPDK_ERRLOG("JSON configuration file can't be used together with --wait-for-rpc.\n");
		goto out;