[Stgt-devel] [PATCH] track target type

Pete Wyckoff pw
Sun Feb 25 01:21:52 CET 2007


Track target type (block, mmc, etc.).

Signed-off-by: Pete Wyckoff <pw at osc.edu>
---

 usr/target.c |    1 +
 usr/target.h |    1 +
 usr/tgtd.h   |    7 +++++++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/usr/target.c b/usr/target.c
index c8fc48c..c101b39 100644
--- a/usr/target.c
+++ b/usr/target.c
@@ -1253,6 +1253,7 @@ int tgt_target_create(int lld, int tid, char *args, int t_type, int bs_type)
 		target->bdt = tgt_drivers[lld]->default_bdt;
 	}
 
+	target->target_type = t_type;
 	target->target_state = SCSI_TARGET_RUNNING;
 	target->lid = lld;
 
diff --git a/usr/target.h b/usr/target.h
index 75d6518..aecee7c 100644
--- a/usr/target.h
+++ b/usr/target.h
@@ -40,6 +40,7 @@ struct target {
 	int lid;
 
 	enum scsi_target_iotype target_iotype;
+	enum scsi_target_type target_type;
 	enum scsi_target_state target_state;
 
 	struct list_head target_siblings;
diff --git a/usr/tgtd.h b/usr/tgtd.h
index 07224ce..eb9dd2e 100644
--- a/usr/tgtd.h
+++ b/usr/tgtd.h
@@ -21,6 +21,13 @@ enum scsi_target_iotype {
 	SCSI_TARGET_RAWIO,
 };
 
+enum scsi_target_type {
+	SCSI_TARGET_SBC, /* disk */
+	SCSI_TARGET_SSC, /* tape */
+	SCSI_TARGET_MMC, /* cdrom */
+	SCSI_TARGET_OSD, /* object storage device */
+};
+
 enum scsi_target_state {
 	SCSI_TARGET_SUSPENDED = 1,
 	SCSI_TARGET_RUNNING,



More information about the stgt mailing list