qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/8] plugins: add id_to_plugin_name


From: Alex Bennée
Subject: Re: [PATCH 3/8] plugins: add id_to_plugin_name
Date: Thu, 09 Mar 2023 14:45:51 +0000
User-agent: mu4e 1.9.21; emacs 29.0.60

Andrew Fasano <fasano@mit.edu> writes:

> From: Elysia Witham <elysia.witham@ll.mit.edu>
>
> Plugins will pass their unique id when creating callbacks to
> ensure they are associated with the correct plugin. This
> internal function resolves those ids to the declared names.
>
> Signed-off-by: Elysia Witham <elysia.witham@ll.mit.edu>
> Signed-off-by: Andrew Fasano <fasano@mit.edu>
> ---
>  plugins/core.c   | 12 ++++++++++++
>  plugins/plugin.h |  2 ++
>  2 files changed, 14 insertions(+)
>
> diff --git a/plugins/core.c b/plugins/core.c
> index 5fbdcb5768..6a50b4a6e6 100644
> --- a/plugins/core.c
> +++ b/plugins/core.c
> @@ -248,6 +248,18 @@ int name_to_plugin_version(const char *name)
>      return -1;
>  }
>  
> +const char *id_to_plugin_name(qemu_plugin_id_t id)
> +{
> +    const char *plugin = plugin_id_to_ctx_locked(id)->name;
> +    if (plugin) {
> +        return plugin;
> +    } else {
> +        warn_report("Unnamed plugin cannot use QPP, not supported in plugin "
> +                    "version. Please update plugin.");
> +        return NULL;
> +    }
> +}
> +

I don't see this function being used in this series.

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro



reply via email to

[Prev in Thread] Current Thread [Next in Thread]