[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v2 12/24] numa: add numa_[has_]node_id() wrappers
From: |
David Gibson |
Subject: |
Re: [Qemu-arm] [PATCH v2 12/24] numa: add numa_[has_]node_id() wrappers |
Date: |
Fri, 5 May 2017 11:45:22 +1000 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Wed, May 03, 2017 at 02:57:06PM +0200, Igor Mammedov wrote:
> wrappers should make access to [has]node_id fields more readable
>
> Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Correct, though I'm not sure it actually simplifies things that much.
Maybe more in future patches, though.
> ---
> follow up patches will use this wrappers
> v2:
> - add wrappers (Drew)
> ---
> include/sysemu/numa.h | 10 ++++++++++
> numa.c | 2 +-
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/include/sysemu/numa.h b/include/sysemu/numa.h
> index 46ea6c7..98d01e6 100644
> --- a/include/sysemu/numa.h
> +++ b/include/sysemu/numa.h
> @@ -35,4 +35,14 @@ uint32_t numa_get_node(ram_addr_t addr, Error **errp);
> /* on success returns node index in numa_info,
> * on failure returns nb_numa_nodes */
> int numa_get_node_for_cpu(int idx);
> +
> +static inline bool numa_has_node_id(const CPUArchIdList *possible_cpus, int
> idx)
> +{
> + return possible_cpus->cpus[idx].props.has_node_id;
> +}
> +
> +static inline int numa_node_id(const CPUArchIdList *possible_cpus, int idx)
> +{
> + return possible_cpus->cpus[idx].props.node_id;
> +}
> #endif
> diff --git a/numa.c b/numa.c
> index c7e3e0a..872ee0d 100644
> --- a/numa.c
> +++ b/numa.c
> @@ -394,7 +394,7 @@ void parse_numa_opts(MachineState *ms)
>
> possible_cpus = mc->possible_cpu_arch_ids(ms);
> for (i = 0; i < possible_cpus->len; i++) {
> - if (possible_cpus->cpus[i].props.has_node_id) {
> + if (numa_has_node_id(possible_cpus, i)) {
> break;
> }
> }
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [Qemu-arm] [PATCH v2 11/24] numa: do default mapping based on possible_cpus instead of node_cpu bitmaps, (continued)
- [Qemu-arm] [PATCH v2 11/24] numa: do default mapping based on possible_cpus instead of node_cpu bitmaps, Igor Mammedov, 2017/05/03
- [Qemu-arm] [PATCH v2 13/24] pc: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu(), Igor Mammedov, 2017/05/03
- [Qemu-arm] [PATCH v2 14/24] spapr: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu(), Igor Mammedov, 2017/05/03
- [Qemu-arm] [PATCH v2 15/24] virt-arm: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu(), Igor Mammedov, 2017/05/03
- [Qemu-arm] [PATCH v2 12/24] numa: add numa_[has_]node_id() wrappers, Igor Mammedov, 2017/05/03
[Qemu-arm] [PATCH v2 16/24] QMP: include CpuInstanceProperties into query_cpus output output, Igor Mammedov, 2017/05/03
[Qemu-arm] [PATCH v2 17/24] tests: numa: add case for QMP command query-cpus, Igor Mammedov, 2017/05/03
[Qemu-arm] [PATCH v2 18/24] numa: remove no longer used numa_get_node_for_cpu(), Igor Mammedov, 2017/05/03
[Qemu-arm] [PATCH v2 20/24] machine: call machine init from wrapper, Igor Mammedov, 2017/05/03