All of lore.kernel.org
 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 2/4] tcg/plugins: Automatically define CURRENT_PLUGIN
Date: Mon, 26 Sep 2022 21:37:36 +0000	[thread overview]
Message-ID: <1664228255927.51065@mit.edu> (raw)
In-Reply-To: <87a66s7rmo.fsf@linaro.org>

From: Alex Bennée <alex.bennee@linaro.org>
> Andrew Fasano <fasano@mit.edu> writes:
> 
> > Use plugin filenames to set the preprocessor variable CURRENT_PLUGIN
> > as a string during plugin compilation.
> >
> > Signed-off-by: Andrew Fasano <fasano@mit.edu>
> > ---
> >  contrib/plugins/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile
> > index df3499f4f2..b7720fea0f 100644
> > --- a/contrib/plugins/Makefile
> > +++ b/contrib/plugins/Makefile
> > @@ -34,7 +34,7 @@ CFLAGS += -I$(SRC_PATH)/include/qemu
> >  all: $(SONAMES)
> > 
> >  %.o: %.c
> > -     $(CC) $(CFLAGS) -c -o $@ $<
> > +     $(CC) $(CFLAGS) -DCURRENT_PLUGIN=\"$(basename $@)\" -c -o $@ $<
> 
> While all plugins are currently single files this seems a little clumsy.
> 
> We can already check exported plugin symbols in loader.c (see
> qemu_plugin_version) so maybe it would be better to declare an API
> update and mandate any plugin object also needs to define a
> qemu_plugin_name with a null terminated string?

That design sounds good to me and would be good for multi-file plugins. Perhaps
plugins could also (optionally?) specify their own API versioning here.

> 
> > 
> >  lib%.so: %.o
> >        $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS)
> 
> 
> --
> Alex Bennée


  reply	other threads:[~2022-09-26 21:40 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 [this message]
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
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=1664228255927.51065@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.