[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-cpu 07/59] cpus: Simplify set_numa_modes()
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-cpu 07/59] cpus: Simplify set_numa_modes() |
Date: |
Sun, 9 Jun 2013 21:12:34 +0200 |
Use new qemu_for_each_cpu().
Signed-off-by: Andreas Färber <address@hidden>
---
cpus.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/cpus.c b/cpus.c
index 1babecf..24ee974 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1188,22 +1188,22 @@ static void tcg_exec_all(void)
exit_request = 0;
}
-void set_numa_modes(void)
+static void set_one_numa_mode(CPUState *cpu, void *data)
{
- CPUArchState *env;
- CPUState *cpu;
int i;
- for (env = first_cpu; env != NULL; env = env->next_cpu) {
- cpu = ENV_GET_CPU(env);
- for (i = 0; i < nb_numa_nodes; i++) {
- if (test_bit(cpu->cpu_index, node_cpumask[i])) {
- cpu->numa_node = i;
- }
+ for (i = 0; i < nb_numa_nodes; i++) {
+ if (test_bit(cpu->cpu_index, node_cpumask[i])) {
+ cpu->numa_node = i;
}
}
}
+void set_numa_modes(void)
+{
+ qemu_for_each_cpu(set_one_numa_mode, NULL);
+}
+
void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
{
/* XXX: implement xxx_cpu_list for targets that still miss it */
--
1.8.1.4
- Re: [Qemu-devel] [PATCH qom-cpu 01/59] kvm: Change kvm_cpu_synchronize_state() argument to CPUState, (continued)
- [Qemu-devel] [PATCH qom-cpu 04/59] cpus: Simplify cpu_synchronize_all_post_init(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 02/59] kvm: Change cpu_synchronize_state() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 05/59] cpus: Simplify pause_all_vcpus(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 06/59] cpus: Simplify resume_all_vcpus(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 07/59] cpus: Simplify set_numa_modes(),
Andreas Färber <=
- [Qemu-devel] [PATCH qom-cpu 08/59] cpus: Simplify qmp_inject_nmi(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 09/59] cpus: Simplify hw_error(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 10/59] cpus: Simplify qemu_tcg_wait_io_event() and qemu_tcg_cpu_thread_fn(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 11/59] monitor: Simplify do_inject_mce(), Andreas Färber, 2013/06/09