From patchwork Thu Mar 2 22:13:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 9601721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A2B2F6048B for ; Thu, 2 Mar 2017 22:18:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A89C285FC for ; Thu, 2 Mar 2017 22:18:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F3FA285FF; Thu, 2 Mar 2017 22:18:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0FBBD285FC for ; Thu, 2 Mar 2017 22:18:13 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3C93B821F9; Thu, 2 Mar 2017 14:18:13 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1D78A821F5 for ; Thu, 2 Mar 2017 14:18:12 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2017 14:18:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,233,1484035200"; d="scan'208";a="231651905" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.125]) by fmsmga004.fm.intel.com with ESMTP; 02 Mar 2017 14:18:11 -0800 Subject: [PATCH] ndctl, create-namespace: include dax info in operation result From: Dan Williams To: linux-nvdimm@lists.01.org Date: Thu, 02 Mar 2017 14:13:00 -0800 Message-ID: <148849278046.1340.5376913871314870093.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Dan Williams --- ndctl/builtin-xaction-namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,