From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlhVT-0002pY-9f for qemu-devel@nongnu.org; Wed, 27 Nov 2013 10:58:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlhVM-00044D-NK for qemu-devel@nongnu.org; Wed, 27 Nov 2013 10:58:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlhVM-000448-ER for qemu-devel@nongnu.org; Wed, 27 Nov 2013 10:58:20 -0500 Date: Wed, 27 Nov 2013 16:57:59 +0100 From: Igor Mammedov Message-ID: <20131127165759.577d15f8@nial.usersys.redhat.com> In-Reply-To: <52960DF3.5070200@redhat.com> References: <1385001528-12003-1-git-send-email-imammedo@redhat.com> <1385001528-12003-8-git-send-email-imammedo@redhat.com> <52934872.60904@redhat.com> <20131125170158.1258f535@nial.usersys.redhat.com> <52937641.30003@redhat.com> <20131127153752.2d5d7220@nial.usersys.redhat.com> <52960DF3.5070200@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, mdroth@linux.vnet.ibm.com, mst@redhat.com, mjt@tls.msk.ru, stefanb@linux.vnet.ibm.com, stefanha@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, vasilis.liaskovitis@profitbricks.com, quintela@redhat.com, chegu_vinod@hp.com, kraxel@redhat.com, aliguori@amazon.com, hutao@cn.fujitsu.com, marcel.a@redhat.com, lcapitulino@redhat.com, afaerber@suse.de On Wed, 27 Nov 2013 16:21:23 +0100 Paolo Bonzini wrote: > Il 27/11/2013 15:37, Igor Mammedov ha scritto: > > It looks like "realize" for -object / object-add implemented via > > an interface. > > It does---but without unrealize and with the additional get_base_path. > > > Maybe it should be renamed from QOMCommandLineIface to QOMRealizeIface > > and s/complete/realize/ so anyone who knows about Device.realize would > > get meaning without digging in complete() implementations. > > There is an important difference; realize is an internal method in > Device, the external interface is the property. So perhaps it's the > other way round; if Device implements QOMCommandLineIface you could > start creating devices with -object. > > > Alternative would be to behave just like Rng/Tpm do, i.e. use -object > > to do late initialization in a backend user (DimmDevice.realize). > > Draw back of it would be user won't get error during the first command > > "object-add" and only will get error when creating DimmDevice calling > > "device_add". > > That's also a possibility. But again, maybe it's the other way round > and Rng/Tpm could enjoy better error handling if we add the interface. Sure, I'll try to do as you described, it's much better to get error earlier and from command/object that throws it than via proxy. Thanks for suggestion, looking at netdev-add I even haven't thought about using -object. > Paolo