Commit aeebea7e authored by subash.rajaa's avatar subash.rajaa Committed by Jim Harris
Browse files

examples/hello_bdev: fail if configfile not provided



The hello_bdev example does not work without configfile, hence
displaying appropriate error when config file is not specified

Change-Id: I1f00f27674a29b6e8c0a9222589ad1d631693111
Signed-off-by: default avatarsubash.rajaa <subash.rajaa@iophysics.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456326


Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent d6013743
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -267,13 +267,17 @@ main(int argc, char **argv)
	 * ./hello_bdev -c bdev.conf -b Malloc0
	 * To use passthru bdev PT0 run with params
	 * ./hello_bdev -c bdev.conf -b PT0
	 * If none of the parameters are provide the application will use the
	 * default parameters(-c bdev.conf -b Malloc0).
	 * If the bdev name is not specified,
	 * then Malloc0 is used by default
	 */
	if ((rc = spdk_app_parse_args(argc, argv, &opts, "b:", NULL, hello_bdev_parse_arg,
				      hello_bdev_usage)) != SPDK_APP_PARSE_ARGS_SUCCESS) {
		exit(rc);
	}
	if (opts.config_file == NULL) {
		SPDK_ERRLOG("configfile must be specified using -c <conffile> e.g. -c bdev.conf\n");
		exit(1);
	}
	hello_context.bdev_name = g_bdev_name;

	/*