aboutsummaryrefslogtreecommitdiff
path: root/memory_mapping.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-06-24 23:50:24 +0200
committerAndreas Färber <afaerber@suse.de>2013-09-03 12:25:55 +0200
commitbdc44640cb33c90809376a262df871a1144d339a (patch)
treeef3b8d1d6a389d85baeb0cee895471b634a2fc3b /memory_mapping.c
parent27013bf20d5d93ac75d398aa3608604e8ad91b5a (diff)
cpu: Use QTAILQ for CPU list
Introduce CPU_FOREACH(), CPU_FOREACH_SAFE() and CPU_NEXT() shorthand macros. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'memory_mapping.c')
-rw-r--r--memory_mapping.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/memory_mapping.c b/memory_mapping.c
index eeeeb44026..87a6ed5c8e 100644
--- a/memory_mapping.c
+++ b/memory_mapping.c
@@ -270,7 +270,7 @@ static CPUState *find_paging_enabled_cpu(CPUState *start_cpu)
{
CPUState *cpu;
- for (cpu = start_cpu; cpu != NULL; cpu = cpu->next_cpu) {
+ CPU_FOREACH(cpu) {
if (cpu_paging_enabled(cpu)) {
return cpu;
}
@@ -289,7 +289,8 @@ void qemu_get_guest_memory_mapping(MemoryMappingList *list,
first_paging_enabled_cpu = find_paging_enabled_cpu(first_cpu);
if (first_paging_enabled_cpu) {
- for (cpu = first_paging_enabled_cpu; cpu != NULL; cpu = cpu->next_cpu) {
+ for (cpu = first_paging_enabled_cpu; cpu != NULL;
+ cpu = CPU_NEXT(cpu)) {
Error *err = NULL;
cpu_get_memory_mapping(cpu, list, &err);
if (err) {