diff mbox

ndctl, create-namespace: include dax info in operation result

Message ID 148849278046.1340.5376913871314870093.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit d3184f5a85fe
Headers show

Commit Message

Dan Williams March 2, 2017, 10:13 p.m. UTC
When modifying or creating a namespace in "dax" mode, include the
device-dax information so that resulting character device is included in
the output.

Before:
# ndctl create-namespace --reconfig=namespace1.0 --mode=dax --force
{
  "dev":"namespace1.0",
  "mode":"dax",
  "size":4225761280,
  "uuid":"55082055-70f8-40eb-b131-d59f6f537df5"
}

After:
# ndctl create-namespace --reconfig=namespace1.0 --mode=dax --force
{
  "dev":"namespace1.0",
  "mode":"dax",
  "size":4225761280,
  "uuid":"1ccc310a-04af-4a57-88a4-6011c2825b95",
  "daxregion":{
    "id":1,
    "size":4225761280,
    "align":2097152,
    "devices":[
      {
        "chardev":"dax1.0",
        "size":4225761280
      }
    ]
  }
}

Reported-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 ndctl/builtin-xaction-namespace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/ndctl/builtin-xaction-namespace.c b/ndctl/builtin-xaction-namespace.c
index 46d651e86153..05575c50446d 100644
--- a/ndctl/builtin-xaction-namespace.c
+++ b/ndctl/builtin-xaction-namespace.c
@@ -361,7 +361,7 @@  static int setup_namespace(struct ndctl_region *region,
 		error("%s: failed to enable\n",
 				ndctl_namespace_get_devname(ndns));
 	} else {
-		struct json_object *jndns = util_namespace_to_json(ndns, 0, 0);
+		struct json_object *jndns = util_namespace_to_json(ndns, 0, 1);
 
 		if (jndns)
 			printf("%s\n", json_object_to_json_string_ext(jndns,