diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2024-06-20 16:22:17 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2024-06-24 10:15:10 +0100 |
commit | 508036532c5ee1c72896f6b950e8629cf334e485 (patch) | |
tree | 170e06e316d8d55e4fd4e9ec80c82f776595c92d /plugins | |
parent | 847a65dd76bf1868c7966a2b2608dcd00cb68dc7 (diff) |
plugins: add migration blocker
If the plugin in controlling time there is some state that might be
missing from the plugin tracking it. Migration is unlikely to work in
this case so lets put a migration blocker in to let the user know if
they try.
Suggested-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240620152220.2192768-10-alex.bennee@linaro.org>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/api.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/api.c b/plugins/api.c index 4431a0ea7e..2ff13d09de 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -47,6 +47,8 @@ #include "disas/disas.h" #include "plugin.h" #ifndef CONFIG_USER_ONLY +#include "qapi/error.h" +#include "migration/blocker.h" #include "exec/ram_addr.h" #include "qemu/plugin-memory.h" #include "hw/boards.h" @@ -589,11 +591,19 @@ uint64_t qemu_plugin_u64_sum(qemu_plugin_u64 entry) * Time control */ static bool has_control; +#ifdef CONFIG_SOFTMMU +static Error *migration_blocker; +#endif const void *qemu_plugin_request_time_control(void) { if (!has_control) { has_control = true; +#ifdef CONFIG_SOFTMMU + error_setg(&migration_blocker, + "TCG plugin time control does not support migration"); + migrate_add_blocker(&migration_blocker, NULL); +#endif return &has_control; } return NULL; |