iscsi: Set bs->request_alignment
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 29 Nov 2011 11:41:35 +0000 (12:41 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 24 Jan 2014 16:40:03 +0000 (17:40 +0100)
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>
block/iscsi.c

index c8bf8dc0490f26681a2873fecbac2865186dda31..890bd81336b287a7a59269afed92ad24f8754172 100644 (file)
@@ -1217,6 +1217,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