event: Change the base to 0 when calling strtol

Previously, we can -p + hex value(e.g., 0x1) to assign the master core
and start the NVMe-oF or iSCSI target app.

However now it is not supported and prints error. I checked
the code, it only supports transformation with Decimal format,
so chaning the base to 0 to make it supporting other formats.

Change-Id: I82510ba0cef47b5593484b4fd3490f85c93cf6a5
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/c/444830
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Ziye Yang 2019-02-15 22:45:35 +08:00 committed by Darek Stojaczyk
parent fdcd8b708a
commit 8bbf0391f6

View File

@ -853,7 +853,7 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
retval = SPDK_APP_PARSE_ARGS_HELP;
goto out;
case SHM_ID_OPT_IDX:
opts->shm_id = spdk_strtol(optarg, 10);
opts->shm_id = spdk_strtol(optarg, 0);
if (opts->shm_id < 0) {
fprintf(stderr, "Invalid shared memory ID %s\n", optarg);
goto out;
@ -863,14 +863,14 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
opts->reactor_mask = optarg;
break;
case MEM_CHANNELS_OPT_IDX:
opts->mem_channel = spdk_strtol(optarg, 10);
opts->mem_channel = spdk_strtol(optarg, 0);
if (opts->mem_channel < 0) {
fprintf(stderr, "Invalid memory channel %s\n", optarg);
goto out;
}
break;
case MASTER_CORE_OPT_IDX:
opts->master_core = spdk_strtol(optarg, 10);
opts->master_core = spdk_strtol(optarg, 0);
if (opts->master_core < 0) {
fprintf(stderr, "Invalid master core %s\n", optarg);
goto out;