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: subash.rajaa <subash.rajaa@iophysics.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456326
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
subash.rajaa 2019-05-30 06:08:39 -04:00 committed by Jim Harris
parent d601374387
commit aeebea7e0d

View File

@ -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;
/*