On 2/25/25 03:08, Alex Bennée wrote:
These are only usable in system mode where we control the timer. For
user-mode make them NOPs.

Signed-off-by: Alex Bennée <alex.ben...@linaro.org>
---
  plugins/api-system.c | 34 ++++++++++++++++++++++++++++++++++
  plugins/api-user.c   | 17 +++++++++++++++++
  plugins/api.c        | 41 -----------------------------------------
  3 files changed, 51 insertions(+), 41 deletions(-)

Code movement, so,
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

+static bool has_control;
+static Error *migration_blocker;
+
+const void *qemu_plugin_request_time_control(void)
+{
+    if (!has_control) {
+        has_control = true;
+        error_setg(&migration_blocker,
+                   "TCG plugin time control does not support migration");
+        migrate_add_blocker(&migration_blocker, NULL);
+        return &has_control;
+    }
+    return NULL;
+}

But I'm really not a fan of either this API, or the duplication between has_control and migration_blocker != NULL.


r~

Reply via email to