qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 3/3] exec: silence hugetlbfs warning under qtest


From: marcandre . lureau
Subject: [Qemu-devel] [PATCH 3/3] exec: silence hugetlbfs warning under qtest
Date: Mon, 16 Nov 2015 18:23:38 +0100

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

vhost-user-test prints a warning. A test should not need to run on
hugetlbfs, let's silence the warning under qtest. Unfortunately, the
condition can't check on qtest_enabled() or qtest_driver() since they
are initialized later. Moving configure_accelerator() earlier is
problematic, as the memory regions aren't yet fully set up and
vhost-user-test fails.

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

diff --git a/exec.c b/exec.c
index b09f18b..3edc582 100644
--- a/exec.c
+++ b/exec.c
@@ -1184,6 +1184,7 @@ void qemu_mutex_unlock_ramlist(void)
 static long gethugepagesize(const char *path, Error **errp)
 {
     struct statfs fs;
+    const char *p;
     int ret;
 
     do {
@@ -1196,8 +1197,11 @@ static long gethugepagesize(const char *path, Error 
**errp)
         return 0;
     }
 
-    if (fs.f_type != HUGETLBFS_MAGIC)
+    p = qemu_opt_get(qemu_get_machine_opts(), "accel");
+    if (g_strcmp0(p, "qtest") &&
+        fs.f_type != HUGETLBFS_MAGIC) {
         fprintf(stderr, "Warning: path not on HugeTLBFS: %s\n", path);
+    }
 
     return fs.f_bsize;
 }
-- 
2.5.0




reply via email to

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