From: Eric Blake <eblake@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-ga: guest-shutdown: become synchronous
Date: Fri, 11 May 2012 16:11:27 -0600 [thread overview]
Message-ID: <4FAD8E8F.7070909@redhat.com> (raw)
In-Reply-To: <1336763987-10920-3-git-send-email-lcapitulino@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1292 bytes --]
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 <lcapitulino@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 eblake@redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]
next prev parent reply other threads:[~2012-05-11 22:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 19:19 [Qemu-devel] [PATCH 0/2]: qemu-ga: make shutdown & suspend synchronous Luiz Capitulino
2012-05-11 19:19 ` [Qemu-devel] [PATCH 1/2] qemu-ga: guest-suspend: make the API synchronous Luiz Capitulino
2012-05-11 22:10 ` Eric Blake
2012-05-11 19:19 ` [Qemu-devel] [PATCH 2/2] qemu-ga: guest-shutdown: become synchronous Luiz Capitulino
2012-05-11 22:11 ` Eric Blake [this message]
2012-05-14 14:56 ` [Qemu-devel] [PATCH 0/2]: qemu-ga: make shutdown & suspend synchronous Michael Roth
2012-05-14 14:56 ` [Qemu-devel] [PATCH 1/2] qemu-ga: guest-suspend: make the API synchronous Michael Roth
2012-05-14 15:30 ` Eric Blake
2012-05-14 14:56 ` [Qemu-devel] [PATCH 2/2] qemu-ga: guest-shutdown: become synchronous Michael Roth
2012-05-14 15:31 ` Eric Blake
2012-05-14 16:39 ` [Qemu-devel] [PATCH 0/2]: qemu-ga: make shutdown & suspend synchronous Luiz Capitulino
2012-05-14 17:19 ` Michael Roth
2012-05-14 17:26 ` Luiz Capitulino
2012-05-14 17:06 ` Michal Privoznik
2012-05-14 17:14 ` Luiz Capitulino
2012-05-14 17:17 ` Eric Blake
2012-05-14 18:12 ` Michael Roth
2012-05-14 18:18 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FAD8E8F.7070909@redhat.com \
--to=eblake@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.