From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqQni-0000su-TC for qemu-devel@nongnu.org; Mon, 08 Aug 2011 10:27:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqQnh-0000Y9-OM for qemu-devel@nongnu.org; Mon, 08 Aug 2011 10:27:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqQnh-0000Xn-G5 for qemu-devel@nongnu.org; Mon, 08 Aug 2011 10:27:29 -0400 Message-ID: <4E3FF24C.2090206@redhat.com> Date: Mon, 08 Aug 2011 17:27:24 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1312384643-581-1-git-send-email-lcapitulino@redhat.com> <1312384643-581-3-git-send-email-lcapitulino@redhat.com> <4E3A6C8C.8060304@redhat.com> <4E3A71D3.6030700@siemens.com> <4E3FC6E6.1050202@redhat.com> <20110808102510.6d315297@doriath> <4E3FE429.4010509@redhat.com> <20110808102858.54ab1b55@doriath> <4E3FE741.7060302@redhat.com> <20110808104714.6d8aeea4@doriath> <4E3FEA88.7040407@redhat.com> <20110808110625.2f96a8e0@doriath> In-Reply-To: <20110808110625.2f96a8e0@doriath> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/7] Replace VMSTOP macros with a proper QemuState type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: blauwirbel@gmail.com, Jan Kiszka , aliguori@us.ibm.com, amit.shah@redhat.com, qemu-devel@nongnu.org On 08/08/2011 05:06 PM, Luiz Capitulino wrote: > > > > This is why I suggested a reference count. In this case, we can always > > stop the guest "twice", because we don't lost information when we resume. > > I could give it a try in the near future, as I really think it's independent > from this series, but I still don't understand what can stop an already stopped > VM besides the user. This is a real question, is it really possible? > > If only the user can do that, then the refcount is overkill as just returning > an error will do it. Most of the reasons in QemuState are asynchronous and can happen at any time while the guest is running. Because they're asynchronous, they can trigger before a monitor stop is issued but caught after it is processed. We could possibly synchronize during user stop, but that lets us capture only the first non-user reason. And even if we return an error, that only pushes the refcounting to the user; you probably don't want to return a "vm is already stopped" error to the user, he'll just ask "why are you telling me that". -- error compiling committee.c: too many arguments to function