From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkxoi-00010e-78 for qemu-devel@nongnu.org; Mon, 25 Nov 2013 10:11:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vkxoc-0003cY-7O for qemu-devel@nongnu.org; Mon, 25 Nov 2013 10:11:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkxob-0003cS-UZ for qemu-devel@nongnu.org; Mon, 25 Nov 2013 10:11:10 -0500 Date: Mon, 25 Nov 2013 16:10:52 +0100 From: Igor Mammedov Message-ID: <20131125161052.0966dce5@nial.usersys.redhat.com> In-Reply-To: <5293492D.3050607@redhat.com> References: <1385001528-12003-1-git-send-email-imammedo@redhat.com> <1385001528-12003-9-git-send-email-imammedo@redhat.com> <5293492D.3050607@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/27] dimm: implement dimm device abstraction 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 Mon, 25 Nov 2013 13:57:17 +0100 Paolo Bonzini wrote: > Il 21/11/2013 03:38, Igor Mammedov ha scritto: > > +static void dimm_initfn(Object *obj) > > +{ > > + object_property_add(obj, "memdev", "string", dimm_get_memdev, > > + dimm_set_memdev, NULL, NULL, NULL); > > Perhaps, instead of relying on memory_region_owner, you could have > separate pointers for the MemoryBackend* and MemoryRegion*. Then this > property could be a link type (it looks like a link, and > quacks like a link). In initial implementation I had 'backend' property which was exactly just link<> to backend. but when adding dimm (CLI/Moinitor), I had to specify full QOM path to backend which looked like -device dimm,id=foo1,backend=/backend/memdev[foo2] which was ugly. So I moved to a currently used model by netdev and replaced it with 'memdev' property. But since then backend path has changed to /backend/memdev/foo so I guess it should be possible to use backend=foo for partial path resolving should yield object without full path. The only downside would be backend instance name in global name space. > Paolo > > > + object_property_add(obj, "size", "int", dimm_get_size, > > + NULL, NULL, NULL, NULL); > > +} > > + >