From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkycD-0003Cd-DG for qemu-devel@nongnu.org; Mon, 25 Nov 2013 11:02:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vkyc7-0002qz-Cv for qemu-devel@nongnu.org; Mon, 25 Nov 2013 11:02:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkyc7-0002qv-3v for qemu-devel@nongnu.org; Mon, 25 Nov 2013 11:02:19 -0500 Date: Mon, 25 Nov 2013 17:01:58 +0100 From: Igor Mammedov Message-ID: <20131125170158.1258f535@nial.usersys.redhat.com> In-Reply-To: <52934872.60904@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> 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 Mon, 25 Nov 2013 13:54:10 +0100 Paolo Bonzini wrote: > Il 21/11/2013 03:38, Igor Mammedov ha scritto: > > + > > + /* verify properties correctnes and initialize backend */ > > + bc = MEMORY_BACKEND_GET_CLASS(obj); > > + if (bc->get_memory) { > > + HostMemoryBackend *backend = MEMORY_BACKEND(obj); > > + if (!bc->get_memory(backend, &local_err)) { > > + goto out; > > + } > > + } > > So this is why you need a new command-line option. > > I think we need a generic mechanism for post-initialization of whatever > is given on the command line. Perhaps you can do that with an > interface, and get rid of -memdev and memdev_add altogether? > > MemoryBackend's implementation of the interface's sole method would call > get_memory, of course. What I would use instead of memdev_add in CLI/HMP/QMP? Could you explain it a bit more, please? > Paolo > > > + /* make backend available to the world via QOM tree */ > > + object_property_add_child(container_get(qemu_get_backend(), "/memdev"), > > + qemu_opts_id(opts), obj, &local_err); >