On 4/11/07, FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp> wrote: > From: "Mark Harvey" <markh794 at gmail.com> > Subject: [Stgt-devel] vtl patch. > Date: Thu, 5 Apr 2007 09:56:10 +1000 > > > Apologies for this being an attachment. It is rather large to include > > inline (57k). > > > > Follow up to feedback from earlier postings, I have implemented the following: > > > > > > This patch includes the following changes. > > > > - Patch to tgtadm so multiple '--name, --value' arguments can be passed. > > Why do we need multiple arguments? > > I prefer to keep the current semantics: > > $ tgtadm --lld iscsi --mode logicalunit --op update --tid=1 --lun=0 \ > -n VendorIdent -v QUANTUM > $ tgtadm --lld iscsi --mode logicalunit --op update --tid=1 --lun=0 \ > -n ProductIdent -v SDLT600 > $ tgtadm --lld iscsi --mode logicalunit --op update --tid=1 --lun=0 \ > -n ProductRev -v 0001 > $ tgtadm --lld iscsi --mode logicalunit --op update --tid=1 --lun=0 \ > -n SerialNumber -v XYZZY10 > > rather than: > > tgtadm --lld iscsi --mode logicalunit --op update --tid=1 --lun=0 \ > -n VendorIdent -v QUANTUM \ > -n ProductIdent -v SDLT600 \ > -n ProductRev -v 0001 \ > -n SerialNumber -v XYZZY10 > > > The rest looks ok. > Thanks for the feedback. While setting the Vendor Ident etc can be easly acheived one field at a time, configuring the parameters for the SMC device requires multiple parameters at the same time. e.g. > (Reserve address space for storage slots) > --name=ElementType --value=[1|2|3] > --name=StartAddress --value=number > --name=Quanity --value=number > --name=Sides --value=[1|2] (Single/double sided) I need to get the element type, starting address and number of slots and if media is single/double sided (or at minimum, the element type and the element address - if configuring a slot per instance of tgtcmd) > (To reserve address space for 'drives') > --name=ElementType --value=4 > --name=StartAddress --value=number > --name=Quanity --value=number > --name=Type --value="ssc|mmc|sbc" Again for slots which contain Data Transfer Elements, the element type, slot number, type of 'data transfer element' needs to be passed in 'one go' Same basic argument for the two other configuration options below.. > (To 'tie' a previously known TID/LUN to a slot Address..) > --name=ElementType --value=4 > --name=Address --value=<Within Range from above> > --name=tid --value=<tid> > --name=lun --value=<lun> > --name=SerialNumber --value-<Device S/No> > To 'populate' slots with 'media' > --name=ElementType --value=[2|3] > --name=Address --value=<slot number> > --name=BarCode --value="string" The only other way I can see to acheive this would be to create unique options within tgtadm. The number of unique options within tgtadm is already quite long, hence I followed the '--name=<> --value=<>' option. Cheers Mark |