[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/19] iscsi: Use bs->sg for everything else than dis
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 05/19] iscsi: Use bs->sg for everything else than disks |
Date: |
Fri, 7 Mar 2014 14:32:53 +0100 |
The current iscsi block driver code makes the rather arbitrary decision
that TYPE_MEDIUM_CHANGER and TYPE_TAPE devices have bs->sg = 1 and all
other device types are disks.
Instead of this, check for TYPE_DISK to expose the disk interface and
make everything else bs->sg = 1. In particular, this includes devices
with TYPE_STORAGE_ARRAY, which is what LUN 0 of an iscsi target is.
(See https://bugzilla.redhat.com/show_bug.cgi?id=1067784 for the exact
scenario.)
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
---
block/iscsi.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index 0a15f53..b490e98 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1231,12 +1231,11 @@ static int iscsi_open(BlockDriverState *bs, QDict
*options, int flags,
bs->total_sectors = sector_lun2qemu(iscsilun->num_blocks, iscsilun);
bs->request_alignment = iscsilun->block_size;
- /* 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.
+ /* We don't have any emulation for devices other than disks and CD-ROMs, 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) {
+ if (iscsilun->type != TYPE_DISK && iscsilun->type != TYPE_ROM) {
bs->sg = 1;
}
--
1.8.1.4
- [Qemu-devel] [PULL 00/19] Block patches, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 01/19] gluster: Change licence to GPLv2+, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 03/19] qemu-img convert: Fix progress output, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 04/19] qemu-iotests: Test progress output for conversion, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 02/19] gluster: Remove unused defines and header include, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 05/19] iscsi: Use bs->sg for everything else than disks,
Kevin Wolf <=
- [Qemu-devel] [PULL 06/19] block: Fix bs->request_alignment assertion for bs->sg=1, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 07/19] block: make bdrv_swap rebuild the bs graph node list field., Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 08/19] block: mirror - remove code cruft that has no function, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 09/19] block: Keep "filename" option after parsing, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 10/19] block/raw-posix: Implement bdrv_parse_filename(), Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 12/19] block/raw-win32: Implement bdrv_parse_filename(), Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 11/19] block/raw-posix: Strip "file:" prefix on creation, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 13/19] block/raw-win32: Strip "file:" prefix on creation, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 15/19] blockdev: Fix NULL pointer dereference in blockdev-add, Kevin Wolf, 2014/03/07
- [Qemu-devel] [PULL 16/19] qemu-iotests: Test a few blockdev-add error cases, Kevin Wolf, 2014/03/07