From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoCvT-0000bx-1x for qemu-devel@nongnu.org; Mon, 09 Jul 2012 08:18:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoCvN-00029Q-GE for qemu-devel@nongnu.org; Mon, 09 Jul 2012 08:18:50 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35227 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoCvN-00029J-9w for qemu-devel@nongnu.org; Mon, 09 Jul 2012 08:18:45 -0400 Message-ID: <4FFACC1F.70807@suse.de> Date: Mon, 09 Jul 2012 14:18:39 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1341399884-2135-1-git-send-email-chouteau@adacore.com> <4FFAB01B.2050504@adacore.com> In-Reply-To: <4FFAB01B.2050504@adacore.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V2] Use clean shutdown request for ctrl-a x List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, qemu-devel@nongnu.org, =?ISO-8859-1?Q?Herv=E9_Pouss?= =?ISO-8859-1?Q?ineau?= , pbonzini@redhat.com Am 09.07.2012 12:19, schrieb Fabien Chouteau: > Any comment? >=20 > 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 >> --- >> 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, Mux= Driver *d, int ch) >> { >> const char *term =3D "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=E9 that exposed further occurrences of exit(), probably all would need to be reviewed and fixed. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg