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. > > 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. > > An interesting side effect is that guest-shutdown is now able to > report an error to the client if shutting down fails. > > Signed-off-by: Luiz Capitulino <lcapitul...@redhat.com> > --- > qga/commands-posix.c | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) >
> exit(!!ret); > - } else if (ret < 0) { > - error_set(err, QERR_UNDEFINED_ERROR); > + } else if (pid < 0) { > + goto exit_err; > } > + > + rpid = waitpid(pid, &status, 0); > + if (rpid == 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. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature