All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Claudio Fontana <cfontana@suse.de>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	qemu-devel@nongnu.org, "Greg Kurz" <groug@kaod.org>,
	jose.ziviani@suse.com, pbonzini@redhat.com,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [PATCH 0/4] modules: add support for target-specific modules.
Date: Thu, 10 Jun 2021 14:23:05 +0200	[thread overview]
Message-ID: <20210610122305.zxdaqsft5evcrli6@sirius.home.kraxel.org> (raw)
In-Reply-To: <4a1a23af-461f-92c4-d9f0-1f8133d611db@suse.de>

On Thu, Jun 10, 2021 at 12:34:14PM +0200, Claudio Fontana wrote:
> On 6/10/21 12:15 PM, Gerd Hoffmann wrote:
> > Based on the "modules: add metadata database" patch series sent
> > earlier today.  Adds support for target-specific modules to the
> > module code and build infrastructure.  Builds one simple module
> > (virtio-9p-device) for testing purposes.  Well, one module per
> > target to be exact ;)
> > 
> > Gerd Hoffmann (4):
> >   modules: factor out arch check
> >   modules: check arch on qom lookup
> >   modules: target-specific module build infrastructure
> >   modules: build virtio-9p modular
> > 
> >  hw/9pfs/virtio-9p-device.c |  2 ++
> >  util/module.c              | 30 ++++++++++++++++++++++++------
> >  hw/9pfs/meson.build        | 11 ++++++++++-
> >  meson.build                | 26 ++++++++++++++++++++++++++
> >  4 files changed, 62 insertions(+), 7 deletions(-)
> > 
> 
> Very interesting, Cc:ing also Philippe on this.

Build qtest modular on top of that was easy, patch below.

I'm not convinced though that the approach will work for other
accelerators too given that they have dependencies to directories
outside accel/ ...

full branch:
  https://git.kraxel.org/cgit/qemu/log/?h=sirius/modinfo-playground

take care,
  Gerd

------------------------- cut here ----------------------
From baa7ca6bc334b043d25acd659c8d44697a2fc197 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 10 Jun 2021 13:59:25 +0200
Subject: [PATCH] modules: build qtest accel modular

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 accel/accel-common.c    | 2 +-
 accel/qtest/qtest.c     | 3 +++
 accel/meson.build       | 4 ++++
 accel/qtest/meson.build | 7 +++----
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/accel/accel-common.c b/accel/accel-common.c
index cf07f78421d6..7b8ec7e0f72a 100644
--- a/accel/accel-common.c
+++ b/accel/accel-common.c
@@ -44,7 +44,7 @@ static const TypeInfo accel_type = {
 AccelClass *accel_find(const char *opt_name)
 {
     char *class_name = g_strdup_printf(ACCEL_CLASS_NAME("%s"), opt_name);
-    AccelClass *ac = ACCEL_CLASS(object_class_by_name(class_name));
+    AccelClass *ac = ACCEL_CLASS(module_object_class_by_name(class_name));
     g_free(class_name);
     return ac;
 }
diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c
index edb29f6fa4c0..d2bca1c02151 100644
--- a/accel/qtest/qtest.c
+++ b/accel/qtest/qtest.c
@@ -45,6 +45,7 @@ static const TypeInfo qtest_accel_type = {
     .parent = TYPE_ACCEL,
     .class_init = qtest_accel_class_init,
 };
+module_obj("qtest-accel"); // FIXME: use TYPE_QTEST_ACCEL
 
 static void qtest_accel_ops_class_init(ObjectClass *oc, void *data)
 {
@@ -61,6 +62,7 @@ static const TypeInfo qtest_accel_ops_type = {
     .class_init = qtest_accel_ops_class_init,
     .abstract = true,
 };
+module_obj("qtest-accel-ops"); // FIXME: use ACCEL_OPS_NAME
 
 static void qtest_type_init(void)
 {
@@ -69,3 +71,4 @@ static void qtest_type_init(void)
 }
 
 type_init(qtest_type_init);
+module_arch(TARGET_NAME);
diff --git a/accel/meson.build b/accel/meson.build
index dfd808d2c8e5..0e824c9a3a72 100644
--- a/accel/meson.build
+++ b/accel/meson.build
@@ -1,3 +1,5 @@
+accel_modules = {}
+
 specific_ss.add(files('accel-common.c'))
 softmmu_ss.add(files('accel-softmmu.c'))
 user_ss.add(files('accel-user.c'))
@@ -16,3 +18,5 @@ dummy_ss.add(files(
 
 specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: dummy_ss)
 specific_ss.add_all(when: ['CONFIG_XEN'], if_true: dummy_ss)
+
+target_modules += { 'accel' : accel_modules }
diff --git a/accel/qtest/meson.build b/accel/qtest/meson.build
index a2f327645980..d106bb33c36a 100644
--- a/accel/qtest/meson.build
+++ b/accel/qtest/meson.build
@@ -1,6 +1,5 @@
 qtest_ss = ss.source_set()
-qtest_ss.add(files(
-  'qtest.c',
-))
+qtest_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'],
+             if_true: files('qtest.c'))
 
-specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: qtest_ss)
+accel_modules += {'qtest': qtest_ss }
-- 
2.31.1



  reply	other threads:[~2021-06-10 12:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 10:15 [PATCH 0/4] modules: add support for target-specific modules Gerd Hoffmann
2021-06-10 10:15 ` [PATCH 1/4] modules: factor out arch check Gerd Hoffmann
2021-06-10 10:15 ` [PATCH 2/4] modules: check arch on qom lookup Gerd Hoffmann
2021-06-10 10:15 ` [PATCH 3/4] modules: target-specific module build infrastructure Gerd Hoffmann
2021-06-10 10:15 ` [PATCH 4/4] modules: build virtio-9p modular Gerd Hoffmann
2021-06-10 10:34 ` [PATCH 0/4] modules: add support for target-specific modules Claudio Fontana
2021-06-10 12:23   ` Gerd Hoffmann [this message]
2021-06-10 13:10     ` Gerd Hoffmann
2021-06-10 13:12     ` Claudio Fontana
2021-06-11  7:35       ` Paolo Bonzini
2021-06-11  8:29         ` Gerd Hoffmann
2021-06-11 13:03           ` Gerd Hoffmann
2021-06-11 13:17             ` Claudio Fontana
2021-06-14 22:19             ` José Ricardo Ziviani
2021-06-15  5:09               ` Gerd Hoffmann
2021-06-15 15:48                 ` José Ricardo Ziviani
2021-06-16  9:28                   ` Gerd Hoffmann
2021-06-16 12:23                     ` Claudio Fontana
2021-06-17  5:37                       ` Gerd Hoffmann
2021-06-17  7:48                         ` Claudio Fontana
2021-06-17  9:48                           ` Gerd Hoffmann
2021-06-17 10:07                             ` Claudio Fontana
2021-06-11 17:14           ` Paolo Bonzini

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=20210610122305.zxdaqsft5evcrli6@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=cfontana@suse.de \
    --cc=f4bug@amsat.org \
    --cc=groug@kaod.org \
    --cc=jose.ziviani@suse.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    /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.