All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Fabien Chouteau <chouteau@adacore.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	aliguori@us.ibm.com, qemu-devel@nongnu.org,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] Use clean shutdown request for ctrl-a x
Date: Wed, 04 Jul 2012 12:07:45 +0200	[thread overview]
Message-ID: <4FF415F1.70502@redhat.com> (raw)
In-Reply-To: <4FF30AC2.9030905@adacore.com>

Am 03.07.2012 17:07, schrieb Fabien Chouteau:
> On 07/03/2012 04:49 PM, Paolo Bonzini wrote:
>> Il 03/07/2012 16:00, Peter Maydell ha scritto:
>>> I was just talking on #qemu this morning about the equivalent question
>>> of whether the ARM semihosting exit function ought to be doing a
>>> qemu_system_shutdown_request rather than a plain exit()...
>>>
>>> The interesting question for the qemu-char case is whether the code that
>>> feeds this magic byte to us is expecting it to have immediate effect
>>> or is happy to continue execution and let us shut down with a slight
>>> delay.
>>
>> And also whether it is supposed to obey -no-shutdown...
> 
> I didn't know this option...
> 
> My goal is to make ctrl-a x to close Qemu in a clean way.
> The current exit(0) skips a lot of cleanup/close functions, for
> example in block drivers.
> 
> We can create a new shutdown function that will override the
> -no-shutdown option to keep a consistent behavior with ctrl-a x.
> 
> void qemu_system_force_shutdown(void)
> {
>     no_shutdown = 0;
>     qemu_system_shutdown_request();
> }

The same thing already exists in qemu_system_killed(). It could use the
same new function if you added it. Or you could reuse the existing code
in the ctrl-a x handler by sending SIGTERM.

Kevin

  reply	other threads:[~2012-07-04 10:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03 13:38 [Qemu-devel] [PATCH] Use clean shutdown request for ctrl-a x Fabien Chouteau
2012-07-03 14:00 ` Peter Maydell
2012-07-03 14:49   ` Paolo Bonzini
2012-07-03 15:07     ` Fabien Chouteau
2012-07-04 10:07       ` Kevin Wolf [this message]
2012-07-04 10:27         ` Fabien Chouteau
2012-07-04 10:32           ` Kevin Wolf
2012-07-04 10:51             ` Fabien Chouteau

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=4FF415F1.70502@redhat.com \
    --to=kwolf@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=chouteau@adacore.com \
    --cc=pbonzini@redhat.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 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.