All of lore.kernel.org
 help / color / mirror / Atom feed
* [Accel-config] [PATCH v1 4/6] accel-config: Add check for mdev support availability in commands
@ 2021-01-23  5:35 ramesh.thomas
  0 siblings, 0 replies; only message in thread
From: ramesh.thomas @ 2021-01-23  5:35 UTC (permalink / raw)
  To: accel-config

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]

From: Ramesh Thomas <ramesh.thomas(a)intel.com>

Add check for mdev support availability in mdev commands and exit
with error message if support is not available.

Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
---
 accfg/mdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/accfg/mdev.c b/accfg/mdev.c
index 652b734..3bde7eb 100644
--- a/accfg/mdev.c
+++ b/accfg/mdev.c
@@ -90,6 +90,11 @@ int cmd_create_mdev(int argc, const char **argv, void *ctx)
 		usage_with_options(u, options);
 	}
 
+	if (!accfg_device_get_mdev_enabled(device)) {
+		fprintf(stderr, "mdev support not available\n");
+		return 0;
+	}
+
 	argc = parse_options(argc, argv, options, u, 0);
 	if (opt_called)
 		return 0;
@@ -138,6 +143,11 @@ int cmd_remove_mdev(int argc, const char **argv, void *ctx)
 		usage_with_options(u, options);
 	}
 
+	if (!accfg_device_get_mdev_enabled(device)) {
+		fprintf(stderr, "mdev support not available\n");
+		return 0;
+	}
+
 	argc = parse_options(argc, argv, options, u, 0);
 	if (opt_called)
 		return 0;
-- 
2.26.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-23  5:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-23  5:35 [Accel-config] [PATCH v1 4/6] accel-config: Add check for mdev support availability in commands ramesh.thomas

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.