From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0o5v-0006HD-2a for qemu-devel@nongnu.org; Mon, 23 Nov 2015 05:11:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0o5r-0000Ot-PC for qemu-devel@nongnu.org; Mon, 23 Nov 2015 05:11:34 -0500 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:32939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0o5r-0000OY-D8 for qemu-devel@nongnu.org; Mon, 23 Nov 2015 05:11:31 -0500 Received: by wmec201 with SMTP id c201so152555978wme.0 for ; Mon, 23 Nov 2015 02:11:30 -0800 (PST) Sender: Paolo Bonzini References: <00d101d125ba$03752a50$0a5f7ef0$@samsung.com> <5652E5F4.9030408@redhat.com> From: Paolo Bonzini Message-ID: <5652E650.8090408@redhat.com> Date: Mon, 23 Nov 2015 11:11:28 +0100 MIME-Version: 1.0 In-Reply-To: <5652E5F4.9030408@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] PING: [PATCH] backends/hostmem: Ignore ENOSYS while setting MPOL_DEFAULT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Fedin , 'Eduardo Habkost' Cc: qemu-devel@nongnu.org On 23/11/2015 11:09, Paolo Bonzini wrote: > On 23/11/2015 07:41, Pavel Fedin wrote: >> Hello! No news for a long time, we are at RC stage. Could we get this in? > > Yes, queued for -rc2. ... doh, Eduardo applied it to the NUMA tree already. I missed that backends/hostmem* is under NUMA and not memory. Paolo > Paolo > >> 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 Eduardo Habkost >>> Sent: Tuesday, October 27, 2015 8:32 PM >>> To: Pavel Fedin >>> Cc: 'Paolo Bonzini'; qemu-devel@nongnu.org >>> Subject: Re: [Qemu-devel] [PATCH] backends/hostmem: Ignore ENOSYS while setting MPOL_DEFAULT >>> >>> On Tue, Oct 27, 2015 at 03:51:31PM +0300, Pavel Fedin wrote: >>>> 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 >>> >>> Reviewed-by: Eduardo Habkost >>> >>> Thanks. Applied to numa tree, with the following indentation fix: >>> >>> diff --git a/backends/hostmem.c b/backends/hostmem.c >>> index 94a4ac0..1b4eb45 100644 >>> --- a/backends/hostmem.c >>> +++ b/backends/hostmem.c >>> @@ -315,7 +315,7 @@ host_memory_backend_memory_complete(UserCreatable *uc, Error **errp) >>> maxnode ? backend->host_nodes : NULL, maxnode + 1, flags)) { >>> if (backend->policy != MPOL_DEFAULT || errno != ENOSYS) { >>> error_setg_errno(errp, errno, >>> - "cannot bind memory to host NUMA nodes"); >>> + "cannot bind memory to host NUMA nodes"); >>> return; >>> } >>> } >>> >>>> --- >>>> 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 >>>> >>>> >>> >>> -- >>> Eduardo >> >> >> > >