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 <[email protected]>
---
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
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to