qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>,
	qemu-devel@nongnu.org,
	"Pavel Dovgalyuk" <pavel.dovgaluk@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Subject: Re: Race with atexit functions in system emulation
Date: Wed, 1 Jul 2020 13:14:01 +0200	[thread overview]
Message-ID: <06ce5fd3-01fe-0d93-7147-8195e329c449@redhat.com> (raw)
In-Reply-To: <87v9j7qyuh.fsf@linaro.org>

On 01/07/20 13:05, Alex Bennée wrote:
> Should we maybe defer the exit to once the main loop has been exited
> with a some sort of vmstop? Or could we have an atexit handler that
> kills the main thread?

Yes, I think the way to do "exit" is to use
qemu_system_shutdown_request.  Possibly halt the CPU?  This way you can
also obey -no-shutdown and give the user an occasion to inspect the
program.  You can add a global to pass back the exit code.

Alternatively, replay_finish could just take the lock.

Paolo



  reply	other threads:[~2020-07-01 11:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 11:05 Race with atexit functions in system emulation Alex Bennée
2020-07-01 11:14 ` Paolo Bonzini [this message]
2020-07-02  6:18 ` Pavel Dovgalyuk
2020-07-02  7:49   ` Alex Bennée
2020-07-02  7:54     ` Pavel Dovgalyuk
2020-07-02  9:18   ` Paolo Bonzini

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=06ce5fd3-01fe-0d93-7147-8195e329c449@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=pavel.dovgaluk@gmail.com \
    --cc=peter.maydell@linaro.org \
    --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).