]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel/tcg: Restrict qemu_plugin_vcpu_exit_hook() to TCG plugins
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 29 Apr 2024 21:12:39 +0000 (23:12 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 6 May 2024 09:24:14 +0000 (11:24 +0200)
qemu_plugin_vcpu_exit_hook() is specific to TCG plugins,
so must be restricted to it in cpu_common_unrealizefn(),
similarly to how qemu_plugin_create_vcpu_state() is
restricted in the cpu_common_realizefn() counterpart.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240429213050.55177-2-philmd@linaro.org>

hw/core/cpu-common.c

index a72d48d9e17d4f27bc85958a57ab396ef854408d..0f0a247f56425aa84a0f6230d30b27cd526ad6a0 100644 (file)
@@ -30,7 +30,9 @@
 #include "hw/boards.h"
 #include "hw/qdev-properties.h"
 #include "trace.h"
+#ifdef CONFIG_PLUGIN
 #include "qemu/plugin.h"
+#endif
 
 CPUState *cpu_by_arch_id(int64_t id)
 {
@@ -236,9 +238,11 @@ static void cpu_common_unrealizefn(DeviceState *dev)
     CPUState *cpu = CPU(dev);
 
     /* Call the plugin hook before clearing the cpu is fully unrealized */
+#ifdef CONFIG_PLUGIN
     if (tcg_enabled()) {
         qemu_plugin_vcpu_exit_hook(cpu);
     }
+#endif
 
     /* NOTE: latest generic point before the cpu is fully unrealized */
     cpu_exec_unrealizefn(cpu);