Received: from eggs.gnu.org ([2001:4830:134:3::10]:50894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCOZ6-0006vE-RU for qemu-devel@nongnu.org; Mon, 13 Jun 2016 05:53:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCOZ4-0004c9-Qq for qemu-devel@nongnu.org; Mon, 13 Jun 2016 05:53:51 -0400 References: <1464079240-24362-1-git-send-email-pl@kamp.de> <5744DF5F.3070600@redhat.com> <574BDEA0.2040708@kamp.de> From: Paolo Bonzini Message-ID: <71c8729a-da21-fe2a-0ddf-82595ecfe28c@redhat.com> Date: Mon, 13 Jun 2016 11:53:40 +0200 MIME-Version: 1.0 In-Reply-To: <574BDEA0.2040708@kamp.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V3] block/iscsi: allow caching of the allocation map List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , Eric Blake , qemu-block@nongnu.org Cc: famz@redhat.com, qemu-devel@nongnu.org On 30/05/2016 08:33, Peter Lieven wrote: > > The idea of the allocmap in cache.direct = on mode is that we can > still speed up block jobs by skipping large unallocated areas. In this case > the allocmap has only a hint character. If we don't know the status > we issue a get_block_status request and verify the status. If its > unallocated > we return zeroes. If we new through an earlier get block status request > that the area is allocated we can skip the useless get_block_status > request. > This is the old behaviour without this patch. I'm adding a note like this: diff --git a/block/iscsi.c b/block/iscsi.c index fa03028..299b23c 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -523,6 +523,9 @@ static void iscsi_allocmap_set_unallocated(IscsiLun *iscsilun, int64_t sector_num, int nb_sectors) { + /* Note: if cache.direct=on the third argument to iscsi_allocmap_update + * is ignored, so this will in effect be an iscsi_allocmap_set_invalid. + */ iscsi_allocmap_update(iscsilun, sector_num, nb_sectors, false, true); } Paolo