[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/3] numa: Reject configuration if CPU appear
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/3] numa: Reject configuration if CPU appears on multiple nodes |
Date: |
Thu, 12 Feb 2015 17:04:53 +0100 |
On Thu, 12 Feb 2015 16:18:31 +0100
Paolo Bonzini <address@hidden> wrote:
>
>
> On 12/02/2015 15:22, Igor Mammedov wrote:
> > how about replacing a bunch if fprintf's with something like this:
> >
> > cpu = 0;
> > while((cpu = find_next_bit(present_cpus, MAX_CPUMASK_BITS, cpu + 1))
> > !=MAX_CPUMASK_BITS)
> > str = g_strdup_printf("%s %d", str, cpu);
> >
> > error_report("CPU(s) present in multiple NUMA nodes: %s\n", str);
>
> As written above this leaks memory, and there should be no space before
> the final %s. So it's not that simple. :)
it hasn't been meant as working drop in code
> But using error_report is
> nicer indeed, and you can use GString to avoid the leak.
good to learn about GString
>
> Paolo
>