From patchwork Mon Feb 23 19:29:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 442651 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B7E9C140134 for ; Tue, 24 Feb 2015 06:30:55 +1100 (AEDT) Received: from localhost ([::1]:45075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPyiT-0005vr-SF for incoming@patchwork.ozlabs.org; Mon, 23 Feb 2015 14:30:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPyhi-0004YS-6J for qemu-devel@nongnu.org; Mon, 23 Feb 2015 14:30:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YPyhb-00030s-VB for qemu-devel@nongnu.org; Mon, 23 Feb 2015 14:30:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPyhb-00030o-NE for qemu-devel@nongnu.org; Mon, 23 Feb 2015 14:29:59 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1NJTugZ032594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 23 Feb 2015 14:29:57 -0500 Received: from localhost (ovpn-113-200.phx2.redhat.com [10.3.113.200]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1NJTtml004505; Mon, 23 Feb 2015 14:29:56 -0500 From: Eduardo Habkost To: Peter Maydell Date: Mon, 23 Feb 2015 16:29:08 -0300 Message-Id: <1424719754-2356-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1424719754-2356-1-git-send-email-ehabkost@redhat.com> References: <1424719754-2356-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini , qemu-devel@nongnu.org, "Michael S. Tsirkin" Subject: [Qemu-devel] [PULL 1/7] numa: Move NUMA declarations from sysemu.h to numa.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Not all sysemu.h users need the NUMA declarations, and keeping them in a separate file makes it easier to see what are the interfaces provided by numa.c. Reviewed-by: Paolo Bonzini Acked-by: Michael S. Tsirkin Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 1 + hw/mem/pc-dimm.c | 1 + hw/ppc/spapr.c | 1 + include/sysemu/numa.h | 28 ++++++++++++++++++++++++++++ include/sysemu/sysemu.h | 18 ------------------ monitor.c | 1 + numa.c | 2 +- vl.c | 1 + 8 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 include/sysemu/numa.h diff --git a/hw/i386/pc.c b/hw/i386/pc.c index c7af6aa..0b31c14 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -41,6 +41,7 @@ #include "hw/pci/msi.h" #include "hw/sysbus.h" #include "sysemu/sysemu.h" +#include "sysemu/numa.h" #include "sysemu/kvm.h" #include "kvm_i386.h" #include "hw/xen/xen.h" diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 18cdc54..f27a087 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -22,6 +22,7 @@ #include "qemu/config-file.h" #include "qapi/visitor.h" #include "qemu/range.h" +#include "sysemu/numa.h" typedef struct pc_dimms_capacity { uint64_t size; diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 812d030..0f92bb2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -25,6 +25,7 @@ * */ #include "sysemu/sysemu.h" +#include "sysemu/numa.h" #include "hw/hw.h" #include "hw/fw-path-provider.h" #include "elf.h" diff --git a/include/sysemu/numa.h b/include/sysemu/numa.h new file mode 100644 index 0000000..514914f --- /dev/null +++ b/include/sysemu/numa.h @@ -0,0 +1,28 @@ +#ifndef SYSEMU_NUMA_H +#define SYSEMU_NUMA_H + +#include +#include "qemu/bitmap.h" +#include "qemu/option.h" +#include "sysemu/sysemu.h" +#include "sysemu/hostmem.h" + +extern int nb_numa_nodes; /* Number of NUMA nodes */ +extern int max_numa_nodeid; /* Highest specified NUMA node ID, plus one. + * For all nodes, nodeid < max_numa_nodeid + */ + +typedef struct node_info { + uint64_t node_mem; + DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS); + struct HostMemoryBackend *node_memdev; + bool present; +} NodeInfo; +extern NodeInfo numa_info[MAX_NODES]; +void set_numa_nodes(void); +void set_numa_modes(void); +void query_numa_node_mem(uint64_t node_mem[]); +extern QemuOptsList qemu_numa_opts; +int numa_init_func(QemuOpts *opts, void *opaque); + +#endif diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 748d059..a726659 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -147,24 +147,6 @@ extern int mem_prealloc; */ #define MAX_CPUMASK_BITS 255 -extern int nb_numa_nodes; /* Number of NUMA nodes */ -extern int max_numa_nodeid; /* Highest specified NUMA node ID, plus one. - * For all nodes, nodeid < max_numa_nodeid - */ - -typedef struct node_info { - uint64_t node_mem; - DECLARE_BITMAP(node_cpu, MAX_CPUMASK_BITS); - struct HostMemoryBackend *node_memdev; - bool present; -} NodeInfo; -extern NodeInfo numa_info[MAX_NODES]; -void set_numa_nodes(void); -void set_numa_modes(void); -void query_numa_node_mem(uint64_t node_mem[]); -extern QemuOptsList qemu_numa_opts; -int numa_init_func(QemuOpts *opts, void *opaque); - #define MAX_OPTION_ROMS 16 typedef struct QEMUOptionRom { const char *name; diff --git a/monitor.c b/monitor.c index c3cc060..8ee6b76 100644 --- a/monitor.c +++ b/monitor.c @@ -35,6 +35,7 @@ #include "sysemu/char.h" #include "ui/qemu-spice.h" #include "sysemu/sysemu.h" +#include "sysemu/numa.h" #include "monitor/monitor.h" #include "qemu/readline.h" #include "ui/console.h" diff --git a/numa.c b/numa.c index afd2866..40f3d36 100644 --- a/numa.c +++ b/numa.c @@ -22,7 +22,7 @@ * THE SOFTWARE. */ -#include "sysemu/sysemu.h" +#include "sysemu/numa.h" #include "exec/cpu-common.h" #include "qemu/bitmap.h" #include "qom/cpu.h" diff --git a/vl.c b/vl.c index 8c8f142..eca970e 100644 --- a/vl.c +++ b/vl.c @@ -78,6 +78,7 @@ int main(int argc, char **argv) #include "monitor/monitor.h" #include "ui/console.h" #include "sysemu/sysemu.h" +#include "sysemu/numa.h" #include "exec/gdbstub.h" #include "qemu/timer.h" #include "sysemu/char.h"