From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeM40-0000DN-9c for qemu-devel@nongnu.org; Tue, 12 Jun 2012 04:03:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeM3t-0007Hr-OQ for qemu-devel@nongnu.org; Tue, 12 Jun 2012 04:02:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeM3t-0007H0-GR for qemu-devel@nongnu.org; Tue, 12 Jun 2012 04:02:49 -0400 Message-ID: <4FD6F7A2.6000203@redhat.com> Date: Tue, 12 Jun 2012 10:02:42 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <4FD66B8F.4080203@codemonkey.ws> In-Reply-To: <4FD66B8F.4080203@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Semantics of DeviceState::realized and BlockDriverState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , qemu-devel , Stefan Hajnoczi , =?ISO-8859-1?Q?Andreas_F=E4rber?= Am 12.06.2012 00:05, schrieb Anthony Liguori: > To me, realized represents Vcc. When realized=true, the guest has power and is > active. When realized=false, the guest has lost power. The realize() event is > the rising edge of Vcc, unrealized() is the falling edge. > > realize() should be used to take any actions that require all parameters to be > set that need to happen before the guest has power. This later clause is > extremely important. unrealize() should be used to unset anything setup in > realize(). The one thing I'm really unsure about is whether you're combining two different things into one concept: This Vcc concept and Andreas' OOP concept (which is btw the same as I understood realize before we discussed yesterday on IRC - I guess you must have explained it as such at some point). Is it really always the power-on event that causes the final check of properties, setup of device state and makes some properties read-only? Or is that just a coincidence and happens to be true only with some devices? > The destructor being invoked does not imply that unrealize() has happened. Which makes some sense in your Vcc model, but doesn't at all in the OOP concept model. Kevin