Am 30.07.2013 16:50, schrieb Igor Mammedov: > On Tue, 30 Jul 2013 10:27:26 -0400 > "Jason J. Herne" <jjhe...@linux.vnet.ibm.com> wrote: >> On 07/30/2013 03:24 AM, Igor Mammedov wrote: >> Is there an easier way of getting the count besides this? >> >> int cpu_count = 0; >> for (cpu = first_cpu; cpu != NULL; cpu = cpu->next_cpu) { >> cpu_count++; >> } > > maybe qemu_for_each_cpu(), direct access to first_cpu & co is not encouraged.
Negative: qemu_for_each_cpu() is discouraged, first_cpu and next_cpu are okay. I need to send out my patch introducing CPU_FOREACH() macro based on QTAILQ_FOREACH(), preview on qom-cpu-12 branch. Markus wanted to rip out qemu_for_each_cpu() - also on that branch - but mst wanted both to coexist. Regards, Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg