qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-1.2] qed: refuse unaligned zero writes with


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH for-1.2] qed: refuse unaligned zero writes with a backing file
Date: Tue, 28 Aug 2012 14:37:03 +0100

On Tue, Aug 28, 2012 at 2:25 PM, Paolo Bonzini <address@hidden> wrote:
> Il 28/08/2012 15:04, Stefan Hajnoczi ha scritto:
>> Zero writes have cluster granularity in QED.  Therefore they can only be
>> used to zero entire clusters.
>>
>> If the zero write request leaves sectors untouched, zeroing the entire
>> cluster would obscure the backing file.  Instead return -ENOTSUP, which
>> is handled by block.c:bdrv_co_do_write_zeroes() and falls back to a
>> regular write.
>>
>> The qemu-iotests 034 test cases covers this scenario.
>
> Reviewed-by: Paolo Bonzini <address@hidden>
>
> Makes sense since both streaming and copy-on-read will do cluster-aligned 
> writes.
>
> The "right fix" would not be much more complex though, something like this, 
> right?
> (untested).

Yes but it's more complicated.  To do a really good job we should
slice off the first/last clusters if they are unaligned, handle them
like regular allocating writes, and handle the middle of the request
as a zero write.

I decided to do the simplest implementation since this scenario only
occurs in test cases, not real guests.

Stefan



reply via email to

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