[stgt] Bug report, target offline / online

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Tue May 5 17:53:01 CEST 2009


On Fri, 01 May 2009 19:48:24 +0200
Albert Pauw <albert.pauw at gmail.com> wrote:

> The initd sample script contains the following:
> 
>     tgtadm --op update --mode sys --name State -v offline
>     # Configure the targets.
>     tgt-admin -e -c $TGTD_CONFIG
>     # Put tgtd into "ready" state.
>     tgtadm --op update --mode sys --name State -v ready
> 
> 
> However, the offline/ready stuff comes back with "tgtadm: invalid request".

I'm not sure about what tgt-admin does, but the above tgtadm ops work
for me:

root at lily:~/git/tgt# ./usr/tgtadm --op update --mode sys --name State -v offline

root at lily:~/git/tgt# ./usr/tgtadm --op show --mode sys
System:
    State: offline
iSNS:
    iSNS=Off
    iSNSServerIP=
    iSNSServerPort=3205
    iSNSAccessControl=Off
root at lily:~/git/tgt# ./usr/tgtadm --op update --mode sys --name State -v ready
root at lily:~/git/tgt# ./usr/tgtadm --op show --mode sys
System:
    State: ready
iSNS:
    iSNS=Off
    iSNSServerIP=
    iSNSServerPort=3205
    iSNSAccessControl=Off



> The line from the README files to do this:
> 
> [root at orange doc]# tgtadm --tid 1 --lun 1 --op update --mode logicalunit 
> --name online --value No
> 
> Comes back with the following error:
> 
> tgtadm: option '-n' not supported in logicalunit mode

This should work. Here's a patch to fix a tgtadm bug:


diff --git a/usr/tgtadm.c b/usr/tgtadm.c
index 71d7fc5..f895439 100644
--- a/usr/tgtadm.c
+++ b/usr/tgtadm.c
@@ -688,7 +688,7 @@ int main(int argc, char **argv)
 			}
 			break;
 		case OP_UPDATE:
-			rc = verify_mode_params(argc, argv, "LmotlP");
+			rc = verify_mode_params(argc, argv, "LmotlPnv");
 			if (rc) {
 				eprintf("option '-%c' not supported in "
 					"logicalunit mode\n", rc);

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list