[PATCH 2/3] add state to tgt_driver, show LLDs and their states in system info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Added "state" field to "struct tgt_driver".
This state is displayed using "-m system -o show" for every registered LLD.

Signed-off-by: Alexander Nezhinsky <alexandern@xxxxxxxxxxxx>
---
 usr/mgmt.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/usr/mgmt.c b/usr/mgmt.c
index d8c398e..26a360d 100644
--- a/usr/mgmt.c
+++ b/usr/mgmt.c
@@ -387,8 +387,12 @@ static int tgt_mgmt(struct mgmt_task *mtask)
 		lld_no = 0;
 	else {
 		lld_no = get_driver_index(req->lld);
-		if (lld_no < 0) {
-			eprintf("can't find the driver\n");
+		if (lld_no < 0 || tgt_drivers[lld_no]->drv_state != DRIVER_INIT) {
+			if (lld_no < 0)
+				eprintf("can't find the driver %s\n", req->lld);
+			else
+				eprintf("driver %s is in state: %s\n",
+					req->lld, driver_state_name(tgt_drivers[lld_no]));
 			rsp->err = TGTADM_NO_DRIVER;
 			rsp->len = sizeof(*rsp);
 			return 0;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux