qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/9] exec: check kvm mmu notifiers earlier


From: marcandre . lureau
Subject: [Qemu-devel] [PATCH 1/9] exec: check kvm mmu notifiers earlier
Date: Tue, 12 Apr 2016 13:55:21 +0200

From: Marc-André Lureau <address@hidden>

Move kvm mmu notifiers check before calling file_ram_alloc().
This shouldn't change the validation logic.

Signed-off-by: Marc-André Lureau <address@hidden>
---
 exec.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/exec.c b/exec.c
index c4f9036..dcc6632 100644
--- a/exec.c
+++ b/exec.c
@@ -1242,12 +1242,6 @@ static void *file_ram_alloc(RAMBlock *block,
     int fd = -1;
     int64_t page_size;
 
-    if (kvm_enabled() && !kvm_has_sync_mmu()) {
-        error_setg(errp,
-                   "host lacks kvm mmu notifiers, -mem-path unsupported");
-        return NULL;
-    }
-
     for (;;) {
         fd = open(path, O_RDWR);
         if (fd >= 0) {
@@ -1675,6 +1669,12 @@ RAMBlock *qemu_ram_alloc_from_file(ram_addr_t size, 
MemoryRegion *mr,
         return NULL;
     }
 
+    if (kvm_enabled() && !kvm_has_sync_mmu()) {
+        error_setg(errp,
+                   "host lacks kvm mmu notifiers, -mem-path unsupported");
+        return NULL;
+    }
+
     size = HOST_PAGE_ALIGN(size);
     new_block = g_malloc0(sizeof(*new_block));
     new_block->mr = mr;
-- 
2.5.5




reply via email to

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