@@ -39,7 +39,7 @@ struct AccelOpsClass {
void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */
void (*kick_vcpu_thread)(CPUState *cpu);
- bool (*cpu_thread_is_idle)(CPUState *cpu);
+ bool (*cpu_thread_is_idle)(const CPUState *cpu);
void (*synchronize_post_reset)(CPUState *cpu);
void (*synchronize_post_init)(CPUState *cpu);
@@ -72,7 +72,7 @@ static void kvm_start_vcpu_thread(CPUState *cpu)
cpu, QEMU_THREAD_JOINABLE);
}
-static bool kvm_vcpu_thread_is_idle(CPUState *cpu)
+static bool kvm_vcpu_thread_is_idle(const CPUState *cpu)
{
return !kvm_halt_in_kernel();
}
@@ -77,7 +77,7 @@ static void whpx_kick_vcpu_thread(CPUState *cpu)
}
}
-static bool whpx_vcpu_thread_is_idle(CPUState *cpu)
+static bool whpx_vcpu_thread_is_idle(const CPUState *cpu)
{
return !whpx_apic_in_platform();
}
If a cpu_thread_is_idle() implementation accesses @cpu fields, it shouldn't modify them. Make the argument const in preparation. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- include/system/accel-ops.h | 2 +- accel/kvm/kvm-accel-ops.c | 2 +- target/i386/whpx/whpx-accel-ops.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)