From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQjHp-0002gE-Hd for qemu-devel@nongnu.org; Thu, 20 Mar 2014 16:10:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQjHl-0001zy-78 for qemu-devel@nongnu.org; Thu, 20 Mar 2014 16:09:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQjHk-0001zt-TY for qemu-devel@nongnu.org; Thu, 20 Mar 2014 16:09:53 -0400 Message-ID: <532B4B0C.4050806@redhat.com> Date: Thu, 20 Mar 2014 14:09:48 -0600 From: Eric Blake MIME-Version: 1.0 References: <1395145464-5524-1-git-send-email-arei.gonglei@huawei.com> <1395145464-5524-7-git-send-email-arei.gonglei@huawei.com> <532B4515.5060908@redhat.com> In-Reply-To: <532B4515.5060908@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lOUqBs1LphhkgDvFItr4kQsXNktJqhRL0" Subject: Re: [Qemu-devel] [PATCH v3 06/10] XBZRLE: rebuild the cache_is_cached function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com, qemu-devel@nongnu.org Cc: ChenLiang , pbonzini@redhat.com, weidong.huang@huawei.com, quintela@redhat.com, owasserm@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lOUqBs1LphhkgDvFItr4kQsXNktJqhRL0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/20/2014 01:44 PM, Eric Blake wrote: > On 03/18/2014 06:24 AM, arei.gonglei@huawei.com wrote: >> From: ChenLiang >> >> Rebuild the cache_is_cached function by cache_get_by_addr. >> >> Signed-off-by: ChenLiang >> Signed-off-by: Gonglei >> --- >> page_cache.c | 38 ++++++++++++++++---------------------- >> 1 file changed, 16 insertions(+), 22 deletions(-) >> >=20 >> int cache_insert(PageCache *cache, uint64_t addr, const uint8_t *pdat= a, >> uint64_t current_age) >> { >> =20 >> - CacheItem *it =3D NULL; >> - >> - g_assert(cache); >> - g_assert(cache->page_cache); >> + CacheItem *it; >=20 > 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= =2E --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --lOUqBs1LphhkgDvFItr4kQsXNktJqhRL0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTK0sMAAoJEKeha0olJ0Nq/soH/0hZ3u+q/Wu6ZRoOhH/Zd0Hd eoGcA5H+50KpzkeTvPFmDaSioBfLs4Z2jFOEye94QgzeW1sjexstCAXNUPnJL1No 1RqMj9E1GogEEr9oLjY2baAJK+3h8MGqwgRo2Tb6sl/9fRn63in3CAXzULqSGqO/ m5zoBEb23Bzhx+nzr6cespwZ5w64UkvUTP4Izu27OE4nHjEShQiyNRMzBVw0u9iX e77kJ1hnXvhXAkADQsbsqrC4GIV65SHQSbfg603spxfTXLQ+jFyvtnN3W4jMc7Rh 5+tU0BiSxUTnYvJF4c0+vAG5bubpeV+Lr6Ag89X2BMNP5AsRYiIlHM4/t0klPz0= =NwCw -----END PGP SIGNATURE----- --lOUqBs1LphhkgDvFItr4kQsXNktJqhRL0--