From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQ1pP-0002X3-7p for qemu-devel@nongnu.org; Fri, 05 Sep 2014 18:18:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQ1pK-000365-AM for qemu-devel@nongnu.org; Fri, 05 Sep 2014 18:17:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQ1pK-000360-1A for qemu-devel@nongnu.org; Fri, 05 Sep 2014 18:17:54 -0400 Message-ID: <540A368A.9030902@redhat.com> Date: Fri, 05 Sep 2014 16:17:46 -0600 From: Eric Blake MIME-Version: 1.0 References: <1408699567-6940-1-git-send-email-pl@kamp.de> <1408699567-6940-2-git-send-email-pl@kamp.de> <53FB51B4.40400@redhat.com> <540A164C.6090003@kamp.de> In-Reply-To: <540A164C.6090003@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cnoCLvf3WM9WHooMNLSrC1nSATrkVwHMx" Subject: Re: [Qemu-devel] [PATCH 1/2] util: introduce bitmap_try_new List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cnoCLvf3WM9WHooMNLSrC1nSATrkVwHMx Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/05/2014 02:00 PM, Peter Lieven wrote: >>> + >> What you have works, but I personally would have reimplemented >> bitmap_new as the first caller of bitmap_try_new in this patch, where >> bitmap_new handles a NULL bitmap_try_new return by abort()ing, so that= >> it has the same behavior. By routing the one function to use the othe= r, >> we are future-proofing: if initialization of a bitmap ever needs >> modification, we only update bitmap_try_new, rather than copying the >> updates to both functions. >> >=20 > Good point. What would be the right exit if we receive a NULL from > bitmap_try_new? abort() ? I think that g_malloc() calls abort(), so yes, that sounds right. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cnoCLvf3WM9WHooMNLSrC1nSATrkVwHMx 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 iQEcBAEBCAAGBQJUCjaKAAoJEKeha0olJ0NqtaUH+wc3ygSefxFG8pZKVg1FkASD az+ie5VqvBRLHOAVo94gw/u9oYHce926Cl7xDHTjlUnThpbxMIaBU6u/iuASmTa2 UwgjUr/LEarFH4koEURqpdGnVxeZK8IgdYINgcSDjIPTFtwHR+xHFsRY4a89gIYv UZcaarKdxBU8NAZ8NE9l5DABps4a25AATTz3LYvJJ+bAu6VGglhGggf+HaiQ3yE/ 4ievO2aNlAk2S0JmTS59BDAcZeVdo7QAjv6jJYJQRoySa8OS23jIRurmjBTQKsvK wdBCO6CcniPSqboVYsZ3kR7PyByWpt1AczoMnlv6xJcmvDxjynKRr3bS8FOXDz8= =7Tbw -----END PGP SIGNATURE----- --cnoCLvf3WM9WHooMNLSrC1nSATrkVwHMx--