From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJjeW-0005PK-M1 for qemu-devel@nongnu.org; Mon, 27 Jul 2015 10:45:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJjeS-000897-L4 for qemu-devel@nongnu.org; Mon, 27 Jul 2015 10:45:16 -0400 References: <1435635285-5804-1-git-send-email-wency@cn.fujitsu.com> <1435635285-5804-3-git-send-email-wency@cn.fujitsu.com> <55954B1A.9030302@gmail.com> From: Eric Blake Message-ID: <55B643EE.2080907@redhat.com> Date: Mon, 27 Jul 2015 08:45:02 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mibSpuKi84CsEAJnue0FIxMCBEa6g9is5" Subject: Re: [Qemu-devel] [PATCH COLO-BLOCK v7 02/17] quorum: implement block driver interfaces add/delete a BDS's child List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , Wen Congyang , Wen Congyang , qemu devel , Fam Zheng , Max Reitz , Paolo Bonzini Cc: Kevin Wolf , Lai Jiangshan , qemu block , Jiang Yunhong , Dong Eddie , "Dr. David Alan Gilbert" , Gonglei , Stefan Hajnoczi , Yang Hongyang , zhanghailiang This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mibSpuKi84CsEAJnue0FIxMCBEa6g9is5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/02/2015 09:21 AM, Alberto Garcia wrote: >=20 >>> 3) I don't think it's necessary to set to NULL the pointers in >>> s->bs[i] when i >=3D num_children. There's no way to access those >>> pointers anyway. Same for the ' s->bs[s->num_children] =3D NULL; ' bi= t >>> in quorum_del_child(). I also think that using memset() for setting >>> NULL pointers is not portable, although QEMU is already doing this in= >>> a few places. >> >> OK, will remove it in the next version. Just a question: why is using >> memset() for setting NULL pointers is not prtable? >=20 > The standard allows for null pointers to be internally represented by > nonzero bit patterns. However I'm not aware of any system that we > support that does that. >=20 > http://c-faq.com/null/confusion4.html > http://c-faq.com/null/machexamp.html What's more, POSIX has very recently taken the stance that memset() to 0 will work on all POSIX systems, even if someone is insane enough to use a non-zero bit pattern for NULL on modern hardware: http://austingroupbugs.net/view.php?id=3D940 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --mibSpuKi84CsEAJnue0FIxMCBEa6g9is5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVtkPuAAoJEKeha0olJ0NqMWMH/R7PL39OuLJbMRzvlh4ANnSs GXiwCJnwP1aLDHeOEyfWVpXLmfZYzawsvCIsu92/J6dg9tMaNasa2YiEyZFs/ofM LbUqt+dNClKuKh7kV9n/fK1tA64fXskzXhGIuEIIjTy1sGT4WoZysVCmm/QEPyOY SpL3V+POjFYEAjYfwD/RquSpnSKqW7mBukXiJURW1z58pAyU92AUAJEKlJjpf9Zb 5ESelUDzRJ4HF23167AgiCNOX3CRk1jmOJ3ou36tFI/U0Z23duHnZbZYXTjky3l6 CKGS+LW9ierGgXXkYu2HrtOfl+AvCJMcICYmqn5fRSBuE1mnnsTWKSa2ynAtnt8= =qRS/ -----END PGP SIGNATURE----- --mibSpuKi84CsEAJnue0FIxMCBEa6g9is5--