@@ -148,6 +148,9 @@ static void json_parse_host(nvme_root_t r, struct json_object *host_obj)
148148 attr_obj = json_object_object_get (host_obj , "hostsymname" );
149149 if (attr_obj )
150150 nvme_host_set_hostsymname (h , json_object_get_string (attr_obj ));
151+ attr_obj = json_object_object_get (host_obj , "persistent_discovery_ctrl" );
152+ if (attr_obj )
153+ nvme_host_set_pdc_enabled (h , json_object_get_boolean (attr_obj ));
151154 subsys_array = json_object_object_get (host_obj , "subsystems" );
152155 if (!subsys_array )
153156 return ;
@@ -354,6 +357,9 @@ int json_update_config(nvme_root_t r, const char *config_file)
354357 if (hostsymname )
355358 json_object_object_add (host_obj , "hostsymname" ,
356359 json_object_new_string (hostsymname ));
360+ if (h -> pdc_enabled_valid )
361+ json_object_object_add (host_obj , "persistent_discovery_ctrl" ,
362+ json_object_new_boolean (h -> pdc_enabled ));
357363 subsys_array = json_object_new_array ();
358364 nvme_for_each_subsystem (h , s ) {
359365 json_update_subsys (subsys_array , s );
@@ -492,6 +498,9 @@ int json_dump_tree(nvme_root_t r)
492498 if (dhchap_key )
493499 json_object_object_add (host_obj , "dhchap_key" ,
494500 json_object_new_string (dhchap_key ));
501+ if (h -> pdc_enabled_valid )
502+ json_object_object_add (host_obj , "persistent_discovery_ctrl" ,
503+ json_object_new_boolean (h -> pdc_enabled ));
495504 subsys_array = json_object_new_array ();
496505 nvme_for_each_subsystem (h , s ) {
497506 json_dump_subsys (subsys_array , s );
0 commit comments