cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-iscsi-set-limits-in-BlockDriverState.patch.patch.patch

0a122b
From a9bf8d1acc8589ebda4fb96acd08822a7937af9b Mon Sep 17 00:00:00 2001
0a122b
Message-Id: <a9bf8d1acc8589ebda4fb96acd08822a7937af9b.1389014116.git.minovotn@redhat.com>
0a122b
In-Reply-To: <c8cc35838d42aa286242772d97e3a9be7bb786ba.1389014116.git.minovotn@redhat.com>
0a122b
References: <c8cc35838d42aa286242772d97e3a9be7bb786ba.1389014116.git.minovotn@redhat.com>
0a122b
From: Paolo Bonzini <pbonzini@redhat.com>
0a122b
Date: Mon, 9 Dec 2013 14:09:04 +0100
0a122b
Subject: [PATCH 16/50] iscsi: set limits in BlockDriverState
0a122b
0a122b
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
0a122b
Message-id: <1386598178-11845-19-git-send-email-pbonzini@redhat.com>
0a122b
Patchwork-id: 56055
0a122b
O-Subject: [RHEL 7.0 qemu-kvm PATCH 18/52] iscsi: set limits in BlockDriverState
0a122b
Bugzilla: 1007815
0a122b
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
0a122b
RH-Acked-by: Fam Zheng <famz@redhat.com>
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
0a122b
From: Peter Lieven <pl@kamp.de>
0a122b
0a122b
Reviewed-by: Eric Blake <eblake@redhat.com>
0a122b
Signed-off-by: Peter Lieven <pl@kamp.de>
0a122b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
(cherry picked from commit ba6c59191f245147e7ee0c2b9ecaf5fb116f7877)
0a122b
---
0a122b
 block/iscsi.c | 14 ++++++++++++++
0a122b
 1 file changed, 14 insertions(+)
0a122b
0a122b
Signed-off-by: Michal Novotny <minovotn@redhat.com>
0a122b
---
0a122b
 block/iscsi.c | 14 ++++++++++++++
0a122b
 1 file changed, 14 insertions(+)
0a122b
0a122b
diff --git a/block/iscsi.c b/block/iscsi.c
0a122b
index 1e8a2bb..e5f4670 100644
0a122b
--- a/block/iscsi.c
0a122b
+++ b/block/iscsi.c
0a122b
@@ -1386,6 +1386,20 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
0a122b
                sizeof(struct scsi_inquiry_block_limits));
0a122b
         scsi_free_scsi_task(task);
0a122b
         task = NULL;
0a122b
+
0a122b
+        if (iscsilun->bl.max_unmap < 0xffffffff) {
0a122b
+            bs->bl.max_discard = sector_lun2qemu(iscsilun->bl.max_unmap,
0a122b
+                                                 iscsilun);
0a122b
+        }
0a122b
+        bs->bl.discard_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran,
0a122b
+                                                   iscsilun);
0a122b
+
0a122b
+        if (iscsilun->bl.max_ws_len < 0xffffffff) {
0a122b
+            bs->bl.max_write_zeroes = sector_lun2qemu(iscsilun->bl.max_ws_len,
0a122b
+                                                      iscsilun);
0a122b
+        }
0a122b
+        bs->bl.write_zeroes_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran,
0a122b
+                                                        iscsilun);
0a122b
     }
0a122b
 
0a122b
 #if defined(LIBISCSI_FEATURE_NOP_COUNTER)
0a122b
-- 
0a122b
1.7.11.7
0a122b