qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
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 1/2] qemu-ga: guest-suspend: make the API synchronous
Date: Fri, 11 May 2012 16:10:17 -0600	[thread overview]
Message-ID: <4FAD8E49.4090900@redhat.com> (raw)
In-Reply-To: <1336763987-10920-2-git-send-email-lcapitulino@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

On 05/11/2012 01:19 PM, Luiz Capitulino wrote:
> Currently, qemu-ga has a SIGCHLD handler that automatically reaps terminated
> children processes. The idea is to avoid having qemu-ga commands blocked
> waiting for children to terminate.
> 

> +
> +    rpid = waitpid(pid, &status, 0);

You need to worry about signals interrupting the wait.  Something like:

while ((rpid = waitpid(pid, &status, 0) == -1 && errno == EINTR) {
}


> @@ -664,9 +633,16 @@ static void guest_suspend(const char *pmutils_bin, const char *sysfile_str,
>      g_free(pmutils_path);
>  
>      if (pid < 0) {
> -        error_set(err, QERR_UNDEFINED_ERROR);
> +        goto exit_err;
> +    }
> +
> +    rpid = waitpid(pid, &status, 0);
> +    if (rpid == pid && WIFEXITED(status) && !WEXITSTATUS(status)) {
>          return;

And again.

-- 
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 --]

  reply	other threads:[~2012-05-11 22:10 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 [this message]
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
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=4FAD8E49.4090900@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).