[ndctl,2/2] libdaxctl: point to migrate-device-model for dax-class errors
diff mbox series

Message ID 20190822203635.17926-2-vishal.l.verma@intel.com
State Accepted
Commit 99cdc729a269ea1323fdf44eaac80a6868d198da
Headers show
Series
  • [ndctl,1/2] ndctl/check-namespace: improve error message in absence of a BTT
Related show

Commit Message

Verma, Vishal L Aug. 22, 2019, 8:36 p.m. UTC
When a dax-bus vs. dax-class expectation causes a failure, such as when
reconfiguring device modes, print an error message directly pointing the
user to the daxctl-migrate-device-model command.

Reported-by: Dave Hansen <dave.hansen@linux.intel.com>
Reported-by: Jeff Moyer <jmoyer@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 daxctl/lib/libdaxctl.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jeff Moyer Aug. 22, 2019, 8:41 p.m. UTC | #1
Vishal Verma <vishal.l.verma@intel.com> writes:

> When a dax-bus vs. dax-class expectation causes a failure, such as when
> reconfiguring device modes, print an error message directly pointing the
> user to the daxctl-migrate-device-model command.
>
> Reported-by: Dave Hansen <dave.hansen@linux.intel.com>
> Reported-by: Jeff Moyer <jmoyer@redhat.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>  daxctl/lib/libdaxctl.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
> index 44842b9..c0a859c 100644
> --- a/daxctl/lib/libdaxctl.c
> +++ b/daxctl/lib/libdaxctl.c
> @@ -917,6 +917,7 @@ static int daxctl_dev_enable(struct daxctl_dev *dev, enum daxctl_dev_mode mode)
>  
>  	if (!device_model_is_dax_bus(dev)) {
>  		err(ctx, "%s: error: device model is dax-class\n", devname);
> +		err(ctx, "%s: see man daxctl-migrate-device-model\n", devname);
>  		return -EOPNOTSUPP;
>  	}
>  
> @@ -962,6 +963,7 @@ DAXCTL_EXPORT int daxctl_dev_disable(struct daxctl_dev *dev)
>  
>  	if (!device_model_is_dax_bus(dev)) {
>  		err(ctx, "%s: error: device model is dax-class\n", devname);
> +		err(ctx, "%s: see man daxctl-migrate-device-model\n", devname);
>  		return -EOPNOTSUPP;
>  	}

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

Thanks, Vishal!

Patch
diff mbox series

diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
index 44842b9..c0a859c 100644
--- a/daxctl/lib/libdaxctl.c
+++ b/daxctl/lib/libdaxctl.c
@@ -917,6 +917,7 @@  static int daxctl_dev_enable(struct daxctl_dev *dev, enum daxctl_dev_mode mode)
 
 	if (!device_model_is_dax_bus(dev)) {
 		err(ctx, "%s: error: device model is dax-class\n", devname);
+		err(ctx, "%s: see man daxctl-migrate-device-model\n", devname);
 		return -EOPNOTSUPP;
 	}
 
@@ -962,6 +963,7 @@  DAXCTL_EXPORT int daxctl_dev_disable(struct daxctl_dev *dev)
 
 	if (!device_model_is_dax_bus(dev)) {
 		err(ctx, "%s: error: device model is dax-class\n", devname);
+		err(ctx, "%s: see man daxctl-migrate-device-model\n", devname);
 		return -EOPNOTSUPP;
 	}