From: Eric Blake <eblake@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>, mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v2] qemu-ga: guest-shutdown: use only async-signal-safe functions
Date: Mon, 14 May 2012 14:00:00 -0600 [thread overview]
Message-ID: <4FB16440.9040808@redhat.com> (raw)
In-Reply-To: <20120514152520.69ce699a@doriath.home>
[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]
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.
>
> However, qmp_guest_shutdown() uses functions that are not
> async-signal-safe. Fix it the following way:
>
> - fclose() -> reopen_fd_to_null()
> - execl() -> execle()
> - exit() -> _exit()
> - drop slog() usage (which is not safe)
>
> [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/fork.html
>
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>
> o v2
>
> - 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 <eblake@redhat.com>
--
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-14 20:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 18:25 [Qemu-devel] [PATCH v2] qemu-ga: guest-shutdown: use only async-signal-safe functions Luiz Capitulino
2012-05-14 20:00 ` Eric Blake [this message]
2012-05-14 22:25 ` Michael Roth
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=4FB16440.9040808@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).