Received: from eggs.gnu.org ([2001:4830:134:3::10]:47883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewqiZ-0001cg-It for qemu-devel@nongnu.org; Fri, 16 Mar 2018 10:52:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewqiY-0004mR-QJ for qemu-devel@nongnu.org; Fri, 16 Mar 2018 10:52:27 -0400 References: <1520849818-6915-1-git-send-email-anton.nefedov@virtuozzo.com> <1520849818-6915-5-git-send-email-anton.nefedov@virtuozzo.com> From: Anton Nefedov Message-ID: <7c4cae1c-80ef-b84f-67bd-b849386e3c73@virtuozzo.com> Date: Fri, 16 Mar 2018 17:52:13 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v8 4/9] block: introduce BDRV_REQ_ALLOCATE flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, mreitz@redhat.com, eblake@redhat.com, den@virtuozzo.com On 16/3/2018 2:01 PM, Alberto Garcia wrote: > On Mon 12 Mar 2018 11:16:53 AM CET, Anton Nefedov wrote: >> The flag is supposed to indicate that the region of the disk image has >> to be sufficiently allocated so it reads as zeroes. >> >> The call with the flag set must return -ENOTSUP if allocation cannot >> be done efficiently. >> This has to be made sure of by both >> - the drivers that support the flag >> - and the common block layer (so it will not fall back to any slowpath >> (like writing zero buffers) in case the driver does not support >> the flag). >> >> Signed-off-by: Anton Nefedov >> Reviewed-by: Eric Blake >> Reviewed-by: Alberto Garcia > > Hmm... this is not the patch that I reviewed, please remove the R-b > lines when you submit a modified patch. > Oops. sorry >> + /* The BDRV_REQ_ALLOCATE flag is used to indicate that the driver has to >> + * efficiently allocate the space so it reads as zeroes, or return an error. >> + * Must be used together with BDRV_REQ_ZERO_WRITE. > > I guess it's understandable from the context but it's not immediately > obvious that you can set BDRV_REQ_ZERO_WRITE but not this one. > > Perhaps it could be rephrased as something like "If this is set then > BDRV_REQ_ZERO_WRITE must also be set". > Sound much better, fixed >> + * Contradictory to BDRV_REQ_MAY_UNMAP so the two must not be used together. > > Or simply "This flag cannot be set together with BDRV_REQ_MAY_UNMAP". > Done >> + */ >> + BDRV_REQ_ALLOCATE = 0x40, > > Berto >