From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCnCs-0005DP-1w for qemu-devel@nongnu.org; Tue, 05 Mar 2013 03:26:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCnCq-00039A-W4 for qemu-devel@nongnu.org; Tue, 05 Mar 2013 03:26:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCnCq-000392-Mc for qemu-devel@nongnu.org; Tue, 05 Mar 2013 03:26:40 -0500 Message-ID: <5135AC2A.8010008@redhat.com> Date: Tue, 05 Mar 2013 09:26:18 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <51346BFF.5000704@redhat.com> <20130305031701.GN16362@localhost.localdomain> In-Reply-To: <20130305031701.GN16362@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v13 4/8] add a new runstate: RUN_STATE_GUEST_PANICKED List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: Peter Maydell , Gleb Natapov , "Michael S. Tsirkin" , Jan Kiszka , qemu-devel , Markus Armbruster , Blue Swirl , Orit Wasserman , kvm list , Juan Quintela , Alexander Graf , Andrew Jones , Alex Williamson , Sasha Levin , Stefan Hajnoczi , Luiz Capitulino , KAMEZAWA Hiroyuki , Kevin Wolf , Anthony Liguori , Marcelo Tosatti , "linux-kernel@vger.kernel.org" Il 05/03/2013 04:17, Hu Tao ha scritto: > Will > > if (runstate_check(RUN_STATE_INTERNAL_ERROR) || > runstate_check(RUN_STATE_SHUTDOWN) || > runstate_check(RUN_STATE_GUEST_PANICKED)) { > runstate_set(RUN_STATE_PAUSED); > } > > be OK? Or I must be misunderstanding you. > Please move return (runstate_check(RUN_STATE_INTERNAL_ERROR) || runstate_check(RUN_STATE_SHUTDOWN) || runstate_check(RUN_STATE_GUEST_PANICKED)); to a separate function (runstate_needs_reset for example), so that you can reuse it in the two or three places that need it. Paolo