qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v2 4/6] hostmem: return recreated MemoryRegion if curr


From: Igor Mammedov
Subject: [Qemu-devel] [RFC v2 4/6] hostmem: return recreated MemoryRegion if current can't be reused
Date: Mon, 8 Jun 2015 17:19:15 +0200

Signed-off-by: Igor Mammedov <address@hidden>
---
 backends/hostmem.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/backends/hostmem.c b/backends/hostmem.c
index 2a8614d..4486483 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -283,6 +283,12 @@ static void host_memory_backend_init(Object *obj)
 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);
+    }
     return memory_region_size(&backend->mr) ? &backend->mr : NULL;
 }
 
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]