Tomo, Please find the patch re-attached with more verbose description. A MMC device without a backingstore is emulated as a drive with no disk/media inserted. Once a backingstore is added at later stage, this changes emulation to "disk is now inserted" ( Since SSC also support removable media, it may be useful to do the same for SSC. I do not know enough about the SSC emualtion to know if the SSC emulation supports "no backingstore == emulate tape drive with no tape loaded". If it doesnt, it might be worth adding at some stage. ) regards ronnie sahlberg On Wed, Jan 4, 2012 at 12:55 PM, FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> wrote: > On Sat, 24 Dec 2011 17:41:35 +1100 > ronnie sahlberg <ronniesahlberg@xxxxxxxxx> wrote: > >> From 33fa2ee29adfcaba5e89fcc6aecf737f4a2cfc38 Mon Sep 17 00:00:00 2001 >> From: Ronnie Sahlberg <ronniesahlberg@xxxxxxxxx> >> Date: Sat, 24 Dec 2011 13:02:06 +1100 >> Subject: [PATCH] TGTADM: Allow creating CD/DVD devices that do not have a backingstore >> >> >> Signed-off-by: Ronnie Sahlberg <ronniesahlberg@xxxxxxxxx> >> --- >> usr/tgtadm.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) > > Can you please resend this patch with the proper description? > > tgt works properly when an initioator accesses to an lu that doesn't > have backingstore, right? > > >> diff --git a/usr/tgtadm.c b/usr/tgtadm.c >> index 41e9e99..7dca0f8 100644 >> --- a/usr/tgtadm.c >> +++ b/usr/tgtadm.c >> @@ -779,7 +779,7 @@ int main(int argc, char **argv) >> "allowed/supported\n", rc); >> exit(EINVAL); >> } >> - if (!path) { >> + if (!path && dev_type != TYPE_MMC) { >> eprintf("'backing-store' option " >> "is necessary\n"); >> exit(EINVAL); >> -- >> 1.7.3.1 >>
Attachment:
0001-MMC-Allow-creating-MMC-LUNS-that-do-not-have-a-backi.patch.gz
Description: GNU Zip compressed data
From a30876ca22685805285692e1e969f6fc07f4a24b Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg <ronniesahlberg@xxxxxxxxx> Date: Thu, 5 Jan 2012 10:35:41 +1100 Subject: [PATCH] MMC: Allow creating MMC LUNS that do not have a backingstore. An MMC device without a backing store is emulated as an empty drive, with no media in it. TGTD will respond to all scsi i/o just like a scsi dved drive that does not have any media. As soon as a backing store is added at a later time, the TGTD emulation will switch to instead emulate a DVD drive with either a blank disk in the tray, that can be written to (if the file is zero-length) or as a DVD drive with a DVD-ROM disk in the tray (if the backing store is a .iso image) Being able to create DVD drives without any backing file is useful for when creating a jukebox. In that case it is most convenient to create the drive without any media loaded and then later use MTX to move media from astorage slot into the drive. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@xxxxxxxxx> --- usr/tgtadm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/usr/tgtadm.c b/usr/tgtadm.c index 41e9e99..7dca0f8 100644 --- a/usr/tgtadm.c +++ b/usr/tgtadm.c @@ -779,7 +779,7 @@ int main(int argc, char **argv) "allowed/supported\n", rc); exit(EINVAL); } - if (!path) { + if (!path && dev_type != TYPE_MMC) { eprintf("'backing-store' option " "is necessary\n"); exit(EINVAL); -- 1.7.3.1