From patchwork Sun Jun 9 19:12:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 250083 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C6A0E2C0084 for ; Mon, 10 Jun 2013 05:16:28 +1000 (EST) Received: from localhost ([::1]:60318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ull6I-0002ub-Rg for incoming@patchwork.ozlabs.org; Sun, 09 Jun 2013 15:16:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ull3m-0007p3-K4 for qemu-devel@nongnu.org; Sun, 09 Jun 2013 15:13:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ull3k-0000NC-Vf for qemu-devel@nongnu.org; Sun, 09 Jun 2013 15:13:50 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44348 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ull3k-0000N2-Ns for qemu-devel@nongnu.org; Sun, 09 Jun 2013 15:13:48 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 53D28A51CB for ; Sun, 9 Jun 2013 21:13:48 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sun, 9 Jun 2013 21:12:34 +0200 Message-Id: <1370805206-26574-8-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1370805206-26574-1-git-send-email-afaerber@suse.de> References: <1370805206-26574-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH qom-cpu 07/59] cpus: Simplify set_numa_modes() 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 Use new qemu_for_each_cpu(). Signed-off-by: Andreas Färber Reviewed-by: liguang --- 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 */