[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/14] ISCSI: force use of sg for SMC and SSC device
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 06/14] ISCSI: force use of sg for SMC and SSC devices |
Date: |
Mon, 2 Jul 2012 11:41:19 +0200 |
From: Ronnie Sahlberg <address@hidden>
If the device we open is a SMC or SSC device, then force the use of sg. We
dont have any medium changer or tape emulation so only passthrough via
real sg or scsi-generic via iscsi would work anyway.
Forcing sg also makes qemu skip trying to read from the device to guess
the image format by reading from the device (find_image_format()).
SMC devices do not implement READ6/10/12/16 so it is not possible to
read from them (SSC have different CDBs).
With this patch I can successfully manage a SMC device wiht iscsi in
passthrough mode.
Signed-off-by: Ronnie Sahlberg <address@hidden>
[Added TYPE_TAPE handling - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/iscsi.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/block/iscsi.c b/block/iscsi.c
index 029739e..ac65277 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1022,6 +1022,16 @@ static int iscsi_open(BlockDriverState *bs, const char
*filename, int flags)
if (iscsi_url != NULL) {
iscsi_destroy_url(iscsi_url);
}
+
+ /* Medium changer or tape. We dont have any emulation for this so this must
+ * be sg ioctl compatible. We force it to be sg, otherwise qemu will try
+ * to read from the device to guess the image format.
+ */
+ if (iscsilun->type == TYPE_MEDIUM_CHANGER ||
+ iscsilun->type == TYPE_TAPE) {
+ bs->sg = 1;
+ }
+
return 0;
failed:
--
1.7.10.2
- Re: [Qemu-devel] [PATCH 02/14] scsi: add a qdev property for the disk's WWN, (continued)
- Re: [Qemu-devel] [PATCH 02/14] scsi: add a qdev property for the disk's WWN, Paolo Bonzini, 2012/07/04
- Re: [Qemu-devel] [PATCH 02/14] scsi: add a qdev property for the disk's WWN, Blue Swirl, 2012/07/05
- Re: [Qemu-devel] [PATCH 02/14] scsi: add a qdev property for the disk's WWN, Paolo Bonzini, 2012/07/06
- Re: [Qemu-devel] [PATCH 02/14] scsi: add a qdev property for the disk's WWN, Blue Swirl, 2012/07/07
- Re: [Qemu-devel] [PATCH 02/14] scsi: add a qdev property for the disk's WWN, Paolo Bonzini, 2012/07/07
[Qemu-devel] [PATCH 01/14] scsi: simplify handling of the VPD page length field, Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 05/14] ISCSI: Add SCSI passthrough via scsi-generic to libiscsi, Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 04/14] scsi-disk: implement READ DISC INFORMATION, Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 03/14] atapi: implement READ DISC INFORMATION, Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 07/14] megasas: Add header file, Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 06/14] ISCSI: force use of sg for SMC and SSC devices,
Paolo Bonzini <=
[Qemu-devel] [PATCH 13/14] scsi: Add basic support for SCSI media changer commands., Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 10/14] scsi: Fix data length == SCSI_SENSE_BUF_SIZE, Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 11/14] scsi: Fix LOAD_UNLOAD, Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 12/14] scsi: Ensure command and transfer lengths are set for all SCSI devices, Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 09/14] virtio-scsi: do not crash on adding buffers to the event queue, Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 14/14] scsi: Fix transfer length for READ POSITION commands., Paolo Bonzini, 2012/07/02
[Qemu-devel] [PATCH 08/14] megasas: LSI Megaraid SAS HBA emulation, Paolo Bonzini, 2012/07/02