diff mbox series

[v8,12/40] accel/qtest: Implement AccelOpsClass::has_work()

Message ID 20210926222716.1732932-13-f4bug@amsat.org
State New
Headers show
Series accel: Move has_work() from CPUClass to AccelOpsClass | expand

Commit Message

Philippe Mathieu-Daudé Sept. 26, 2021, 10:26 p.m. UTC
Since there is no specific QTest handling for cpu_has_work() in
cpu_thread_is_idle(), implement QTest has_work() handler as a
simple 'return false' code. Besides, QTest is a "dummy" accelerator
so not much can be done on vCPUs.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 accel/qtest/qtest.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Richard Henderson Sept. 27, 2021, 12:02 a.m. UTC | #1
On 9/26/21 6:26 PM, Philippe Mathieu-Daudé wrote:
> Since there is no specific QTest handling for cpu_has_work() in
> cpu_thread_is_idle(), implement QTest has_work() handler as a
> simple 'return false' code. Besides, QTest is a "dummy" accelerator
> so not much can be done on vCPUs.
> 
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   accel/qtest/qtest.c | 6 ++++++
>   1 file changed, 6 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c
index 7e6b8110d52..eb5a17cef18 100644
--- a/accel/qtest/qtest.c
+++ b/accel/qtest/qtest.c
@@ -47,12 +47,18 @@  static const TypeInfo qtest_accel_type = {
 };
 module_obj(TYPE_QTEST_ACCEL);
 
+static bool qtest_cpu_has_work(CPUState *cpu)
+{
+    return false;
+}
+
 static void qtest_accel_ops_class_init(ObjectClass *oc, void *data)
 {
     AccelOpsClass *ops = ACCEL_OPS_CLASS(oc);
 
     ops->create_vcpu_thread = dummy_start_vcpu_thread;
     ops->get_virtual_clock = qtest_get_virtual_clock;
+    ops->has_work = qtest_cpu_has_work;
 };
 
 static const TypeInfo qtest_accel_ops_type = {