[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-cpu 49/59] cpus: Abstract all_vcpus_paused() wit
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-cpu 49/59] cpus: Abstract all_vcpus_paused() with qemu_for_each_cpu() |
Date: |
Sun, 9 Jun 2013 21:13:16 +0200 |
Change return type from int to bool while at it.
Signed-off-by: Andreas Färber <address@hidden>
---
cpus.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/cpus.c b/cpus.c
index 506a0c8..3856bf1 100644
--- a/cpus.c
+++ b/cpus.c
@@ -946,19 +946,21 @@ void qemu_mutex_unlock_iothread(void)
qemu_mutex_unlock(&qemu_global_mutex);
}
-static int all_vcpus_paused(void)
+static void one_vcpu_paused(CPUState *cpu, void *data)
{
- CPUArchState *penv = first_cpu;
+ bool *all_paused = data;
- while (penv) {
- CPUState *pcpu = ENV_GET_CPU(penv);
- if (!pcpu->stopped) {
- return 0;
- }
- penv = penv->next_cpu;
+ if (!cpu->stopped) {
+ *all_paused = false;
}
+}
+
+static bool all_vcpus_paused(void)
+{
+ bool ret = true;
- return 1;
+ qemu_for_each_cpu(one_vcpu_paused, &ret);
+ return ret;
}
static void pause_one_vcpu(CPUState *cpu, void *data)
--
1.8.1.4
- [Qemu-devel] [PATCH qom-cpu 41/59] target-mips: Abstract helper_dvpe() with qemu_for_each_cpu(), (continued)
- [Qemu-devel] [PATCH qom-cpu 41/59] target-mips: Abstract helper_dvpe() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 43/59] kvmclock: Abstract kvmclock_vm_state_change() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 45/59] pc: Abstract pic_irq_request() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 44/59] kvmvapic: Abstract vapic_enable_tpr_reporting() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 46/59] ppc: Abstract ppce500_set_mpic_proxy() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 48/59] cpus: Abstract all_cpu_threads_idle() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 47/59] spapr: Abstract spapr_fix_cpu_dt() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 49/59] cpus: Abstract all_vcpus_paused() with qemu_for_each_cpu(),
Andreas Färber <=
- [Qemu-devel] [PATCH qom-cpu 50/59] cpus: Abstract qmp_query_cpus() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 51/59] exec: Abstract qemu_get_cpu() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 52/59] gdbstub: Abstract gdb_breakpoint_{insert, remove}() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 53/59] gdbstub: Abstract gdb_breakpoint_remove_all() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 55/59] spapr_rtas: Abstract rtas_query_cpu_stopped_state() with qemu_get_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 56/59] spapr_rtas: Abstract rtas_start_cpu() with qemu_get_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 54/59] spapr: Abstract spapr_create_fdt_skel() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 58/59] linux-user: Change thread_env to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 57/59] cpu: Make first_cpu and next_cpu CPUState (WIP), Andreas Färber, 2013/06/09