qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andrew S. Fasano" <fasano@mit.edu>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"erdnaxe@crans.org" <erdnaxe@crans.org>,
	"ma.mandourr@gmail.com" <ma.mandourr@gmail.com>
Subject: Re: [RFC 4/4] tcg/plugins: Add example pair of QPP plugins
Date: Mon, 26 Sep 2022 21:38:10 +0000	[thread overview]
Message-ID: <1664228290470.772@mit.edu> (raw)
In-Reply-To: <87v8pg68u1.fsf@linaro.org>

From: Alex Bennée <alex.bennee@linaro.org>
> Andrew Fasano <fasano@mit.edu> writes:
> 
> > The first plugin, qpp_srv exposes two functions and one callback that other
> > plugins can leverage. These functions are described in the corresponding
> > header file.
> >
> > The second plugin, qpp_client, imports this header file, registers its
> > own function to run on a qpp_srv-provided callback, and directly calls
> > into the two exposed functions in qpp_srv.
> 
> I'll just sketch out how I would change the API in this example plugin:
[snip]
> QEMU_PLUGIN_EXPORT const char *qemu_plugin_name = "qpp_client";

This works. Perhaps plugins could (should?) also specify a version number
that other plugins could check before interacting with:

	QEMU_PLUGIN_EXPORT const int qemu_plugin_version = 1;

> QEMU_PLUGIN_EXPORT const char *qemu_plugin_uses = "qpp_server";

I anticipate plugins could depend on multiple other plugins and they might
want to check the version of these plugins, so perhaps a function call would
be better? Something like:

	int qpp_srv_version = load_qemu_plugin("qpp_server");

Perhaps returning negative values on error, otherwise the plugin version. Or
the version compatability checks could be standardized into the plugin core,
but that seems less important to me for now.
[snip]

> QEMU_PLUGIN_EXPORT int qpp_srv_do_add(int x)

I like the change to keep these with the plugin name as a prefix everywhere.

Thanks,
Andrew


  reply	other threads:[~2022-09-26 21:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01 18:27 [RFC 0/4] Support interactions between TCG plugins Andrew Fasano
2022-09-01 18:27 ` [RFC 1/4] docs/tcg-plugins: describe QPP API Andrew Fasano
2022-09-21 13:57   ` Alex Bennée
2022-09-01 18:27 ` [RFC 2/4] tcg/plugins: Automatically define CURRENT_PLUGIN Andrew Fasano
2022-09-21 14:00   ` Alex Bennée
2022-09-26 21:37     ` Andrew S. Fasano
2022-09-01 18:27 ` [RFC 3/4] tcg/plugins: Support for inter-plugin interactions Andrew Fasano
2022-09-21 14:51   ` Alex Bennée
2022-09-26 21:37     ` Andrew S. Fasano
2022-09-01 18:27 ` [RFC 4/4] tcg/plugins: Add example pair of QPP plugins Andrew Fasano
2022-09-21 15:22   ` Alex Bennée
2022-09-26 21:38     ` Andrew S. Fasano [this message]
2022-09-21 15:36   ` Alex Bennée
2022-09-26 21:38     ` Andrew S. Fasano
2022-09-21 12:13 ` [RFC 0/4] Support interactions between TCG plugins Alex Bennée
2022-09-26 21:36   ` Andrew S. Fasano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1664228290470.772@mit.edu \
    --to=fasano@mit.edu \
    --cc=alex.bennee@linaro.org \
    --cc=erdnaxe@crans.org \
    --cc=ma.mandourr@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).