From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SU1RC-0008DX-Cf for qemu-devel@nongnu.org; Mon, 14 May 2012 16:00:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SU1RA-0001Ei-54 for qemu-devel@nongnu.org; Mon, 14 May 2012 16:00:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SU1R9-00017b-T9 for qemu-devel@nongnu.org; Mon, 14 May 2012 16:00:08 -0400 Message-ID: <4FB16440.9040808@redhat.com> Date: Mon, 14 May 2012 14:00:00 -0600 From: Eric Blake MIME-Version: 1.0 References: <20120514152520.69ce699a@doriath.home> In-Reply-To: <20120514152520.69ce699a@doriath.home> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigD31AC7270EDC6E160D1448EE" Subject: Re: [Qemu-devel] [PATCH v2] qemu-ga: guest-shutdown: use only async-signal-safe functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: qemu-devel , mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD31AC7270EDC6E160D1448EE Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 05/14/2012 12:25 PM, Luiz Capitulino wrote: > POSIX mandates[1] that a child process of a multi-thread program uses > only async-signal-safe functions before exec(). We consider qemu-ga > to be multi-thread, because it uses glib. >=20 > However, qmp_guest_shutdown() uses functions that are not > async-signal-safe. Fix it the following way: >=20 > - fclose() -> reopen_fd_to_null() > - execl() -> execle() > - exit() -> _exit() > - drop slog() usage (which is not safe) >=20 > [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/fork.htm= l >=20 > Signed-off-by: Luiz Capitulino > --- >=20 > o v2 >=20 > - fix doc typo > - drop 'ret' and use EXIT_FAILURE instead Not addressed was the 'environ' declaration issue, but I'm okay if you save it for another day when we actually get a compile failure for using an undeclared variable (since what you have _does_ work on glibc). Reviewed-by: Eric Blake --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigD31AC7270EDC6E160D1448EE 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.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPsWRAAAoJEKeha0olJ0NqIy8H/iRHJbFSPBwmZ8W45S8MlYom tdVf6BvekyVHBIqTITjBYnoWHET4khA5a5pM7B0NT876MCkZkXyTFkxX+i5OKkuj shX22k0Ib68v0XHa382KxzP34iFBOm/JCWUIqtxdMa9wAerYxtGdtVIthOYq83H+ J9Nu4q4x8AwuMwCM//HznM0pEm13T4IxK8ZjMWiQ2tePRCPVpBmMW3zv/wrSvz+B 9WE1yQXRjfaonVEw7FI6OkTU1ttlNJiAu56aUswWYT0CvaD/XSU/6bqlGKNcunCM CzZZlc+OS3c/Q2FqmVwszOcJRY08+IVIzcEEcAUkN2B3aNx2RayH1wp5oNYHoWQ= =Yv1c -----END PGP SIGNATURE----- --------------enigD31AC7270EDC6E160D1448EE--