qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 01/12] Fix -mem-path with hugetlbfs


From: Marcelo Tosatti
Subject: [Qemu-devel] [PATCH 01/12] Fix -mem-path with hugetlbfs
Date: Wed, 12 May 2010 18:24:55 -0300

Fallback to qemu_vmalloc in case file_ram_alloc fails.

Signed-off-by: Marcelo Tosatti <address@hidden>
Signed-off-by: Avi Kivity <address@hidden>
---
 exec.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/exec.c b/exec.c
index 3416aed..56b5561 100644
--- a/exec.c
+++ b/exec.c
@@ -2775,8 +2775,12 @@ ram_addr_t qemu_ram_alloc(ram_addr_t size)
     if (mem_path) {
 #if defined (__linux__) && !defined(TARGET_S390X)
         new_block->host = file_ram_alloc(size, mem_path);
-        if (!new_block->host)
-            exit(1);
+        if (!new_block->host) {
+            new_block->host = qemu_vmalloc(size);
+#ifdef MADV_MERGEABLE
+            madvise(new_block->host, size, MADV_MERGEABLE);
+#endif
+        }
 #else
         fprintf(stderr, "-mem-path option unsupported\n");
         exit(1);
-- 
1.6.6.1




reply via email to

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