Skip to content

Commit

Permalink
Merge pull request #450 from hreinecke/json-sync
Browse files Browse the repository at this point in the history
json: fixup dhchap_ctrl_key definitions
  • Loading branch information
igaw authored Aug 1, 2022
2 parents 3627e71 + 51eac08 commit 0ba95b8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions doc/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
"description": "NVMe host ID",
"type": "string"
},
"dhchap_key": {
"description": "Host DH-HMAC-CHAP key",
"type": "string"
},
"hostsymname": {
"description": "NVMe host symbolic name",
"type": "string"
Expand Down Expand Up @@ -78,10 +82,6 @@
"description": "Transport service identifier",
"type": "string"
},
"dhchap_key": {
"description": "Host DH-HMAC-CHAP key",
"type": "string"
},
"dhchap_ctrl_key": {
"description": "Controller DH-HMAC-CHAP key",
"type": "string"
Expand Down
6 changes: 3 additions & 3 deletions src/nvme/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -367,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);
Expand Down
1 change: 1 addition & 0 deletions src/nvme/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ void nvme_deconfigure_ctrl(nvme_ctrl_t c)
FREE_CTRL_ATTR(c->queue_count);
FREE_CTRL_ATTR(c->serial);
FREE_CTRL_ATTR(c->sqsize);
FREE_CTRL_ATTR(c->dhchap_key);
FREE_CTRL_ATTR(c->address);
FREE_CTRL_ATTR(c->dctype);
FREE_CTRL_ATTR(c->cntrltype);
Expand Down

0 comments on commit 0ba95b8

Please sign in to comment.