From: Marc-André Lureau <marcandre.lur...@redhat.com>

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 <marcandre.lur...@redhat.com>
---
 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