qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Hu Tao <hutao@cn.fujitsu.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/7] numa: Move NUMA declarations from sysemu.h to numa.h
Date: Mon, 9 Feb 2015 17:17:38 +0100	[thread overview]
Message-ID: <20150209161738.GA7542@redhat.com> (raw)
In-Reply-To: <1423421482-11619-2-git-send-email-ehabkost@redhat.com>

On Sun, Feb 08, 2015 at 04:51:16PM -0200, Eduardo Habkost wrote:
> Not all sysemu.h users need the NUMA declarations, and keeping them in a
> separate file makes easier to see what are the interfaces provided by

s/makes easier/makes it easier/

> numa.c.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  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 b560459..e754262 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 <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 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 5a24311..4de3a8c 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 983259b..63ec996 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"
> -- 
> 2.1.0

  reply	other threads:[~2015-02-09 16:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-08 18:51 [Qemu-devel] [PATCH 0/7] NUMA code cleanup Eduardo Habkost
2015-02-08 18:51 ` [Qemu-devel] [PATCH 1/7] numa: Move NUMA declarations from sysemu.h to numa.h Eduardo Habkost
2015-02-09 16:17   ` Michael S. Tsirkin [this message]
2015-02-08 18:51 ` [Qemu-devel] [PATCH 2/7] vl.c: Remove unnecessary zero-initialization of NUMA globals Eduardo Habkost
2015-02-08 18:51 ` [Qemu-devel] [PATCH 3/7] numa: Move NUMA globals to numa.c Eduardo Habkost
2015-02-08 18:51 ` [Qemu-devel] [PATCH 4/7] numa: Make max_numa_nodeid static Eduardo Habkost
2015-02-08 18:51 ` [Qemu-devel] [PATCH 5/7] numa: Move QemuOpts parsing to set_numa_nodes() Eduardo Habkost
2015-02-08 18:51 ` [Qemu-devel] [PATCH 6/7] numa: Rename option parsing functions Eduardo Habkost
2015-02-08 18:51 ` [Qemu-devel] [PATCH 7/7] numa: Rename set_numa_modes() to numa_post_machine_init() Eduardo Habkost
2015-02-09  9:16 ` [Qemu-devel] [PATCH 0/7] NUMA code cleanup Paolo Bonzini
2015-02-09 14:53   ` Eduardo Habkost
2015-02-09 16:02     ` Paolo Bonzini
2015-02-09 16:20     ` Michael S. Tsirkin
2015-02-12 16:49       ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150209161738.GA7542@redhat.com \
    --to=mst@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).