cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From 36fb92fbc1edd351b923199559a0a923da9f72c4 Mon Sep 17 00:00:00 2001
From: Kevin Wolf <kwolf@redhat.com>
Date: Tue, 29 Nov 2011 12:41:35 +0100
Subject: [PATCH 30/37] iscsi: Set bs->request_alignment

Message-id: <1392117622-28812-31-git-send-email-kwolf@redhat.com>
Patchwork-id: 57195
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 30/37] iscsi: Set bs->request_alignment
Bugzilla: 748906
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>

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>
(cherry picked from commit 2c9880c45e2f9a98d11d44ce9966515c23870a86)

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/iscsi.c | 1 +
 1 file changed, 1 insertion(+)
---
 block/iscsi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index 83e4f15..63a21e2 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1397,6 +1397,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
-- 
1.7.1