qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] backends/hostmem: Ignore ENOSYS while setting MPOL_


From: Pavel Fedin
Subject: [Qemu-devel] [PATCH] backends/hostmem: Ignore ENOSYS while setting MPOL_DEFAULT
Date: Tue, 27 Oct 2015 15:11:22 +0300

Currently hostmem backend fails if CONFIG_NUMA is enabled for the qemu
(default), but NUMA is not supported by the kernel. This makes it
impossible to use ivshmem in such configurations.

This patch fixes the problem by ignoring ENOSYS error if policy is set to
MPOL_DEFAULT. This way the code behaves in the same way as if CONFIG_NUMA
was not defined. qemu will still fail if the user specifies some other
policy, so that the user knows it.

Signed-off-by: Pavel Fedin <address@hidden>
---
 backends/hostmem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/backends/hostmem.c b/backends/hostmem.c
index 41ba2af..826141b 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -313,9 +313,11 @@ host_memory_backend_memory_complete(UserCreatable *uc, 
Error **errp)
         assert(maxnode <= MAX_NODES);
         if (mbind(ptr, sz, backend->policy,
                   maxnode ? backend->host_nodes : NULL, maxnode + 1, flags)) {
-            error_setg_errno(errp, errno,
+            if ((backend->policy != MPOL_DEFAULT) || (errno != ENOSYS)) {
+                error_setg_errno(errp, errno,
                              "cannot bind memory to host NUMA nodes");
-            return;
+                return;
+            }
         }
 #endif
         /* Preallocate memory after the NUMA policy has been instantiated.
-- 
1.9.5.msysgit.0





reply via email to

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