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