summaryrefslogtreecommitdiffstats
path: root/src/nvme/json.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-31 04:16:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-31 04:16:55 +0000
commitfbe661f56f8f51c8bda7b3ced1ec41af509e61ff (patch)
treeac8ac7d3960922094733bac6d9a5300da7171c56 /src/nvme/json.c
parentAdding upstream version 1.2. (diff)
downloadlibnvme-fbe661f56f8f51c8bda7b3ced1ec41af509e61ff.tar.xz
libnvme-fbe661f56f8f51c8bda7b3ced1ec41af509e61ff.zip
Adding upstream version 1.3.upstream/1.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/nvme/json.c')
-rw-r--r--src/nvme/json.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvme/json.c b/src/nvme/json.c
index f0c2ab4..072b622 100644
--- a/src/nvme/json.c
+++ b/src/nvme/json.c
@@ -148,6 +148,9 @@ static void json_parse_host(nvme_root_t r, struct json_object *host_obj)
attr_obj = json_object_object_get(host_obj, "hostsymname");
if (attr_obj)
nvme_host_set_hostsymname(h, json_object_get_string(attr_obj));
+ attr_obj = json_object_object_get(host_obj, "persistent_discovery_ctrl");
+ if (attr_obj)
+ nvme_host_set_pdc_enabled(h, json_object_get_boolean(attr_obj));
subsys_array = json_object_object_get(host_obj, "subsystems");
if (!subsys_array)
return;
@@ -354,6 +357,9 @@ int json_update_config(nvme_root_t r, const char *config_file)
if (hostsymname)
json_object_object_add(host_obj, "hostsymname",
json_object_new_string(hostsymname));
+ if (h->pdc_enabled_valid)
+ json_object_object_add(host_obj, "persistent_discovery_ctrl",
+ json_object_new_boolean(h->pdc_enabled));
subsys_array = json_object_new_array();
nvme_for_each_subsystem(h, s) {
json_update_subsys(subsys_array, s);
@@ -492,6 +498,9 @@ int json_dump_tree(nvme_root_t r)
if (dhchap_key)
json_object_object_add(host_obj, "dhchap_key",
json_object_new_string(dhchap_key));
+ if (h->pdc_enabled_valid)
+ json_object_object_add(host_obj, "persistent_discovery_ctrl",
+ json_object_new_boolean(h->pdc_enabled));
subsys_array = json_object_new_array();
nvme_for_each_subsystem(h, s) {
json_dump_subsys(subsys_array, s);