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

FUJITA Tomonori fujita.tomonori
Mon Apr 21 08:03:27 CEST 2008

Sorry for the delay.

On Tue, 15 Apr 2008 12:45:23 +1000
"ronnie sahlberg" <ronniesahlberg at gmail.com> wrote:

> On Tue, Apr 15, 2008 at 10:23 AM, FUJITA Tomonori
> <fujita.tomonori at lab.ntt.co.jp> wrote:
> >  Let me review the changes to the core first.
> >
> >  Once we agree on the changes to the core, please send them as separate
> >  patches. Then you can post mmc patches as you like, a single patch or
> >  multiple patches. I'm fine with either way.
> Great, thanks.
> Thinking about it, it might not be necessary to be able to create a
> LUN which lacks a backing store, so that part of my proposed patch
> it probably a mistake.
> The semantics in core and tgtadm that i think would be useful for
> devices such as MMC, and probably also SSC, that support
> removable/ejectable media would be
> 1, ability to administratively make LUNs online/offline. Such offline
> LUNs would still show up in report luns and be accessable, but the LUN
> when in offline
>     would behave as if there was no media loaded.
> 2, something similar to the two added lun methods :
> lu_online/lu_offline which are called when the online/offline
> attribute changes.
>    So that the lun emulation cna perform additional, commandset
> specific actions when the online attribute changes.
>    For MMC, I think online/offline would map very nicely to "media is
> inserted"/"no media loaded".
>    For MMC I think it would make sense to let the LUN close the
> backend file completely when the device goes offline and reopen it
> again
>    when the backend file goes online.   Thus
> offline/replacefile/online would be similar to eject tray/replace
> disk/close tray on a real physical device.
> I think that for SSC it would also make sense to have the emulation
> for this commandset also be informed/called on any/all changes on the
> online attribute
> in case SSC would want to map this and change its behaviour to map
> "tape is inserted"/"no tape loaded".
> Maybe there are better ways to implement this than lu_online/offline
> methods for the lun. Though, for removable media it would be nice if
> the offline/online cycle did close and reopen the backingstore file
> incase one wants to "swap the media" while the device is offline.

How about the following scheme?

- we add new hooks to device_type_template, online/offlne/reload.

- tgtadm can control the above methods.

- we let users to create a new logical unit without a backing-store
file. In this case, the logical unit is set to offline automatically.

- 'reload' method enables users to bind a new backing-store file to a
logical unit.

- 'reload' method works against only a offline logical unit (an online
logical unit could have outstanding commands and accept new commands).

- If offline logical units behaves as if there was no media loaded if
they are removable/ejectable media.

More information about the stgt mailing list