On Mon, Jan 3, 2022 at 12:11 PM <alison.schofi...@intel.com> wrote: > > From: Alison Schofield <alison.schofi...@intel.com> > > The command 'cxl set-partition-info' operates on a CXL memdev, > or a set of memdevs, allowing the user to change the partition > layout of the device. > > Synopsis: > Usage: cxl set-partition-info <mem0> [<mem1>..<memN>] [<options>] > > -v, --verbose turn on debug > -s, --volatile_size <n> > next volatile partition size in bytes > > The MAN page explains how to find partitioning capabilities and > restrictions. > > Signed-off-by: Alison Schofield <alison.schofi...@intel.com> [..] > diff --git a/cxl/memdev.c b/cxl/memdev.c > index 5ee38e5..fa63317 100644 > --- a/cxl/memdev.c > +++ b/cxl/memdev.c > @@ -6,6 +6,7 @@ > #include <unistd.h> > #include <limits.h> > #include <util/log.h> > +#include <util/size.h> > #include <util/filter.h> > #include <cxl/libcxl.h> > #include <util/parse-options.h> > @@ -23,6 +24,7 @@ static struct parameters { > unsigned len; > unsigned offset; > bool verbose; > + unsigned long long volatile_size;
This should be a string. See parse_size64() that handles suffixes like K,M,G,T, so you can do things like "cxl set-partition -s 256M" and behave like the other "--size" options in ndctl.