From patchwork Thu Jul 2 15:45:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 490687 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1D8881402A6 for ; Fri, 3 Jul 2015 01:46:26 +1000 (AEST) Received: from localhost ([::1]:37262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAggv-0002qo-Gd for incoming@patchwork.ozlabs.org; Thu, 02 Jul 2015 11:46:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAggP-0002MQ-FX for qemu-devel@nongnu.org; Thu, 02 Jul 2015 11:45:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAggJ-0004uR-6G for qemu-devel@nongnu.org; Thu, 02 Jul 2015 11:45:48 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42909 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAggI-0004sG-VY for qemu-devel@nongnu.org; Thu, 02 Jul 2015 11:45:43 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1567EAAF2; Thu, 2 Jul 2015 15:45:40 +0000 (UTC) Message-ID: <55955CA3.2080408@suse.de> Date: Thu, 02 Jul 2015 17:45:39 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= Organization: SUSE Linux GmbH User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Peter Crosthwaite , qemu-devel@nongnu.org, Bharata B Rao References: <1434648295-30584-1-git-send-email-crosthwaite.peter@gmail.com> <1434648295-30584-3-git-send-email-crosthwaite.peter@gmail.com> In-Reply-To: <1434648295-30584-3-git-send-email-crosthwaite.peter@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: rth@twiddle.net, ehabkost@redhat.com, aurelien@aurel32.net, Peter Crosthwaite Subject: Re: [Qemu-devel] [PATCH v3 2/8] cpus: Convert cpu_index into a bitmap 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 Am 18.06.2015 um 19:24 schrieb Peter Crosthwaite: > diff --git a/exec.c b/exec.c > index 015fa4a..549c209 100644 > --- a/exec.c > +++ b/exec.c > @@ -509,21 +509,66 @@ void tcg_cpu_address_space_init(CPUState *cpu, AddressSpace *as) > } > #endif > > +#ifndef CONFIG_USER_ONLY > +static DECLARE_BITMAP(cpu_index_map, MAX_CPUMASK_BITS); > + > +static int cpu_get_free_index(Error **errp) > +{ > + int cpu = find_first_zero_bit(cpu_index_map, max_cpus); > + > + if (cpu >= max_cpus) { > + error_setg(errp, "Trying to use more CPUs than allowed max of %d\n", > + max_cpus); error_setg() is without \n, fixing. } Regards, Andreas diff --git a/exec.c b/exec.c index 53ffb18..e93041f 100644 --- a/exec.c +++ b/exec.c @@ -521,7 +521,7 @@ static int cpu_get_free_index(Error **errp) int cpu = find_first_zero_bit(cpu_index_map, max_cpus); if (cpu >= max_cpus) { - error_setg(errp, "Trying to use more CPUs than allowed max of %d\n", + error_setg(errp, "Trying to use more CPUs than allowed max of %d", max_cpus); return -1;