[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/4] block/null-{co, aio}: Return zeros when rea
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH 2/4] block/null-{co, aio}: Return zeros when read |
Date: |
Mon, 22 Feb 2016 17:45:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 22.02.2016 17:31, Eric Blake wrote:
> On 02/20/2016 10:39 AM, Max Reitz wrote:
>> Currently, we do not define exactly what is returned when read, but
>> having a reliable source of zeros is always nice.
>>
>> Signed-off-by: Max Reitz <address@hidden>
>> ---
>> block/null.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/block/null.c b/block/null.c
>> index d90165d..ad883d9 100644
>> --- a/block/null.c
>> +++ b/block/null.c
>> @@ -90,6 +90,7 @@ static coroutine_fn int null_co_readv(BlockDriverState *bs,
>> int64_t sector_num, int nb_sectors,
>> QEMUIOVector *qiov)
>> {
>> + qemu_iovec_memset(qiov, 0, 0, nb_sectors * BDRV_SECTOR_SIZE);
>> return null_co_common(bs);
>> }
>
> Shouldn't this be made optional? That is, one of the points of null-co
> was to be as fast as possible, and the memset will slow us down. So
> having an optional bool as part of the null-co setup, which defaults off
> for back-compat but can be turned on for guaranteed all-zero reads,
> sounds like it would be nicer than forcing all-zero reads.
Can do, will do, thanks.
Max
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 0/4] qemu-img: Fix preallocation with -S 0 for convert, Max Reitz, 2016/02/20
- [Qemu-devel] [PATCH 2/4] block/null-{co, aio}: Return zeros when read, Max Reitz, 2016/02/20
- [Qemu-devel] [PATCH 4/4] iotests: Test qemu-img convert -S 0 behavior, Max Reitz, 2016/02/20
- [Qemu-devel] [PATCH 3/4] block/null-{co, aio}: Implement get_block_status(), Max Reitz, 2016/02/20