From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boRZN-0005Oa-Og for qemu-devel@nongnu.org; Mon, 26 Sep 2016 04:47:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boRZM-0002bN-SF for qemu-devel@nongnu.org; Mon, 26 Sep 2016 04:47:25 -0400 Date: Mon, 26 Sep 2016 10:47:15 +0200 From: Kevin Wolf Message-ID: <20160926084715.GC6093@noname.str.redhat.com> References: <57E5752C.3080407@virtuozzo.com> <20160923212126.vo3hvb4hxojjh7s4@grep.be> <57E66C60.8040102@virtuozzo.com> <57E67120.1040409@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57E67120.1040409@virtuozzo.com> Subject: Re: [Qemu-devel] write_zeroes/trim on the whole disk List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy Cc: Wouter Verhelst , Eric Blake , qemu-devel , qemu-block@nongnu.org, nbd-general@lists.sourceforge.net, "Denis V. Lunev" , Paolo Bonzini , Stefan Hajnoczi , Alex Bligh Am 24.09.2016 um 14:27 hat Vladimir Sementsov-Ogievskiy geschrieben: > On 24.09.2016 15:06, Vladimir Sementsov-Ogievskiy wrote: > >On 24.09.2016 00:21, Wouter Verhelst wrote: > >>On Fri, Sep 23, 2016 at 02:00:06PM -0500, Eric Blake wrote: > >>>My preference would be a new flag to the existing commands, with > >>>explicit documentation that 0 offset and 0 length must be used > >>>with that > >>>flag, when requesting a full-device wipe. > >>Alternatively, what about a flag that says "if you use this flag, the > >>size should be left-shifted by X bits before processing"? That allows > >>you to do TRIM or WRITE_ZEROES on much larger chunks, without being > >>limited to "whole disk" commands. We should probably make it an illegal > >>flag for any command that actually sends data over the wire, though. > >> > > > > > >Note: if disk size is not aligned to X we will have to send > >request larger than the disk size to clear the whole disk. > > > > Also, in this case, which realization of bdrv interface in qemu > would be most appropriate? Similar flag (in this case X must be > defined in some very transparent way, as a constant of 64k for > example), or flag BDRV_REQ_WHOLE_DISK, or separate .bdrv_zero_all > and .bdrv_discard_all ? Maybe the best would be to extend the existing discard/write_zeroes functions to take a 64 bit byte count and then NBD can internally check whether a request clears the whole disk. Kevin