cpu: Replace qemu_for_each_cpu()

It was introduced to loop over CPUs from target-independent code, but
since commit 182735efaf target-independent
CPUState is used.

A loop can be considered more efficient than function calls in a loop,
and CPU_FOREACH() hides implementation details just as well, so use that
instead.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Andreas Färber 2013-07-07 19:50:23 +02:00
parent bdc44640cb
commit 38fcbd3f08
6 changed files with 27 additions and 63 deletions

View file

@ -402,15 +402,6 @@ void run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data);
*/
void async_run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data);
/**
* qemu_for_each_cpu:
* @func: The function to be executed.
* @data: Data to pass to the function.
*
* Executes @func for each CPU.
*/
void qemu_for_each_cpu(void (*func)(CPUState *cpu, void *data), void *data);
/**
* qemu_get_cpu:
* @index: The CPUState@cpu_index value of the CPU to obtain.