[Stgt-devel] [PATCH 4/4] OSD command parser

FUJITA Tomonori fujita.tomonori
Sun Mar 4 16:12:57 CET 2007


From: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
Subject: Re: [Stgt-devel] [PATCH 4/4] OSD command parser
Date: Mon, 19 Feb 2007 23:32:59 +0900

> From: Pete Wyckoff <pw at osc.edu>
> Subject: Re: [Stgt-devel] [PATCH 4/4] OSD command parser
> Date: Tue, 23 Jan 2007 11:19:17 -0500
> 
> > blackmagic02881 at gmail.com wrote on Mon, 22 Jan 2007 14:35 -0500:
> > > not a good idea. suggest to keep in a way like IET code, for each target
> > > type, call its foo_cmd_perform(), and make some common spc function as
> > > helper functions.
> > 
> > I think you're saying that I should duplicate the switch() logic for
> > the SPC commands in all the (osd|sbc|mmc|...)_cmd_perfom()
> > type-specific functions.  This would reduce scsi_cmd_perform() into
> > just a check on the target type, with no handling of SPC commands,
> > e.g. INQUIRY.
> > 
> > I'm not opposed to doing that, just don't have a good reason to do
> > so.  As the OSD work progresses this may become clear to me (PERFORM
> > SCSI COMMAND and PERFORM TASK MANAGEMENT FUNCTION).
> 
> Very sorry for taking so long.
> 
> I put a patch to support various device types:
> 
> http://zaal.org/tgt/device-types.diff
> 
> 
> I don't merge it because:
> 
> - only iscsi + AIO works (sg and ibmvio are broken).
> 
> - there are still lots of things to implement
> 
> - huge cleanup is necessary

I've merged it though there are still many things to clean up.

I added the virtual cd patch that Ming wrote for IET as an
example. You can export iso files as a cd drive. An initiator can see
a cd drive, but it can't read the iso file. So there must be bugs,
however I've not dig into it. Patches are welcome :)

You can export iso files in the following way:

tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2001-04.com.example:storage.disk2.tulip.sys1.xyz --target-type cd
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 0 -b /home/fujita/debian-31r5-i386-businesscard.iso
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL


Pete, I found that you don't put a license in osd.c. GPL2 or GPL2 or
any later version? Let me know. I'll update and merge it.


I added sgv3 pass through support. By default, tgt is compiled with
sgv3 support instead of sgv4.

tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2001-04.com.example:storage.disk2.tulip.sys1.xyz --target-type pt
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 0 -b /dev/sg0
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

Note that I'll change the interface not to use /dev/sgX directly.

I can export a disk drive with sgv3 support. But it doesn't work
fully. I'll fix it someday, but the next thing I'll do is adding
bi-directional support.



More information about the stgt mailing list