From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLpPz-0002ld-Dh for qemu-devel@nongnu.org; Fri, 07 Mar 2014 02:42:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLpPq-0003gy-Ru for qemu-devel@nongnu.org; Fri, 07 Mar 2014 02:42:07 -0500 Received: from mail-ea0-x229.google.com ([2a00:1450:4013:c01::229]:38311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLpPq-0003gs-Km for qemu-devel@nongnu.org; Fri, 07 Mar 2014 02:41:58 -0500 Received: by mail-ea0-f169.google.com with SMTP id h14so2178400eaj.28 for ; Thu, 06 Mar 2014 23:41:57 -0800 (PST) Sender: Paolo Bonzini Message-ID: <53197842.6080901@redhat.com> Date: Fri, 07 Mar 2014 08:41:54 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1393941656-29068-1-git-send-email-pbonzini@redhat.com> <1393941656-29068-16-git-send-email-pbonzini@redhat.com> <20140307053311.GJ16105@G08FNSTD100614.fnst.cn.fujitsu.com> In-Reply-To: <20140307053311.GJ16105@G08FNSTD100614.fnst.cn.fujitsu.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2.1 15/28] numa: add -numa node, memdev= option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: ehabkost@redhat.com, mtosatti@redhat.com, qemu-devel@nongnu.org, a.motakis@virtualopensystems.com, imammedo@redhat.com, gaowanlong@cn.fujitsu.com Il 07/03/2014 06:33, Hu Tao ha scritto: > On Tue, Mar 04, 2014 at 03:00:43PM +0100, Paolo Bonzini wrote: >> This option provides the infrastructure for binding guest NUMA nodes >> to host NUMA nodes. For example: >> >> -object memory-ram,size=1024M,policy=membind,host-nodes=0,id=ram-node0 \ >> -numa node,nodeid=0,cpus=0,memdev=ram-node0 \ >> -object memory-ram,size=1024M,policy=interleave,host-nodes=1-3,id=ram-node1 \ >> -numa node,nodeid=1,cpus=1,memdev=ram-node1 >> >> The option replaces "-numa node,mem=". >> >> Signed-off-by: Paolo Bonzini >> --- >> include/sysemu/sysemu.h | 1 + >> numa.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++-- >> qapi-schema.json | 8 ++++++- >> qemu-options.hx | 12 ++++++---- >> 4 files changed, 77 insertions(+), 7 deletions(-) >> >> diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h >> index 54a6f28..4870129 100644 >> --- a/include/sysemu/sysemu.h >> +++ b/include/sysemu/sysemu.h >> @@ -139,6 +139,7 @@ extern int nb_numa_nodes; >> typedef struct node_info { >> uint64_t node_mem; >> DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS); >> + struct HostMemoryBackend *node_memdev; >> } NodeInfo; >> extern NodeInfo numa_info[MAX_NODES]; >> void set_numa_nodes(void); >> diff --git a/numa.c b/numa.c >> index 930f49d..b00ef90 100644 >> --- a/numa.c >> +++ b/numa.c >> @@ -32,6 +32,7 @@ >> #include "qapi/dealloc-visitor.h" >> #include "qapi/qmp/qerror.h" >> #include "hw/boards.h" >> +#include "sysemu/hostmem.h" >> >> QemuOptsList qemu_numa_opts = { >> .name = "numa", >> @@ -40,6 +41,8 @@ QemuOptsList qemu_numa_opts = { >> .desc = { { 0 } } /* validated with OptsVisitor */ >> }; >> >> +static int have_memdevs = -1; >> + > > bool? > > It is three-state and "-1" means "I haven't seen -numa yet". Because of the nodeid parameter you cannot change "have_memdevs == -1 to for example "nodenr == 0". Paolo