From patchwork Wed Apr 11 21:34:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 151923 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 715A8B707E for ; Thu, 12 Apr 2012 09:06:12 +1000 (EST) Received: from localhost ([::1]:43930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SI5Cd-0005bw-3a for incoming@patchwork.ozlabs.org; Wed, 11 Apr 2012 17:35:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SI5Bx-0004IW-BT for qemu-devel@nongnu.org; Wed, 11 Apr 2012 17:35:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SI5Bv-0004Cy-JZ for qemu-devel@nongnu.org; Wed, 11 Apr 2012 17:35:04 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:62994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SI5Bv-00049p-BL for qemu-devel@nongnu.org; Wed, 11 Apr 2012 17:35:03 -0400 Received: by wgbfm10 with SMTP id fm10so1223647wgb.10 for ; Wed, 11 Apr 2012 14:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=oUTpMlK3kMi4LMM9AKDrrKawGruyBJ9ra2P23Pz5LDg=; b=vllHsDH2KuR1AlS80tn/JEGQ91RjPEeEwuAFk6gyii+Lve3S7DRrQjJd1uV4MleLXQ uar7aEnPzV8zS2AIkZ34O4RvCG8Md9qk74IB/C3Z07+QNIzjUvNWKQvKzJ+tgOjv73L5 CirnGvS7X6BBbY8PJVs+zLlPvLn/3oZ6THg1bRsCSbx5wCWuzb56UTcO5doZjWqJAIHs T4oZzuLCpG1LScg0ekc9ApbASNFjHAopWKh7qazwGf+fURmQhNXntFL1AKbaEIHbtKK1 uFNIReGamaiyj7dXLRkXuwtYqxqq94UpoIzqD6jTKAOvXVJL6CKvud+1tICMaU8j4WaV JZuA== Received: by 10.180.91.165 with SMTP id cf5mr127795wib.2.1334180101409; Wed, 11 Apr 2012 14:35:01 -0700 (PDT) Received: from yakj.lan (93-34-182-16.ip50.fastwebnet.it. [93.34.182.16]) by mx.google.com with ESMTPS id ev10sm27383707wid.10.2012.04.11.14.35.00 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Apr 2012 14:35:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 11 Apr 2012 23:34:37 +0200 Message-Id: <1334180081-6172-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.9.3 In-Reply-To: <1334180081-6172-1-git-send-email-pbonzini@redhat.com> References: <1334180081-6172-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.53 Subject: [Qemu-devel] [PATCH v2 10/14] cmdline: reindent numa_add 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 Signed-off-by: Paolo Bonzini --- vl.c | 72 +++++++++++++++++++++++++++++++++--------------------------------- 1 files changed, 36 insertions(+), 36 deletions(-) diff --git a/vl.c b/vl.c index b592ea7..9e4cf77 100644 --- a/vl.c +++ b/vl.c @@ -943,49 +943,49 @@ static void numa_add(const char *optarg) int nodenr; optarg = get_opt_name(option, 128, optarg, ',') + 1; - if (!strcmp(option, "node")) { - if (get_param_value(option, 128, "nodeid", optarg) == 0) { - nodenr = nb_numa_nodes; - } else { - nodenr = strtoull(option, NULL, 10); - } + if (strcmp(option, "node")) { + return; + } + if (get_param_value(option, 128, "nodeid", optarg) == 0) { + nodenr = nb_numa_nodes; + } else { + nodenr = strtoull(option, NULL, 10); + } - if (get_param_value(option, 128, "mem", optarg) == 0) { - node_mem[nodenr] = 0; - } else { - int64_t sval; - sval = strtosz(option, &endptr); - if (sval < 0 || *endptr) { - fprintf(stderr, "qemu: invalid numa mem size: %s\n", optarg); - exit(1); - } - node_mem[nodenr] = sval; + if (get_param_value(option, 128, "mem", optarg) == 0) { + node_mem[nodenr] = 0; + } else { + int64_t sval; + sval = strtosz(option, &endptr); + if (sval < 0 || *endptr) { + fprintf(stderr, "qemu: invalid numa mem size: %s\n", optarg); + exit(1); } - if (get_param_value(option, 128, "cpus", optarg) == 0) { - node_cpumask[nodenr] = 0; + node_mem[nodenr] = sval; + } + if (get_param_value(option, 128, "cpus", optarg) == 0) { + node_cpumask[nodenr] = 0; + } else { + value = strtoull(option, &endptr, 10); + if (value >= 64) { + value = 63; + fprintf(stderr, "only 64 CPUs in NUMA mode supported.\n"); } else { - value = strtoull(option, &endptr, 10); - if (value >= 64) { - value = 63; - fprintf(stderr, "only 64 CPUs in NUMA mode supported.\n"); - } else { - if (*endptr == '-') { - endvalue = strtoull(endptr+1, &endptr, 10); - if (endvalue >= 63) { - endvalue = 62; - fprintf(stderr, - "only 63 CPUs in NUMA mode supported.\n"); - } - value = (2ULL << endvalue) - (1ULL << value); - } else { - value = 1ULL << value; + if (*endptr == '-') { + endvalue = strtoull(endptr+1, &endptr, 10); + if (endvalue >= 63) { + endvalue = 62; + fprintf(stderr, + "only 63 CPUs in NUMA mode supported.\n"); } + value = (2ULL << endvalue) - (1ULL << value); + } else { + value = 1ULL << value; } - node_cpumask[nodenr] = value; } - nb_numa_nodes++; + node_cpumask[nodenr] = value; } - return; + nb_numa_nodes++; } static int smp_init_func(QemuOpts *opts, void *opaque)