qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 06/10] XBZRLE: rebuild the cache_is_cached fu


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 06/10] XBZRLE: rebuild the cache_is_cached function
Date: Thu, 20 Mar 2014 14:09:48 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 03/20/2014 01:44 PM, Eric Blake wrote:
> On 03/18/2014 06:24 AM, address@hidden wrote:
>> From: ChenLiang <address@hidden>
>>
>> Rebuild the cache_is_cached function by cache_get_by_addr.
>>
>> Signed-off-by: ChenLiang <address@hidden>
>> Signed-off-by: Gonglei <address@hidden>
>> ---
>>  page_cache.c | 38 ++++++++++++++++----------------------
>>  1 file changed, 16 insertions(+), 22 deletions(-)
>>
> 
>>  int cache_insert(PageCache *cache, uint64_t addr, const uint8_t *pdata,
>>                   uint64_t current_age)
>>  {
>>  
>> -    CacheItem *it = NULL;
>> -
>> -    g_assert(cache);
>> -    g_assert(cache->page_cache);
>> +    CacheItem *it;
> 
> Why are you dropping the asserts?

And if the answer is "because the caller is also asserting the same
thing", then mention it in the commit message.  The best commit messages
are the ones that not only mention WHAT (no silent changes), but also WHY.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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