Hi Dan,

I don't see any failure even apply my patch.
What failure do you observe?

make --no-print-directory check-TESTS
PASS: libndctl
PASS: dsm-fail
PASS: dpa-alloc
PASS: parent-uuid
PASS: multi-pmem
PASS: create.sh
PASS: clear.sh
PASS: pmem-errors.sh
PASS: daxdev-errors.sh
PASS: multi-dax.sh
PASS: btt-check.sh
PASS: label-compat.sh
PASS: blk-exhaust.sh
PASS: sector-mode.sh
PASS: inject-error.sh
PASS: btt-errors.sh
PASS: hugetlb
PASS: btt-pad-compat.sh
PASS: firmware-update.sh
PASS: ack-shutdown-count-set
PASS: rescan-partitions.sh
PASS: inject-smart.sh
PASS: monitor.sh
PASS: max_available_extent_ns.sh
PASS: pfn-meta-errors.sh
============================================================================
Testsuite summary for ndctl 67.dirty
============================================================================
# TOTAL: 25
# PASS:  25
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================

Thanks,

-----Original Message-----
From: Dan Williams <[email protected]>
Sent: Wednesday, December 4, 2019 10:43 AM
To: Li, Redhairer <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] daxctl: Change region input type from INTEGER to STRING.

Nice! You got mail working!

On Tue, Dec 3, 2019 at 6:33 PM Li, Redhairer <[email protected]> wrote:
>
> Allow daxctl to accept both <region-id>, and region name as region parameter.
> For example:
>
>     daxctl list -r region5
>     daxctl list -r 5
>
> Link: https://github.com/pmem/ndctl/issues/109
> Signed-off-by: Redhairer Li <[email protected]>
> ---
>  daxctl/device.c | 11 ++++-------
>  daxctl/list.c   | 14 ++++++--------
>  util/filter.c   | 16 ++++++++++++++++
>  util/filter.h   |  2 ++
>  4 files changed, 28 insertions(+), 15 deletions(-)
>
> diff --git a/daxctl/device.c b/daxctl/device.c index 72e506e..d9db2f9
> 100644
> --- a/daxctl/device.c
> +++ b/daxctl/device.c
> @@ -19,15 +19,13 @@
>  static struct {
>         const char *dev;
>         const char *mode;
> -       int region_id;
> +       const char *region;
>         bool no_online;
>         bool no_movable;
>         bool force;
>         bool human;
>         bool verbose;
> -} param = {
> -       .region_id = -1,
> -};
> +} param;
>
>  enum dev_mode {
>         DAXCTL_DEV_MODE_UNKNOWN,
> @@ -51,7 +49,7 @@ enum device_action {  };
>
>  #define BASE_OPTIONS() \
> -OPT_INTEGER('r', "region", &param.region_id, "restrict to the given
> region"), \
> +OPT_STRING('r', "region", &param.region, "region-id", "filter by
> +region"), \
>  OPT_BOOLEAN('u', "human", &param.human, "use human friendly number
> formats"), \  OPT_BOOLEAN('v', "verbose", &param.verbose, "emit more
> debug messages")
>
> @@ -484,8 +482,7 @@ static int do_xaction_device(const char *device, enum 
> device_action action,
>         *processed = 0;
>
>         daxctl_region_foreach(ctx, region) {
> -               if (param.region_id >= 0 && param.region_id
> -                               != daxctl_region_get_id(region))
> +               if (!util_daxctl_region_filter(region, device))
>                         continue;

There's a bug here, can you spot it?

This causes:

     make TESTS=daxctl-devices.sh check

...to fail.
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to