Received: from eggs.gnu.org ([2001:4830:134:3::10]:43327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlFWq-0004An-FX for qemu-devel@nongnu.org; Fri, 16 May 2014 06:38:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlFWk-0004j1-QZ for qemu-devel@nongnu.org; Fri, 16 May 2014 06:38:16 -0400 Received: from mail-ee0-x229.google.com ([2a00:1450:4013:c00::229]:35186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlFWk-0004il-Kq for qemu-devel@nongnu.org; Fri, 16 May 2014 06:38:10 -0400 Received: by mail-ee0-f41.google.com with SMTP id t10so1417954eei.14 for ; Fri, 16 May 2014 03:38:09 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 16 May 2014 12:37:43 +0200 Message-Id: <1400236664-32334-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1400236664-32334-1-git-send-email-pbonzini@redhat.com> References: <1400236664-32334-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 10/11] block/iscsi: allow cluster_size of 4K and greater List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Lieven From: Peter Lieven depending on the target the opt_unmap_gran might be as low as 4K. As we know use this also as a knob to activate the allocationmap feature lower the barrier. The limit 4K (and not 512) is choosen to avoid a potentially too big allocationmap. Signed-off-by: Peter Lieven Signed-off-by: Paolo Bonzini --- block/iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c index e8d26bb..84bedfa 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1386,7 +1386,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, /* Guess the internal cluster (page) size of the iscsi target by the means * of opt_unmap_gran. Transfer the unmap granularity only if it has a * reasonable size */ - if (iscsilun->bl.opt_unmap_gran * iscsilun->block_size >= 64 * 1024 && + if (iscsilun->bl.opt_unmap_gran * iscsilun->block_size >= 4 * 1024 && iscsilun->bl.opt_unmap_gran * iscsilun->block_size <= 16 * 1024 * 1024) { iscsilun->cluster_sectors = (iscsilun->bl.opt_unmap_gran * iscsilun->block_size) >> BDRV_SECTOR_BITS; -- 1.8.3.1