From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDAFq-0005ib-Gm for qemu-devel@nongnu.org; Wed, 06 Mar 2013 04:03:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDAFl-000348-QK for qemu-devel@nongnu.org; Wed, 06 Mar 2013 04:03:18 -0500 Received: from [222.73.24.84] (port=55567 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDAFl-00033N-FQ for qemu-devel@nongnu.org; Wed, 06 Mar 2013 04:03:13 -0500 Date: Wed, 6 Mar 2013 17:03:18 +0800 From: Hu Tao Message-ID: <20130306090318.GC4719@localhost.localdomain> References: <51346BFF.5000704@redhat.com> <20130305031701.GN16362@localhost.localdomain> <5135AC2A.8010008@redhat.com> MIME-Version: 1.0 In-Reply-To: <5135AC2A.8010008@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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: Paolo Bonzini 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" On Tue, Mar 05, 2013 at 09:26:18AM +0100, Paolo Bonzini wrote: > 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. See it now. Thanks!