From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqXxe-0002jQ-Be for qemu-devel@nongnu.org; Wed, 13 Apr 2016 23:28:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqXxd-0003BG-Jw for qemu-devel@nongnu.org; Wed, 13 Apr 2016 23:28:54 -0400 Received: from [59.151.112.132] (port=10869 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqXxc-0003Aw-VQ for qemu-devel@nongnu.org; Wed, 13 Apr 2016 23:28:53 -0400 References: <1460539671-11326-1-git-send-email-lizhijian@cn.fujitsu.com> <570E341A.4060201@redhat.com> From: Li Zhijian Message-ID: <570F0E6E.3000301@cn.fujitsu.com> Date: Thu, 14 Apr 2016 11:28:46 +0800 MIME-Version: 1.0 In-Reply-To: <570E341A.4060201@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed 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: Paolo Bonzini , qemu-devel@nongnu.org, Gerd Hoffmann , Juan Quintela , Peter Maydell I send V2 with minor fix - fix patch title typo 'chanage' -> 'change' - coding sytle: 'return ;' -> 'return;' - add Acked tag pls review the V2. Best regards Li Zhijian On 04/13/2016 07:57 PM, Paolo Bonzini wrote: > 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], >> > > >