From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avEb7-0001Tt-IB for qemu-devel@nongnu.org; Tue, 26 Apr 2016 21:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avEb4-0007Nq-Bx for qemu-devel@nongnu.org; Tue, 26 Apr 2016 21:49:01 -0400 Received: from [59.151.112.132] (port=23233 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avEb2-0007Mi-Gj for qemu-devel@nongnu.org; Tue, 26 Apr 2016 21:48:58 -0400 References: <1460604352-18630-1-git-send-email-lizhijian@cn.fujitsu.com> From: Li Zhijian Message-ID: <57201A78.5020802@cn.fujitsu.com> Date: Wed, 27 Apr 2016 09:48:40 +0800 MIME-Version: 1.0 In-Reply-To: <1460604352-18630-1-git-send-email-lizhijian@cn.fujitsu.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] vl: change runstate only if new state is different from current state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pbonzini@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com, quintela@redhat.com, peter.maydell@linaro.org ping... Thanks Li Zhijian On 04/14/2016 11:25 AM, 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 > --- > from v1 > - fix patch title typo 'chanage' -> 'change' > - coding sytle: 'return ;' -> 'return;' > - add Acked tag > 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], >