From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v13 4/8] add a new runstate: RUN_STATE_GUEST_PANICKED Date: Tue, 05 Mar 2013 09:26:18 +0100 Message-ID: <5135AC2A.8010008@redhat.com> References: <51346BFF.5000704@redhat.com> <20130305031701.GN16362@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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" To: Hu Tao Return-path: In-Reply-To: <20130305031701.GN16362@localhost.localdomain> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org 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. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754651Ab3CEI12 (ORCPT ); Tue, 5 Mar 2013 03:27:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7642 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753478Ab3CEI10 (ORCPT ); Tue, 5 Mar 2013 03:27:26 -0500 Message-ID: <5135AC2A.8010008@redhat.com> Date: Tue, 05 Mar 2013 09:26:18 +0100 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Hu Tao CC: kvm list , qemu-devel , "linux-kernel@vger.kernel.org" , "Daniel P. Berrange" , KAMEZAWA Hiroyuki , Jan Kiszka , Gleb Natapov , Blue Swirl , Eric Blake , Andrew Jones , Marcelo Tosatti , Sasha Levin , Luiz Capitulino , Anthony Liguori , Markus Armbruster , Stefan Hajnoczi , Juan Quintela , Orit Wasserman , Kevin Wolf , Wen Congyang , "Michael S. Tsirkin" , Alexander Graf , Alex Williamson , Peter Maydell Subject: Re: [PATCH v13 4/8] add a new runstate: RUN_STATE_GUEST_PANICKED References: <51346BFF.5000704@redhat.com> <20130305031701.GN16362@localhost.localdomain> In-Reply-To: <20130305031701.GN16362@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCnCs-0005DP-1w for qemu-devel@nongnu.org; Tue, 05 Mar 2013 03:26:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCnCq-00039A-W4 for qemu-devel@nongnu.org; Tue, 05 Mar 2013 03:26:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCnCq-000392-Mc for qemu-devel@nongnu.org; Tue, 05 Mar 2013 03:26:40 -0500 Message-ID: <5135AC2A.8010008@redhat.com> Date: Tue, 05 Mar 2013 09:26:18 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <51346BFF.5000704@redhat.com> <20130305031701.GN16362@localhost.localdomain> In-Reply-To: <20130305031701.GN16362@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: Hu Tao 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" 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. Paolo