[PATCH 3/3] add state to tgt_driver, prevent mgt ops for uninitialized LLDs

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

 



Added "state" field to "struct tgt_driver".
Management operations are allowed only for LLDs that have
passed initialization successfully.

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

diff --git a/usr/target.c b/usr/target.c
index e621b59..8c6472b 100644
--- a/usr/target.c
+++ b/usr/target.c
@@ -2101,6 +2101,7 @@ int system_set_state(char *str)
 int system_show(int mode, char *buf, int rest)
 {
 	int total = 0, max = rest;
+	int i;
/* FIXME: too hacky */
 	if (mode != MODE_SYSTEM)
@@ -2110,6 +2111,13 @@ int system_show(int mode, char *buf, int rest)
 	shprintf(total, buf, rest, _TAB1 "State: %s\n",
 		 system_state_name(sys_state));
+ shprintf(total, buf, rest, "LLDs:\n");
+	for (i = 0; tgt_drivers[i]; i++) {
+		shprintf(total, buf, rest, _TAB1 "%s: %s\n",
+			 tgt_drivers[i]->name,
+			 driver_state_name(tgt_drivers[i]));
+	}
+
 	if (global_target.account.nr_inaccount) {
 		int i, aid;
 		shprintf(total, buf, rest,
--
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