From: Fabien Chouteau <chouteau@adacore.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com,
qemu-devel@nongnu.org, "Hervé Poussineau" <hpoussin@reactos.org>,
pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH V2] Use clean shutdown request for ctrl-a x
Date: Tue, 10 Jul 2012 12:16:16 +0200 [thread overview]
Message-ID: <4FFC00F0.8070101@adacore.com> (raw)
In-Reply-To: <4FFACC1F.70807@suse.de>
On 07/09/2012 02:18 PM, Andreas Färber wrote:
> Am 09.07.2012 12:19, schrieb Fabien Chouteau:
>> Any comment?
>>
>> On 07/04/2012 01:04 PM, Fabien Chouteau wrote:
>>> The 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.
>>>
>>> Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
>>> ---
>>> qemu-char.c | 2 +-
>>> sysemu.h | 1 +
>>> vl.c | 5 +++++
>>> 3 files changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/qemu-char.c b/qemu-char.c
>>> index c2aaaee..7732846 100644
>>> --- a/qemu-char.c
>>> +++ b/qemu-char.c
>>> @@ -353,7 +353,7 @@ static int mux_proc_byte(CharDriverState *chr, MuxDriver *d, int ch)
>>> {
>>> const char *term = "QEMU: Terminated\n\r";
>>> chr->chr_write(chr,(uint8_t *)term,strlen(term));
>>> - exit(0);
>>> + qemu_system_force_shutdown();
>>> break;
>>> }
>>> case 's':
>
> FWIW there was a recent patch by Hervé that exposed further occurrences
> of exit(), probably all would need to be reviewed and fixed.
>
There's a lot of exit() in Qemu (~660 with a quick grep), but it doesn't
always make sense to change them all.
In my opinion this one is a clean user request to shutdown the system,
as opposed to an error state that requires exit().
--
Fabien Chouteau
prev parent reply other threads:[~2012-07-10 10:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-04 11:04 [Qemu-devel] [PATCH V2] Use clean shutdown request for ctrl-a x Fabien Chouteau
2012-07-09 10:19 ` Fabien Chouteau
2012-07-09 10:20 ` Paolo Bonzini
2012-07-09 10:27 ` Kevin Wolf
2012-07-09 12:18 ` Andreas Färber
2012-07-10 10:16 ` Fabien Chouteau [this message]
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=4FFC00F0.8070101@adacore.com \
--to=chouteau@adacore.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=hpoussin@reactos.org \
--cc=kwolf@redhat.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.