[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/4] ISCSI: Only use READ16 for SBC devices. Use REA
From: |
Ronnie Sahlberg |
Subject: |
[Qemu-devel] [PATCH 3/4] ISCSI: Only use READ16 for SBC devices. Use READ10 for other device types such as MMC |
Date: |
Sat, 26 May 2012 14:56:40 +1000 |
Signed-off-by: Ronnie Sahlberg <address@hidden>
---
block/iscsi.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index 2ddb9e5..a015a52 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -379,14 +379,25 @@ iscsi_aio_readv(BlockDriverState *bs, int64_t sector_num,
memset(acb->task, 0, sizeof(struct scsi_task));
acb->task->xfer_dir = SCSI_XFER_READ;
- acb->task->cdb_size = 16;
- acb->task->cdb[0] = 0x88;
lba = sector_qemu2lun(sector_num, iscsilun);
- *(uint32_t *)&acb->task->cdb[2] = htonl(lba >> 32);
- *(uint32_t *)&acb->task->cdb[6] = htonl(lba & 0xffffffff);
- *(uint32_t *)&acb->task->cdb[10] = htonl(num_sectors);
acb->task->expxferlen = qemu_read_size;
+ switch (iscsilun->type) {
+ case TYPE_DISK:
+ acb->task->cdb_size = 16;
+ acb->task->cdb[0] = 0x88;
+ *(uint32_t *)&acb->task->cdb[2] = htonl(lba >> 32);
+ *(uint32_t *)&acb->task->cdb[6] = htonl(lba & 0xffffffff);
+ *(uint32_t *)&acb->task->cdb[10] = htonl(num_sectors);
+ break;
+ default:
+ acb->task->cdb_size = 10;
+ acb->task->cdb[0] = 0x28;
+ *(uint32_t *)&acb->task->cdb[2] = htonl(lba);
+ *(uint16_t *)&acb->task->cdb[7] = htons(num_sectors);
+ break;
+ }
+
if (iscsi_scsi_command_async(iscsi, iscsilun->lun, acb->task,
iscsi_aio_read16_cb,
NULL,
--
1.7.3.1
- [Qemu-devel] [PATCH 0/4] ISCSI: Passthough updates, Ronnie Sahlberg, 2012/05/26
- [Qemu-devel] [PATCH 1/4] ISCSI: Only call READCAPACITY16 for SBC devices, Ronnie Sahlberg, 2012/05/26
- [Qemu-devel] [PATCH 2/4] ISCSI: Use READCAPACITY10 for MMC devices, Ronnie Sahlberg, 2012/05/26
- [Qemu-devel] [PATCH 3/4] ISCSI: Only use READ16 for SBC devices. Use READ10 for other device types such as MMC,
Ronnie Sahlberg <=
- [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi would work anyway., Ronnie Sahlberg, 2012/05/26
- Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi would work anyway., Paolo Bonzini, 2012/05/26
- Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi would work anyway., Andreas Färber, 2012/05/27
- Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi would work anyway., Paolo Bonzini, 2012/05/28
- Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi would work anyway., ronnie sahlberg, 2012/05/28
- Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi would work anyway., Paolo Bonzini, 2012/05/28
Re: [Qemu-devel] [PATCH 0/4] ISCSI: Passthough updates, Paolo Bonzini, 2012/05/26