From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSy3g-00025K-VZ for qemu-devel@nongnu.org; Fri, 11 May 2012 18:11:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSy3f-0007Qc-6B for qemu-devel@nongnu.org; Fri, 11 May 2012 18:11:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSy3e-0007QQ-UF for qemu-devel@nongnu.org; Fri, 11 May 2012 18:11:31 -0400 Message-ID: <4FAD8E8F.7070909@redhat.com> Date: Fri, 11 May 2012 16:11:27 -0600 From: Eric Blake MIME-Version: 1.0 References: <1336763987-10920-1-git-send-email-lcapitulino@redhat.com> <1336763987-10920-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1336763987-10920-3-git-send-email-lcapitulino@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigDA76DDA68A9327376BD39262" Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-ga: guest-shutdown: become synchronous List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDA76DDA68A9327376BD39262 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/11/2012 01:19 PM, Luiz Capitulino wrote: > Last commit dropped qemu-ga's SIGCHLD handler, used to automatically > reap terminated children processes. This introduced a bug to > qmp_guest_shutdown(): it will generate zombies. >=20 > This problem probably doesn't matter in the success case, as the VM > will shutdown anyway, but let's do the right thing and reap the > created process. This ultimately means that guest-shutdown is now a > synchronous command. >=20 > An interesting side effect is that guest-shutdown is now able to > report an error to the client if shutting down fails. >=20 > Signed-off-by: Luiz Capitulino > --- > qga/commands-posix.c | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) >=20 > exit(!!ret); > - } else if (ret < 0) { > - error_set(err, QERR_UNDEFINED_ERROR); > + } else if (pid < 0) { > + goto exit_err; > } > + > + rpid =3D waitpid(pid, &status, 0); > + if (rpid =3D=3D pid && WIFEXITED(status) && !WEXITSTATUS(status)) = { And another case where waitpid should be used in a loop. Other than that, I'm in favor of this series. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigDA76DDA68A9327376BD39262 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/ iQEcBAEBCAAGBQJPrY6PAAoJEKeha0olJ0Nq4RcH/iamfN6zkPgF0rTa0IX0goFY hc2qKbi1sQlJkw3JA2HcYEU0u0yacQNNfXjrmt95/87wrxWQKU2kjxvtt7zmGUI8 53QNSKhUatGOseU4LVwT68m1lZnTpS9nN3Nmp09C3OhSXrvHi1iVis/aLVAU5ptp T7sRYihaMepU6uXidPANyfsVFxXIu9dos7pTS8w6VEbq/sNiLwEkAzo0fJOfn3RN YvjQOLAv45W/uTgUdW+Ln+N6m4+GdUT+51FxA+iWRVyGjnQ69kK1KHqBpzm/gOMd 48FDP1URgVVtoDpTQXhn/PUJluhspKtsWycOp1O8ZsUY2FulBCETUlBe86AxErw= =w7u4 -----END PGP SIGNATURE----- --------------enigDA76DDA68A9327376BD39262--