All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Lukas Jünger" <lukas.junger@greensocs.com>,
	qemu-devel@nongnu.org
Subject: Re: [RFC PATCH] chardev: don't exit() straight away on C-a x
Date: Mon, 18 Oct 2021 18:20:29 +0100	[thread overview]
Message-ID: <87fssyz1se.fsf@linaro.org> (raw)
In-Reply-To: <726ce2e3-71e9-639e-df62-6f1cdbf8c1fc@redhat.com>


Paolo Bonzini <pbonzini@redhat.com> writes:

> On 18/10/21 16:53, Alex Bennée wrote:
>> Paolo Bonzini <pbonzini@redhat.com> writes:
>> 
>>> On 18/10/21 16:02, Alex Bennée wrote:
>>>> While there are a number of uses in the code-base of the exit(0)
>>>> pattern it gets in the way of clean exit which can do all of it's
>>>> house-keeping. In particular it was reported that you can crash
>>>> plugins this way because TCG can still be running on other threads
>>>> when the atexit callback is called.
>>>> Use qemu_system_shutdown_request() instead. I did a gentle rename of
>>>> the runstate stub seeing as it now contains two functions.
>>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>>> Reported-by: Lukas Jünger <lukas.junger@greensocs.com>
>>>
>>> That won't work with -no-shutdown, but you can just call qmp_quit()
>>> instead.
>> How does calling qmp_quit() fix --no-shutdown? Isn't it just a thin
>> wrapper around the qemu_system_shutdown_request()?
>
> It first undoes the effect of -no-shutdown:
>
> void qmp_quit(Error **errp)
> {
>     shutdown_action = SHUTDOWN_ACTION_POWEROFF;

I guess this is it? I couldn't follow the chain of qemu_opts to find
what sort of change -no-shutdown made to the shutdown_action.

>     qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_QMP_QUIT);
> }
>
> Paolo


-- 
Alex Bennée


  reply	other threads:[~2021-10-18 17:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 14:02 [RFC PATCH] chardev: don't exit() straight away on C-a x Alex Bennée
2021-10-18 14:20 ` Marc-André Lureau
2021-10-18 14:37 ` Paolo Bonzini
2021-10-18 14:53   ` Alex Bennée
2021-10-18 14:59     ` Paolo Bonzini
2021-10-18 17:20       ` Alex Bennée [this message]
2021-10-19 10:49         ` Paolo Bonzini
2021-10-18 15:04 ` Philippe Mathieu-Daudé
2021-10-18 16:14   ` Alex Bennée
2021-10-18 17:30     ` Philippe Mathieu-Daudé

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=87fssyz1se.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=lukas.junger@greensocs.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.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.