From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqJQA-0004GE-V6 for qemu-devel@nongnu.org; Wed, 13 Apr 2016 07:57:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqJQ6-0003BX-V8 for qemu-devel@nongnu.org; Wed, 13 Apr 2016 07:57:22 -0400 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]:33917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqJQ6-0003Ac-P0 for qemu-devel@nongnu.org; Wed, 13 Apr 2016 07:57:18 -0400 Received: by mail-pa0-x232.google.com with SMTP id ot11so32445423pab.1 for ; Wed, 13 Apr 2016 04:57:18 -0700 (PDT) Sender: Paolo Bonzini References: <1460539671-11326-1-git-send-email-lizhijian@cn.fujitsu.com> From: Paolo Bonzini Message-ID: <570E341A.4060201@redhat.com> Date: Wed, 13 Apr 2016 13:57:14 +0200 MIME-Version: 1.0 In-Reply-To: <1460539671-11326-1-git-send-email-lizhijian@cn.fujitsu.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vl: chanage runstate only if new state is different from current state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Li Zhijian , qemu-devel@nongnu.org, Gerd Hoffmann , Juan Quintela , Peter Maydell On 13/04/2016 11:27, Li Zhijian wrote: > Previously, qemu will abort at following scenario: > (qemu) stop > (qemu) system_reset > (qemu) system_reset > (qemu) 2016-04-13T20:54:38.979158Z qemu-system-x86_64: invalid runstate transition: 'prelaunch' -> 'prelaunch' > > Signed-off-by: Li Zhijian Acked-by: Paolo Bonzini Can someone I've CCed help this patch, since I won't be able to send a pull request? Paolo > vl.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/vl.c b/vl.c > index 9df534f..039a353 100644 > --- a/vl.c > +++ b/vl.c > @@ -692,6 +692,10 @@ void runstate_set(RunState new_state) > { > assert(new_state < RUN_STATE__MAX); > > + if (current_run_state == new_state) { > + return ; > + } > + > if (!runstate_valid_transitions[current_run_state][new_state]) { > error_report("invalid runstate transition: '%s' -> '%s'", > RunState_lookup[current_run_state], >