Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Wouter Verhelst
On Sat, Sep 24, 2016 at 11:19:53PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 24.09.2016 21:24, Alex Bligh wrote: > > > On 24 Sep 2016, at 18:47, Vladimir Sementsov-Ogievskiy > > > wrote: > > > > > > I just wanted to say, that if we want a possibility of clearing

Re: [Qemu-block] [Nbd] write_zeroes/trim on the whole disk

2016-09-24 Thread Wouter Verhelst
On Sat, Sep 24, 2016 at 11:31:25AM +0100, Alex Bligh wrote: > > > On 23 Sep 2016, at 22: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

Re: [Qemu-block] [Nbd] write_zeroes/trim on the whole disk

2016-09-24 Thread Carl-Daniel Hailfinger
On 24.09.2016 19:33, Vladimir Sementsov-Ogievskiy wrote: > On 24.09.2016 20:13, Vladimir Sementsov-Ogievskiy wrote: >> I agree that requests larger than disk size are ugly.. But splitting >> request brings me again to idea of having separate command or flag >> for clearing the whole disk without

Re: [Qemu-block] [Nbd] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
On 24.09.2016 23:14, Carl-Daniel Hailfinger wrote: On 24.09.2016 19:33, Vladimir Sementsov-Ogievskiy wrote: On 24.09.2016 20:13, Vladimir Sementsov-Ogievskiy wrote: I agree that requests larger than disk size are ugly.. But splitting request brings me again to idea of having separate command

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
On 24.09.2016 21:24, Alex Bligh wrote: On 24 Sep 2016, at 18:47, Vladimir Sementsov-Ogievskiy wrote: I just wanted to say, that if we want a possibility of clearing the whole disk in one request for qcow2 we have to take 512 as granularity for such requests (with X

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Alex Bligh
> On 24 Sep 2016, at 18:47, Vladimir Sementsov-Ogievskiy > wrote: > > I just wanted to say, that if we want a possibility of clearing the whole > disk in one request for qcow2 we have to take 512 as granularity for such > requests (with X = 9). An this is too small.

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
On 24.09.2016 20:32, Alex Bligh wrote: On 24 Sep 2016, at 18:13, Vladimir Sementsov-Ogievskiy wrote: On 24.09.2016 19:49, Alex Bligh wrote: On 24 Sep 2016, at 17:42, Vladimir Sementsov-Ogievskiy wrote: On 24.09.2016 19:31, Alex Bligh

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Alex Bligh
> On 24 Sep 2016, at 18:13, Vladimir Sementsov-Ogievskiy > wrote: > > On 24.09.2016 19:49, Alex Bligh wrote: >>> On 24 Sep 2016, at 17:42, Vladimir Sementsov-Ogievskiy >>> wrote: >>> >>> On 24.09.2016 19:31, Alex Bligh wrote: > On 24

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
On 24.09.2016 20:13, Vladimir Sementsov-Ogievskiy wrote: On 24.09.2016 19:49, Alex Bligh wrote: On 24 Sep 2016, at 17:42, Vladimir Sementsov-Ogievskiy wrote: On 24.09.2016 19:31, Alex Bligh wrote: On 24 Sep 2016, at 13:06, Vladimir Sementsov-Ogievskiy

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
On 24.09.2016 19:49, Alex Bligh wrote: On 24 Sep 2016, at 17:42, Vladimir Sementsov-Ogievskiy wrote: On 24.09.2016 19:31, Alex Bligh wrote: On 24 Sep 2016, at 13:06, Vladimir Sementsov-Ogievskiy wrote: Note: if disk size is not aligned

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Alex Bligh
> On 24 Sep 2016, at 17:52, Alex Bligh wrote: > > In *your* use-case holes may be desirable. However in the general case, you > cannot assume a server supports holes. Optional support for holes isn't even > in the mainline spec yet (AFAIR). You should also be aware that the

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Alex Bligh
> On 24 Sep 2016, at 17:48, Vladimir Sementsov-Ogievskiy > wrote: > >>> Use NBD_CMD_WRITE_ZEROES without NBD_CMD_FLAG_NO_HOLE and you can pretty >>> much assume that a server that supports holes will write holes. A server >>> that does not support holes will write

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Alex Bligh
> On 24 Sep 2016, at 17:42, Vladimir Sementsov-Ogievskiy > wrote: > > On 24.09.2016 19:31, Alex Bligh wrote: >>> On 24 Sep 2016, at 13:06, Vladimir Sementsov-Ogievskiy >>> wrote: >>> >>> Note: if disk size is not aligned to X we will have

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
On 24.09.2016 19:44, Vladimir Sementsov-Ogievskiy wrote: On 24.09.2016 19:35, Alex Bligh wrote: On 24 Sep 2016, at 17:20, Vladimir Sementsov-Ogievskiy wrote: Also, accordingly to documentation, NBD_CMD_TRIM is not appropriate for disk clearing: * `NBD_CMD_TRIM`

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
On 24.09.2016 19:35, Alex Bligh wrote: On 24 Sep 2016, at 17:20, Vladimir Sementsov-Ogievskiy wrote: Also, accordingly to documentation, NBD_CMD_TRIM is not appropriate for disk clearing: * `NBD_CMD_TRIM` (4) A hint to the server that the data defined by

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
On 24.09.2016 19:31, Alex Bligh wrote: On 24 Sep 2016, at 13:06, Vladimir Sementsov-Ogievskiy wrote: 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. If you look at the block size extension, the

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Alex Bligh
> On 24 Sep 2016, at 17:20, Vladimir Sementsov-Ogievskiy > wrote: > > Also, accordingly to documentation, NBD_CMD_TRIM is not appropriate for disk > clearing: > > * `NBD_CMD_TRIM` (4) > > A hint to the server that the data defined by len and offset is no >

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Alex Bligh
> On 24 Sep 2016, at 13:06, Vladimir Sementsov-Ogievskiy > wrote: > > 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. If you look at the block size extension, the size of the disk must be an

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Denis V. Lunev
On 09/24/2016 12:21 AM, 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.

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
On 24.09.2016 16:42, Vladimir Sementsov-Ogievskiy wrote: 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

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
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

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
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

Re: [Qemu-block] write_zeroes/trim on the whole disk

2016-09-24 Thread Vladimir Sementsov-Ogievskiy
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.

Re: [Qemu-block] [Nbd] write_zeroes/trim on the whole disk

2016-09-24 Thread Alex Bligh
> On 23 Sep 2016, at 22: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