From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbuwI-0005L2-KQ for qemu-devel@nongnu.org; Thu, 31 Oct 2013 12:17:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbuwC-0006uB-GI for qemu-devel@nongnu.org; Thu, 31 Oct 2013 12:17:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbuwC-0006u3-76 for qemu-devel@nongnu.org; Thu, 31 Oct 2013 12:17:36 -0400 Message-ID: <52728294.9050305@redhat.com> Date: Thu, 31 Oct 2013 17:17:24 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20131024023903.GD16757@G08FNSTD100614.fnst.cn.fujitsu.com> <20131031143004.GA9948@redhat.com> <52726A0B.4080805@redhat.com> <52726B95.6020006@redhat.com> <20131031145234.GC9948@redhat.com> <52726FAA.6000502@redhat.com> <20131031150955.GE9948@redhat.com> <52727695.8080007@redhat.com> <20131031154556.GB10424@redhat.com> <52727D97.3070209@redhat.com> <20131031161404.GA10710@redhat.com> In-Reply-To: <20131031161404.GA10710@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] pvpanic plans? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: pkrempa@redhat.com, lersek@redhat.com, marcel.a@redhat.com, libvir-list@redhat.com, Hu Tao , qemu-devel@nongnu.org, armbru@redhat.com, rhod@redhat.com, kraxel@redhat.com, anthony@codemonkey.ws, lcapitulino@redhat.com, afaerber@suse.de Il 31/10/2013 17:14, Michael S. Tsirkin ha scritto: >> PANICKED->DEBUG was added by commit bc7d0e667. That commit can be >> reverted if the panicked state is removed from runstate_needs_reset. > > Okay so let's drop the code duplication and explicitly make > them the same? > > Signed-off-by: Michael S. Tsirkin > > > diff --git a/vl.c b/vl.c > index 46c29c4..e12d317 100644 > --- a/vl.c > +++ b/vl.c > @@ -638,10 +638,6 @@ static const RunStateTransition runstate_transitions_def[] = { > { RUN_STATE_WATCHDOG, RUN_STATE_RUNNING }, > { RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE }, > > - { RUN_STATE_GUEST_PANICKED, RUN_STATE_PAUSED }, > - { RUN_STATE_GUEST_PANICKED, RUN_STATE_FINISH_MIGRATE }, > - { RUN_STATE_GUEST_PANICKED, RUN_STATE_DEBUG }, > - > { RUN_STATE_MAX, RUN_STATE_MAX }, > }; > > @@ -660,6 +656,12 @@ static void runstate_init(void) > > for (p = &runstate_transitions_def[0]; p->from != RUN_STATE_MAX; p++) { > runstate_valid_transitions[p->from][p->to] = true; > + /* Panicked state is same as paused, we only made it different so > + * management can detect a panic. > + */ > + if (p->from == RUN_STATE_PAUSED) { > + runstate_valid_transitions[RUN_STATE_GUEST_PANICKED][p->to] = true; It makes only sense to me if you do that for IO_ERROR and WATCHDOG as well, and perhaps there are others I'm missing. Just add a comment before runstate_transitions_def's entries for PANICKED, IO_ERROR and WATCHDOG. But again, it is somewhat separate from the issue at hand, which is to finally make pvpanic usable and hopefully before 1.7. Paolo > + } > } > } > > @@ -686,8 +688,7 @@ int runstate_is_running(void) > bool runstate_needs_reset(void) > { > return runstate_check(RUN_STATE_INTERNAL_ERROR) || > - runstate_check(RUN_STATE_SHUTDOWN) || > - runstate_check(RUN_STATE_GUEST_PANICKED); > + runstate_check(RUN_STATE_SHUTDOWN); > } > > StatusInfo *qmp_query_status(Error **errp) >