On Sat, 8 Mar 2025 at 22:00, Alex Bennée <[email protected]> wrote:
>
> These are only usable in system mode where we control the timer. For
> user-mode make them NOPs.
>
> Reviewed-by: Richard Henderson <[email protected]>
> Signed-off-by: Alex Bennée <[email protected]>
> Message-Id: <[email protected]>

Hi; this is an old one but Coverity has decided to complain
about it now for some reason:

> --- a/plugins/api-system.c
> +++ b/plugins/api-system.c
> @@ -95,3 +95,37 @@ const char *qemu_plugin_hwaddr_device_name(const struct 
> qemu_plugin_hwaddr *h)
>          return g_intern_static_string("RAM");
>      }
>  }
> +
> +/*
> + * Time control
> + */
> +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;
> +}

migrate_add_blocker() can fail, so we need to check for that.
(In particular it will fail if the user ran QEMU with the
--only-migratable option, so we need to arrange to fail in
a way that gives the error message to the user; maybe error_fatal
would be OK here?)

thanks
-- PMM

Reply via email to