summaryrefslogtreecommitdiffstats
path: root/src/nvme/json.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-15 12:26:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-15 12:26:24 +0000
commit4864ced5614f5954f5bcab95e897da9b6824d931 (patch)
tree34f3dbb5bf63c8d3f2e95640aab82eebcbf48b92 /src/nvme/json.c
parentAdding upstream version 1.1~rc0. (diff)
downloadlibnvme-4864ced5614f5954f5bcab95e897da9b6824d931.tar.xz
libnvme-4864ced5614f5954f5bcab95e897da9b6824d931.zip
Adding upstream version 1.1.upstream/1.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/nvme/json.c')
-rw-r--r--src/nvme/json.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvme/json.c b/src/nvme/json.c
index 6f0b81c..b42cd51 100644
--- a/src/nvme/json.c
+++ b/src/nvme/json.c
@@ -95,7 +95,7 @@ static void json_parse_port(nvme_subsystem_t s, struct json_object *port_obj)
if (!c)
return;
json_update_attributes(c, port_obj);
- attr_obj = json_object_object_get(port_obj, "dhchap_key");
+ attr_obj = json_object_object_get(port_obj, "dhchap_ctrl_key");
if (attr_obj)
nvme_ctrl_set_dhchap_key(c, json_object_get_string(attr_obj));
}
@@ -224,7 +224,7 @@ static void json_update_port(struct json_object *ctrl_array, nvme_ctrl_t c)
json_object_new_string(value));
value = nvme_ctrl_get_dhchap_key(c);
if (value)
- json_object_object_add(port_obj, "dhchap_key",
+ json_object_object_add(port_obj, "dhchap_ctrl_key",
json_object_new_string(value));
JSON_INT_OPTION(cfg, port_obj, nr_io_queues, 0);
JSON_INT_OPTION(cfg, port_obj, nr_write_queues, 0);
@@ -318,9 +318,10 @@ int json_update_config(nvme_root_t r, const char *config_file)
json_object_put(subsys_array);
json_object_array_add(json_root, host_obj);
}
- if (!config_file)
+ if (!config_file) {
ret = json_object_to_fd(1, json_root, JSON_C_TO_STRING_PRETTY);
- else
+ printf("\n");
+ } else
ret = json_object_to_file_ext(config_file, json_root,
JSON_C_TO_STRING_PRETTY);
if (ret < 0) {
@@ -366,7 +367,7 @@ static void json_dump_ctrl(struct json_object *ctrl_array, nvme_ctrl_t c)
json_object_new_string(value));
value = nvme_ctrl_get_dhchap_key(c);
if (value)
- json_object_object_add(ctrl_obj, "dhchap_key",
+ json_object_object_add(ctrl_obj, "dhchap_ctrl_key",
json_object_new_string(value));
JSON_INT_OPTION(cfg, ctrl_obj, nr_io_queues, 0);
JSON_INT_OPTION(cfg, ctrl_obj, nr_write_queues, 0);