From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:32902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqWNy-0007j3-3T for qemu-devel@nongnu.org; Mon, 08 Aug 2011 16:25:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqWNw-0005Vv-T9 for qemu-devel@nongnu.org; Mon, 08 Aug 2011 16:25:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqWNw-0005Vr-JH for qemu-devel@nongnu.org; Mon, 08 Aug 2011 16:25:16 -0400 Date: Mon, 8 Aug 2011 17:25:12 -0300 From: Luiz Capitulino Message-ID: <20110808172512.2cc080b1@doriath> In-Reply-To: <4E3FF24C.2090206@redhat.com> 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> <4E3FF24C.2090206@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: Avi Kivity Cc: blauwirbel@gmail.com, Jan Kiszka , aliguori@us.ibm.com, amit.shah@redhat.com, qemu-devel@nongnu.org On Mon, 08 Aug 2011 17:27:24 +0300 Avi Kivity wrote: > 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. Isn't it good enough? Another question: do you think that this problem is so relevant that we should include the fix in the first merge? > > 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". >