Spdk/lib/init
tongkunkun bb432b4eea json: fix parsing json problems when json config is invalid.
Add parsing json as invalid cases:
1.json content that not enclosed in {}, it should be parsed as invalid, e.g.

"abc":"not encloesed in {}"

2.json content that 'subsystems' not associate with array, it will report error and return failure, e.g.

{"subsystems":"123"}

3.handle other invalid json formats, report and return failure, e.g. duplicate keys.

Added `spdk_json_find` API return errcode: EPROTOTYPE - json not enclosed in {}.

json config with content:
1."not enclosed in {}"
2."'subsystems' not be an array"
3."duplicate key in json"
and some other invaild cases will be regarded as invalid json config, and will fail to start app.

Fixes #2599

Signed-off-by: tongkunkun <tongkunkun_yewu@cmss.chinamobile.com>
Change-Id: I02574c9acd7671e336d4c589ebbff8ed21eb3681
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13754
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-02 07:32:21 +00:00
..
json_config.c json: fix parsing json problems when json config is invalid. 2022-09-02 07:32:21 +00:00
Makefile Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
rpc.c Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
spdk_init.map event: Move json config loading to init 2021-05-26 09:13:34 +00:00
subsystem_rpc.c Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
subsystem.c Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
subsystem.h Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00