Linux-NVDIMM Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver O'Halloran <oohall@gmail.com>
To: linux-nvdimm@lists.01.org
Subject: [PATCH v5 6/7] ndctl/namespace: Make the create-region JSON output non-verbose
Date: Wed, 30 Jan 2019 21:59:26 +1100	[thread overview]
Message-ID: <20190130105927.31901-6-oohall@gmail.com> (raw)
In-Reply-To: <20190130105927.31901-1-oohall@gmail.com>

The ndctl unit tests parse the output of the create-region commands using a
pile of regexs which makes adding new fields to create-namespace output
blob a somewhat fraught activity. By moving the existing "verbose" fields
into the normal output we keep the unit tests happy and allow ourselves to
add more fields in the future.

This patch also makes the 'sector_size' field non-verbose since the BTT
unit tests require it.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
Ccurrently `ndctl list` has the -v flag to make the output more verbose,
however every other ndctl command uses -v as a switch to enable debug
output. We probably don't want to change the CLI much, but considering
debug output requires running configure with --enable-debug it might be
a good idea to change it to -d or something and free up the switch for
actual verbosity.
---
---
 ndctl/namespace.c | 2 +-
 util/json.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index 25e0a87676e4..03d805a69ce4 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -424,7 +424,7 @@ static int setup_namespace(struct ndctl_region *region,
 		error("%s: failed to enable\n",
 				ndctl_namespace_get_devname(ndns));
 	} else {
-		unsigned long flags = UTIL_JSON_DAX | UTIL_JSON_DAX_DEVS | UTIL_JSON_VERBOSE;
+		unsigned long flags = UTIL_JSON_DAX | UTIL_JSON_DAX_DEVS;
 		struct json_object *jndns;
 
 		if (isatty(1))
diff --git a/util/json.c b/util/json.c
index 77c96fb53c27..eee459aa453b 100644
--- a/util/json.c
+++ b/util/json.c
@@ -893,7 +893,7 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
 	 * happens because they use pre-v1.2 labels or because they
 	 * don't have a label space (devtype=nd_namespace_io).
 	 */
-	if (sector_size < UINT_MAX && flags & UTIL_JSON_VERBOSE) {
+	if (sector_size < UINT_MAX) {
 		jobj = json_object_new_int(sector_size);
 		if (!jobj)
 			goto err;
-- 
2.20.1

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  parent reply	other threads:[~2019-01-30 10:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 10:59 [PATCH v5 1/7] libndctl: Use the supported_alignment attribute Oliver O'Halloran
2019-01-30 10:59 ` [PATCH v5 2/7] ndctl/namespace: Check for seed namespaces earlier Oliver O'Halloran
2019-01-30 10:59 ` [PATCH v5 3/7] ndctl/namespace: Use seed alignment as the default Oliver O'Halloran
2019-01-30 10:59 ` [PATCH v5 4/7] ndctl/namespace: Validate alignment from the {pfn|dax} seed Oliver O'Halloran
2019-01-30 10:59 ` [PATCH v5 5/7] ndctl: Add alignment to the namespace JSON output Oliver O'Halloran
2019-01-30 10:59 ` Oliver O'Halloran [this message]
2019-01-30 10:59 ` [PATCH v5 7/7] ndctl: Add supported_alignments to the " Oliver O'Halloran
2019-01-30 23:20 ` [PATCH v5 1/7] libndctl: Use the supported_alignment attribute Verma, Vishal L
2019-03-06  6:32 ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190130105927.31901-6-oohall@gmail.com \
    --to=oohall@gmail.com \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox