@@ -53,6 +53,7 @@ struct json_object *util_bus_to_json(struct ndctl_bus *bus)
struct json_object *util_dimm_to_json(struct ndctl_dimm *dimm)
{
struct json_object *jdimm = json_object_new_object();
+ const char *id = ndctl_dimm_get_unique_id(dimm);
struct json_object *jobj;
if (!jdimm)
@@ -63,6 +64,13 @@ struct json_object *util_dimm_to_json(struct ndctl_dimm *dimm)
goto err;
json_object_object_add(jdimm, "dev", jobj);
+ if (id) {
+ jobj = json_object_new_string(id);
+ if (!jobj)
+ goto err;
+ json_object_object_add(jdimm, "id", jobj);
+ }
+
if (!ndctl_dimm_is_enabled(dimm)) {
jobj = json_object_new_string("disabled");
if (!jobj)
Emit the ACPI 6.1 defined DIMM identfier if available. # ndctl list -D -d nmem0 { "dev":"nmem0", "id":"cdab-ffffffff" } Cc: Toshi Kani <toshi.kani@hpe.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- util/json.c | 8 ++++++++ 1 file changed, 8 insertions(+)