diff mbox

[v3,2/8] cpus: Convert cpu_index into a bitmap

Message ID 55955CA3.2080408@suse.de
State New
Headers show

Commit Message

Andreas Färber July 2, 2015, 3:45 p.m. UTC
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 mbox

Patch

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;