From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlhYA-0005hI-OB for qemu-devel@nongnu.org; Wed, 27 Nov 2013 11:01:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlhY4-0005BG-Bz for qemu-devel@nongnu.org; Wed, 27 Nov 2013 11:01:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlhY4-0005BB-3C for qemu-devel@nongnu.org; Wed, 27 Nov 2013 11:01:08 -0500 Message-ID: <52960DF3.5070200@redhat.com> Date: Wed, 27 Nov 2013 16:21:23 +0100 From: Paolo Bonzini MIME-Version: 1.0 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> In-Reply-To: <20131127153752.2d5d7220@nial.usersys.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 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: Igor Mammedov 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 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. Paolo