qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>
Cc: Hu Tao <hutao@cn.fujitsu.com>,
	qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] numa: Reject configuration if CPU appears on multiple nodes
Date: Thu, 12 Feb 2015 16:18:31 +0100	[thread overview]
Message-ID: <54DCC447.2050306@redhat.com> (raw)
In-Reply-To: <20150212152231.16e0f268@nial.brq.redhat.com>



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. :)  But using error_report is
nicer indeed, and you can use GString to avoid the leak.

Paolo

  reply	other threads:[~2015-02-12 15:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 19:53 [Qemu-devel] [PATCH v2 0/3] NUMA: Validate CPU configuration Eduardo Habkost
2015-02-09 19:53 ` [Qemu-devel] [PATCH v2 1/3] numa: Reject CPU indexes > max_cpus Eduardo Habkost
2015-02-12 13:42   ` Igor Mammedov
2015-02-09 19:53 ` [Qemu-devel] [PATCH v2 2/3] numa: Reject configuration if CPU appears on multiple nodes Eduardo Habkost
2015-02-12 14:22   ` Igor Mammedov
2015-02-12 15:18     ` Paolo Bonzini [this message]
2015-02-12 15:26       ` Eduardo Habkost
2015-02-12 16:04       ` Igor Mammedov
2015-02-12 15:01   ` Igor Mammedov
2015-02-12 15:24     ` Eduardo Habkost
2015-02-12 16:01       ` Igor Mammedov
2015-02-12 17:54         ` Eduardo Habkost
2015-02-09 19:53 ` [Qemu-devel] [PATCH v2 3/3] numa: Print warning if no node is assigned to a CPU Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54DCC447.2050306@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).