[Stgt-devel] Prototype MMC DVD-ROM and burnable DVD+R implementation

FUJITA Tomonori tomof
Sat Apr 26 10:09:42 CEST 2008


From: "ronnie sahlberg" <ronniesahlberg at gmail.com>
Subject: Re: [Stgt-devel] Prototype MMC DVD-ROM and burnable DVD+R	implementation
Date: Mon, 21 Apr 2008 16:15:23 +1000

> Thanks for looking at this.
> 
> Your plan sounds great to me. Once implemented, Ill modify the mmc
> emulation to hook into the new methods in
> the template.

You can create a new logical unit without a backing store file:

tgtadm --op new --mode target --tid 1 -T iqn.2001-04.com.example:storage.disk2.iris.sys1.xyz
tgtadm --op new --mode logicalunit --tid 1 --lun 1 -Y cd
tgtadm --op bind --mode target --tid 1 -I ALL

root at iris:~/git# ./tgt/usr/tgtadm --op show --mode target
Target 1: iqn.2001-04.com.example:storage.disk2.iris.sys1.xyz
    System information:
        Driver: iscsi
        Status: running
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: deadbeaf1:0
            SCSI SN: beaf10
            Size: 0 MB
            Online: No
            Removable media: No
            Backing store: No backing store
        LUN: 1
            Type: cd/dvd
            SCSI ID: deadbeaf1:1
            SCSI SN: beaf11
            Size: 0 MB
            Online: No
            Removable media: Yes
            Backing store: No backing store
    Account information:
    ACL information:
        ALL

You can update the backing store file:

tgtadm --tid 1 --lun 1 --op update --mode logicalunit --name path --value /var/tmp/debian-40r1-amd64-netinst.iso

root at iris:~/git# ./tgt/usr/tgtadm --op show --mode target
Target 1: iqn.2001-04.com.example:storage.disk2.iris.sys1.xyz
    System information:
        Driver: iscsi
        Status: running
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: deadbeaf1:0
            SCSI SN: beaf10
            Size: 0 MB
            Online: No
            Removable media: No
            Backing store: No backing store
        LUN: 1
            Type: cd/dvd
            SCSI ID: deadbeaf1:1
            SCSI SN: beaf11
            Size: 156 MB
            Online: Yes
            Removable media: Yes
            Backing store: /var/tmp/debian-40r1-amd64-netinst.iso
    Account information:
    ACL information:
        ALL

You can replace the backing store file with new one:

tgtadm --tid 1 --lun 1 --op update --mode logicalunit --name online --value No
tgtadm --tid 1 --lun 1 --op update --mode logicalunit --name path --value /var/tmp/debian-40r1-sparc-netinst.iso

root at iris:~/git# ./tgt/usr/tgtadm --op show --mode target
Target 1: iqn.2001-04.com.example:storage.disk2.iris.sys1.xyz
    System information:
        Driver: iscsi
        Status: running
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: deadbeaf1:0
            SCSI SN: beaf10
            Size: 0 MB
            Online: No
            Removable media: No
            Backing store: No backing store
        LUN: 1
            Type: cd/dvd
            SCSI ID: deadbeaf1:1
            SCSI SN: beaf11
            Size: 148 MB
            Online: Yes
            Removable media: Yes
            Backing store: /var/tmp/debian-40r1-sparc-netinst.iso
    Account information:
    ACL information:
        ALL


I've not implemented this feature fully yet. If you replace a backing
store while the logical unit has outstanding commands, tgtd
crashes. But it would be good enough for you to see how new code works
well with your mmc emulation code, I think.


Yeah, again, I know that tgt's user interface is pretty inconsistent
so I'll clean up it.



More information about the stgt mailing list