[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/15] iscsi: send readcapacity10 when readcapacity16
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 07/15] iscsi: send readcapacity10 when readcapacity16 failed |
Date: |
Fri, 15 Jan 2016 17:04:23 +0100 |
From: Zhu Lingshan <address@hidden>
When play with Dell MD3000 target, for sure it
is a TYPE_DISK, but readcapacity16 would fail.
Then we find that readcapacity10 succeeded. It
looks like the target just support readcapacity10
even through it is a TYPE_DISK or have some
TYPE_ROM characteristics.
This patch can give a chance to send
readcapacity16 when readcapacity10 failed.
This patch is not harmful to original pathes
Signed-off-by: Zhu Lingshan <address@hidden>
Message-Id: <address@hidden>
[Don't fall through on UNIT ATTENTION. - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/iscsi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index eb28ddc..3acb052 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1243,8 +1243,13 @@ static void iscsi_readcapacity_sync(IscsiLun *iscsilun,
Error **errp)
iscsilun->lbprz = !!rc16->lbprz;
iscsilun->use_16_for_rw = (rc16->returned_lba >
0xffffffff);
}
+ break;
}
- break;
+ if (task != NULL && task->status == SCSI_STATUS_CHECK_CONDITION
+ && task->sense.key == SCSI_SENSE_UNIT_ATTENTION) {
+ break;
+ }
+ /* Fall through and try READ CAPACITY(10) instead. */
case TYPE_ROM:
task = iscsi_readcapacity10_sync(iscsilun->iscsi, iscsilun->lun,
0, 0);
if (task != NULL && task->status == SCSI_STATUS_GOOD) {
--
1.8.3.1
- [Qemu-devel] [PULL 00/15] NBD, chardev, SCSI patches for 2015-01-15, Paolo Bonzini, 2016/01/15
- [Qemu-devel] [PULL 02/15] target-i386: do not duplicate page protection checks, Paolo Bonzini, 2016/01/15
- [Qemu-devel] [PULL 01/15] scsi: revert change to scsi_req_cancel_async and add assertions, Paolo Bonzini, 2016/01/15
- [Qemu-devel] [PULL 04/15] scsi: initialise info object with appropriate size, Paolo Bonzini, 2016/01/15
- [Qemu-devel] [PULL] i386: avoid null pointer dereference, Paolo Bonzini, 2016/01/15
- [Qemu-devel] [PULL 05/15] vmw_pvscsi: x-disable-pcie, x-old-pci-configuration back-compat props are 2.5 specific, Paolo Bonzini, 2016/01/15
- [Qemu-devel] [PULL 07/15] iscsi: send readcapacity10 when readcapacity16 failed,
Paolo Bonzini <=
- [Qemu-devel] [PULL 03/15] i386: avoid null pointer dereference, Paolo Bonzini, 2016/01/15
[Qemu-devel] [PULL 12/15] nbd-server: do not check request length except for reads and writes, Paolo Bonzini, 2016/01/15
[Qemu-devel] [PULL 06/15] qemu-char: delete send_all/recv_all helper methods, Paolo Bonzini, 2016/01/15
[Qemu-devel] [PULL 13/15] nbd-server: do not exit on failed memory allocation, Paolo Bonzini, 2016/01/15
[Qemu-devel] [PULL 10/15] nbd: Split nbd.c, Paolo Bonzini, 2016/01/15
[Qemu-devel] [PULL 09/15] nbd: Always call "close_fn" in nbd_client_new, Paolo Bonzini, 2016/01/15