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 Content-Length: 894 Lines: 27 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/