On Thu, Jan 06, 2022 at 02:19:08PM -0800, Dan Williams wrote:
> On Mon, Jan 3, 2022 at 12:11 PM <[email protected]> wrote:
> >
snip
>
> One of the conventions from ndctl is that any command that modifies an
> object should also emit the updated state of that object in JSON. For
> example, "ndctl reconfigure-namespace" arranges for:
>
> unsigned long flags = UTIL_JSON_DAX | UTIL_JSON_DAX_DEVS;
> struct json_object *jndns;
>
> if (isatty(1))
> flags |= UTIL_JSON_HUMAN;
> jndns = util_namespace_to_json(ndns, flags);
> if (jndns)
> printf("%s\n", json_object_to_json_string_ext(jndns,
> JSON_C_TO_STRING_PRETTY));
>
> ...to dump the updated state of the namespace, so a similar
> util_memdev_to_json() seems appropriate here. However, perhaps that
> can come later. I have work-in-progress patches to move the core of
> cxl/list.c to a cxl_filter_walk() helper that would allow you to just
> call that to dump a listing for all the memdevs that were passed on
> the command line.
Will add. Thanks!