Received: from eggs.gnu.org ([2001:4830:134:3::10]:51812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1zzY-0003Hj-0a for qemu-devel@nongnu.org; Mon, 08 Jun 2015 12:33:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1zzS-0008IX-Tx for qemu-devel@nongnu.org; Mon, 08 Jun 2015 12:33:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1zzS-0008IL-Pn for qemu-devel@nongnu.org; Mon, 08 Jun 2015 12:33:34 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 857C1C0165 for ; Mon, 8 Jun 2015 16:25:02 +0000 (UTC) Date: Mon, 8 Jun 2015 18:25:00 +0200 From: Igor Mammedov Message-ID: <20150608182500.32c17898@nial.brq.redhat.com> In-Reply-To: <5575B50C.30105@redhat.com> References: <1433776757-61958-1-git-send-email-imammedo@redhat.com> <1433776757-61958-5-git-send-email-imammedo@redhat.com> <5575B50C.30105@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v2 4/6] hostmem: return recreated MemoryRegion if current can't be reused List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com On Mon, 08 Jun 2015 17:30:20 +0200 Paolo Bonzini wrote: > > > On 08/06/2015 17:19, Igor Mammedov wrote: > > MemoryRegion * > > host_memory_backend_get_memory(HostMemoryBackend *backend, Error **errp) > > { > > + UserCreatableClass *ucc = USER_CREATABLE_GET_CLASS(backend); > > + > > + if (memory_region_is_hva_mapped(&backend->mr)) { > > + object_unparent(OBJECT(&backend->mr)); > > + ucc->complete(USER_CREATABLE(backend), errp); > > + } > > I'm not sure I understand this, and the commit message... doesn't help. > > Is it for the case where you unplug memory and then reuse the old > backend? yes > Can we just outlaw this, forcing each memory backend to be > used only once? to outlaw it gracefully without asserting QEMU during hotplug user should be able to detect that it's outlawed i.e. use memory_region_is_hva_mapped(), but yes we can. > > Paolo