qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [Nbd] write_zeroes/trim on the whole disk
Date: Sat, 24 Sep 2016 23:32:34 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

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 or flag
for clearing the whole disk without that dance. Server may report
availability of this/flag command only if target driver supports fast
write_zeroes (qcow2 in our case).
Also, such flag may be used to satisfy all needs:

flag BIG_REQUEST is set and length = 0    ->    request on the whole
disk, offset must be 0
flag BIG_REQUEST is set and length > 0    ->    request on
(offset*block_size, length*block_size), length*block_size must be <=
disk_size
What happens if length*block_size<=disk_size, but
offset*block_size+length*block_size>disk_size? Wraparound?

Personally, for me main scenario for is length=0, to clear the whole disk. In general allowing requests larger than disk size may not be very good idea.. Also:

On 24.09.2016 19:49, Alex Bligh wrote:
>May be, additional option, specifying the shift would be better. With 
convention that if offset+length exceeds disk size, length should be recalculated 
as disk_size-offset.
I don't think we should do that. We already have clear semantics that prevent 
operations beyond the end of the disk. Again, just break the command up into 
multipl commands. No great hardship.

So, most possible answer on your question: it should be an error.


Regards,
Carl-Daniel


--
Best regards,
Vladimir




reply via email to

[Prev in Thread] Current Thread [Next in Thread]