summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2015-02-08 16:51:16 -0200
committerEduardo Habkost <ehabkost@redhat.com>2015-02-23 15:39:27 -0300
commite35704ba9ce0cd1e3c401f3bfbf3faf98b0b6885 (patch)
tree61653fc5b5ee23cda1226ac65fb9abf09cf92e9e
parentcd2d5541271f1934345d8ca42f5fafff1744eee7 (diff)
downloadqemu-e35704ba9ce0cd1e3c401f3bfbf3faf98b0b6885.tar.gz
numa: Move NUMA declarations from sysemu.h to numa.h
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 <pbonzini@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--hw/i386/pc.c1
-rw-r--r--hw/mem/pc-dimm.c1
-rw-r--r--hw/ppc/spapr.c1
-rw-r--r--include/sysemu/numa.h28
-rw-r--r--include/sysemu/sysemu.h18
-rw-r--r--monitor.c1
-rw-r--r--numa.c2
-rw-r--r--vl.c1
8 files changed, 34 insertions, 19 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index c7af6aae01..0b31c1488a 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 18cdc54bf9..f27a087061 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 812d03054d..0f92bb2df2 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 0000000000..514914f9a9
--- /dev/null
+++ b/include/sysemu/numa.h
@@ -0,0 +1,28 @@
+#ifndef SYSEMU_NUMA_H
+#define SYSEMU_NUMA_H
+
+#include <stdint.h>
+#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 748d0597f0..a72665919b 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 c3cc060b45..8ee6b76cd6 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 afd28666b3..40f3d36472 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 8c8f14287e..eca970e985 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"