From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KaTwo-00049T-0P for qemu-devel@nongnu.org; Tue, 02 Sep 2008 07:21:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KaTwi-00043v-6e for qemu-devel@nongnu.org; Tue, 02 Sep 2008 07:21:21 -0400 Received: from [199.232.76.173] (port=36953 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KaTwh-00043g-RQ for qemu-devel@nongnu.org; Tue, 02 Sep 2008 07:21:15 -0400 Received: from lizzard.sbs.de ([194.138.37.39]:21887) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KaTwh-0006Lh-1U for qemu-devel@nongnu.org; Tue, 02 Sep 2008 07:21:15 -0400 Message-ID: <48BD21A2.3020007@siemens.com> Date: Tue, 02 Sep 2008 13:21:06 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <48AE9963.5040603@siemens.com> In-Reply-To: <48AE9963.5040603@siemens.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [5055] Handle terminating signals (Gerd Hoffmann) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Jan Kiszka wrote: > Anthony Liguori wrote: >> Revision: 5055 >> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5055 >> Author: aliguori >> Date: 2008-08-21 20:08:03 +0000 (Thu, 21 Aug 2008) >> >> Log Message: >> ----------- >> Handle terminating signals (Gerd Hoffmann) >> >> This patch makes qemu handle signals better. It sets the request_shutdown >> flag, making the main_loop exit and qemu taking the usual exit route, with >> atexit handlers being called and so on, instead of qemu just being killed >> by the signal. >> >> To avoid calling vm_start() from the signal handler main_loop() got an >> additional check so qemu_system_shutdown_request() works even when the >> vm is in stopped state. >> >> Signed-off-by: Gerd Hoffmann >> Signed-off-by: Anthony Liguori >> > > ... > >> Modified: trunk/vl.c >> =================================================================== >> --- trunk/vl.c 2008-08-21 19:33:09 UTC (rev 5054) >> +++ trunk/vl.c 2008-08-21 20:08:03 UTC (rev 5055) >> @@ -7621,6 +7621,8 @@ >> timeout = 0; >> } >> } else { >> + if (shutdown_requested) >> + break; >> timeout = 10; >> } >> #ifdef CONFIG_PROFILER > > Could we define the policy that no patch is merged which introduces new > compiler warnings? Fix below remove the one caused by the hunk above, > but it still leaves some doubts for the semi-informed reader because the > "if (shutdown_requested)" block under vm_running also checks for > no_shutdown. Please confirm that leaving it out here was by intention. > > Jan > > -------- > > Always return EXCP_INTERRUPT when leaving main_loop due to > shutdown_requested. > > Signed-off-by: Jan Kiszka > --- > vl.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > Index: b/vl.c > =================================================================== > --- a/vl.c > +++ b/vl.c > @@ -7624,8 +7624,10 @@ static int main_loop(void) > timeout = 0; > } > } else { > - if (shutdown_requested) > + if (shutdown_requested) { > + ret = EXCP_INTERRUPT; > break; > + } > timeout = 10; > } > #ifdef CONFIG_PROFILER After discussing how this issue slipped in, I think it was forgotten to actually merge the fix... :-> Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux