Received: from eggs.gnu.org ([2001:4830:134:3::10]:49622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr3kV-0005aA-Df for qemu-devel@nongnu.org; Tue, 27 Oct 2015 08:53:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zr3kP-0002VP-E8 for qemu-devel@nongnu.org; Tue, 27 Oct 2015 08:53:11 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:28777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr3kP-0002VG-95 for qemu-devel@nongnu.org; Tue, 27 Oct 2015 08:53:05 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NWV00L2PQGGO420@mailout2.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 27 Oct 2015 12:53:04 +0000 (GMT) From: Pavel Fedin References: <000201d110b6$34ecc700$9ec65500$@samsung.com> In-reply-to: <000201d110b6$34ecc700$9ec65500$@samsung.com> Date: Tue, 27 Oct 2015 15:53:02 +0300 Message-id: <000301d110b6$6b4f33a0$41ed9ae0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-language: ru Subject: Re: [Qemu-devel] [PATCH] backends/hostmem: Ignore ENOSYS while setting MPOL_DEFAULT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: 'Paolo Bonzini' , 'Eduardo Habkost' Sorry, guys, i forgot to add "v2" and simply sent the mail. Log is: v1 => v2: - Removed unnecessary parenthesis Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia > -----Original Message----- > From: qemu-devel-bounces+p.fedin=samsung.com@nongnu.org [mailto:qemu-devel- > bounces+p.fedin=samsung.com@nongnu.org] On Behalf Of Pavel Fedin > Sent: Tuesday, October 27, 2015 3:52 PM > To: qemu-devel@nongnu.org > Cc: 'Paolo Bonzini'; 'Eduardo Habkost' > Subject: [Qemu-devel] [PATCH] backends/hostmem: Ignore ENOSYS while setting MPOL_DEFAULT > > 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 > --- > backends/hostmem.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/backends/hostmem.c b/backends/hostmem.c > index 41ba2af..94a4ac0 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 >