@@ -278,7 +278,7 @@ struct json_object *util_daxctl_dev_to_json(struct daxctl_dev *dev,
struct daxctl_memory *mem = daxctl_dev_get_memory(dev);
const char *devname = daxctl_dev_get_devname(dev);
struct json_object *jdev, *jobj;
- int node, movable;
+ int node, movable, align;
jdev = json_object_new_object();
if (!devname || !jdev)
@@ -299,6 +299,13 @@ struct json_object *util_daxctl_dev_to_json(struct daxctl_dev *dev,
json_object_object_add(jdev, "target_node", jobj);
}
+ align = daxctl_dev_get_align(dev);
+ if (align > 0) {
+ jobj = util_json_object_size(daxctl_dev_get_align(dev), flags);
+ if (jobj)
+ json_object_object_add(jdev, "align", jobj);
+ }
+
if (mem)
jobj = json_object_new_string("system-ram");
else
Fetch device align and include it on listings. Signed-off-by: Joao Martins <joao.m.martins@oracle.com> --- util/json.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)