[stgt] strange problem vSphere vCLI and stgt
frederik.vos at linvirt.nl
frederik.vos at linvirt.nl
Mon Mar 21 14:32:52 CET 2011
patching file usr/Makefile
Hunk #1 FAILED at 53.
1 out of 1 hunk FAILED -- saving rejects to file usr/Makefile.rej
patching file usr/list.h
Hunk #1 succeeded at 32 with fuzz 2.
patching file usr/nolun.c
patching file usr/spc.c
Hunk #1 FAILED at 270.
Hunk #2 succeeded at 1590 with fuzz 2.
1 out of 2 hunks FAILED -- saving rejects to file usr/spc.c.rej
patching file usr/spc.h
patching file usr/target.c
Hunk #1 FAILED at 510.
Hunk #2 FAILED at 675.
Hunk #3 FAILED at 934.
Hunk #4 FAILED at 1767.
Hunk #5 FAILED at 1794.
Hunk #6 FAILED at 1911.
Hunk #7 FAILED at 1938.
7 out of 7 hunks FAILED -- saving rejects to file usr/target.c.rej
patching file usr/target.h
Hunk #1 succeeded at 8 with fuzz 2.
-------------- next part --------------
--- Makefile
+++ Makefile
@@ -53,7 +53,7 @@
PROGRAMS += tgtd tgtadm tgtimg
TGTD_OBJS += tgtd.o mgmt.o target.o scsi.o log.o driver.o util.o work.o \
- parser.o spc.o sbc.o mmc.o osd.o scc.o smc.o \
+ parser.o spc.o sbc.o mmc.o nolun.o osd.o scc.o smc.o \
ssc.o bs_ssc.o libssc.o \
bs_null.o bs_sg.o bs.o libcrc32c.o
-------------- next part --------------
--- usr/spc.c
+++ usr/spc.c
@@ -270,6 +270,8 @@
nr_luns = 0;
list_for_each_entry(lu, dev_list, device_siblings) {
+ if (lu->lun == TGT_SHADOW_LUN)
+ continue;
nr_luns++;
if (!alen)
-------------- next part --------------
--- usr/target.c
+++ usr/target.c
@@ -510,7 +510,10 @@
goto out;
}
- bst = target->bst;
+ bst = (lun == TGT_SHADOW_LUN) ?
+ get_backingstore_template("null") :
+ target->bst;
+
if (backing) {
if (bstype) {
bst = get_backingstore_template(bstype);
@@ -675,10 +678,6 @@
dprintf("%u %" PRIu64 "\n", tid, lun);
- /* lun0 is special */
- if (!lun && !force)
- return TGTADM_INVALID_REQUEST;
-
lu = __device_lookup(tid, lun, &target);
if (!lu) {
eprintf("device %" PRIu64 " not found\n", lun);
@@ -934,11 +933,11 @@
cmd->dev_id = dev_id;
dprintf("%p %x %" PRIx64 "\n", cmd, cmd->scb[0], dev_id);
cmd->dev = device_lookup(target, dev_id);
- /* use LUN0 */
+ /* use TGT_SHADOW_LUN */
if (!cmd->dev)
- cmd->dev = list_first_entry(&target->device_list,
- struct scsi_lu,
- device_siblings);
+ cmd->dev = list_last_entry(&target->device_list,
+ struct scsi_lu,
+ device_siblings);
cmd->itn_lu_info = it_nexus_lu_info_lookup(itn, cmd->dev->lun);
@@ -1767,7 +1766,9 @@
}
shprintf(total, buf, rest, _TAB1 "LUN information:\n");
- list_for_each_entry(lu, &target->device_list, device_siblings)
+ list_for_each_entry(lu, &target->device_list, device_siblings) {
+ if (lu->lun == TGT_SHADOW_LUN)
+ continue;
shprintf(total, buf, rest,
_TAB2 "LUN: %" PRIu64 "\n"
_TAB3 "Type: %s\n"
@@ -1794,6 +1795,7 @@
"None",
lu->path ? : "None",
open_flags_to_str(strflags, lu->bsoflags));
+ }
if (!strcmp(tgt_drivers[target->lid]->name, "iscsi") ||
!strcmp(tgt_drivers[target->lid]->name, "iser")) {
@@ -1911,7 +1913,7 @@
INIT_LIST_HEAD(&target->acl_list);
INIT_LIST_HEAD(&target->it_nexus_list);
- tgt_device_create(tid, TYPE_RAID, 0, NULL, 0);
+ tgt_device_create(tid, TYPE_NO_LUN, TGT_SHADOW_LUN, NULL, 0);
if (tgt_drivers[lld]->target_create)
tgt_drivers[lld]->target_create(target);
@@ -1938,8 +1940,8 @@
}
while (!list_empty(&target->device_list)) {
- /* we remove lun0 last */
- lu = list_entry(target->device_list.prev, struct scsi_lu,
+ /* we remove TGT_SHADOW_LUN last */
+ lu = list_entry(target->device_list.next, struct scsi_lu,
device_siblings);
ret = tgt_device_destroy(tid, lu->lun, 1);
if (ret)
More information about the stgt
mailing list