diff mbox

[v2,24/24] iscsi: Set bs->request_alignment

Message ID 1386940979-3824-25-git-send-email-kwolf@redhat.com
State New
Headers show

Commit Message

Kevin Wolf Dec. 13, 2013, 1:22 p.m. UTC
From: Paolo Bonzini <pbonzini@redhat.com>

The iSCSI backend already gets the block size from the READ CAPACITY
command it sends.  Save it so that the generic block layer gets it
too.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/iscsi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Max Reitz Jan. 11, 2014, 10:30 p.m. UTC | #1
On 13.12.2013 14:22, Kevin Wolf wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
>
> The iSCSI backend already gets the block size from the READ CAPACITY
> command it sends.  Save it so that the generic block layer gets it
> too.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Reviewed-by: Max Reitz <mreitz@redhat.com>
diff mbox

Patch

diff --git a/block/iscsi.c b/block/iscsi.c
index 18bc093..039b8ad 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1395,6 +1395,7 @@  static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
         goto out;
     }
     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