From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH] ndctl, util: add a raw_uuid field to namespace listings
Date: Mon, 16 Apr 2018 21:47:46 +0000 [thread overview]
Message-ID: <1523915264.2552.7.camel@intel.com> (raw)
In-Reply-To: <CAPcyv4gWkF0cTCVH1_BNw8287Z_p-ObFS7jM7HUwzXb91xBM3Q@mail.gmail.com>
On Mon, 2018-04-16 at 14:41 -0700, Dan Williams wrote:
> On Mon, Apr 16, 2018 at 2:27 PM, Vishal Verma <vishal.l.verma@intel.com>
> wrote:
> > For boot support efibootmgr needs to be able to lookup up the raw
> > namespace uuid to match the device-path that EFI emits. By default
> > 'ndctl list' displays the uuid that is present in the address
> > abstraction info-block. Add a "raw_uuid" so that tooling can
> > correlate the default uuid with the base uuid for the namespace.
> >
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> > ---
> > util/json.c | 23 +++++++++++++++++++++++
> > 1 file changed, 23 insertions(+)
> >
> > diff --git a/util/json.c b/util/json.c
> > index 8d65525..efad8f7 100644
> > --- a/util/json.c
> > +++ b/util/json.c
> > @@ -650,6 +650,17 @@ static struct json_object
> > *util_dax_badblocks_to_json(struct ndctl_dax *dax,
> > bb_count, flags);
> > }
> >
> > +static struct json_object *util_raw_uuid(struct ndctl_namespace *ndns)
> > +{
> > + struct json_object *jobj;
> > + uuid_t raw_uuid;
> > + char buf[40];
> > +
> > + ndctl_namespace_get_uuid(ndns, raw_uuid);
> > + uuid_unparse(raw_uuid, buf);
> > + return json_object_new_string(buf);
> > +}
> > +
>
> I don't mind this new helper, but it seems out of place given all the
> other uuid-to-json-string conversions are open-coded in
> util_namespace_to_json(). Let's just open-code like all the rest, and
> maybe follow on with a global cleanup to use a helper in a later
> patch. However, I'm not sure it will be worth it / a net code
> reduction.
Sure - the others were calling ndctl_{btt,pfn,dax}_get_uuid, where as with
this, all the instances call ndctl namespace_get_uuid hence I factored it
out as a function, but I'm happy to open code it in the three sites.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next prev parent reply other threads:[~2018-04-16 21:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 21:27 [ndctl PATCH] ndctl, util: add a raw_uuid field to namespace listings Vishal Verma
2018-04-16 21:41 ` Dan Williams
2018-04-16 21:47 ` Verma, Vishal L [this message]
2018-04-16 21:49 ` Dan Williams
2018-04-16 21:50 ` 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=1523915264.2552.7.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=dan.j.williams@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.