[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/4] modules: add support for target-specific modules.
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH 0/4] modules: add support for target-specific modules. |
Date: |
Thu, 10 Jun 2021 14:23:05 +0200 |
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
- [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/10
- [PATCH 1/4] modules: factor out arch check, Gerd Hoffmann, 2021/06/10
- [PATCH 2/4] modules: check arch on qom lookup, Gerd Hoffmann, 2021/06/10
- [PATCH 3/4] modules: target-specific module build infrastructure, Gerd Hoffmann, 2021/06/10
- [PATCH 4/4] modules: build virtio-9p modular, Gerd Hoffmann, 2021/06/10
- Re: [PATCH 0/4] modules: add support for target-specific modules., Claudio Fontana, 2021/06/10
- Re: [PATCH 0/4] modules: add support for target-specific modules.,
Gerd Hoffmann <=
- Re: [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/10
- Re: [PATCH 0/4] modules: add support for target-specific modules., Claudio Fontana, 2021/06/10
- Re: [PATCH 0/4] modules: add support for target-specific modules., Paolo Bonzini, 2021/06/11
- Re: [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/11
- Re: [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/11
- Re: [PATCH 0/4] modules: add support for target-specific modules., Claudio Fontana, 2021/06/11
- Re: [PATCH 0/4] modules: add support for target-specific modules., José Ricardo Ziviani, 2021/06/14
- Re: [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/15
- Re: [PATCH 0/4] modules: add support for target-specific modules., José Ricardo Ziviani, 2021/06/15
- Re: [PATCH 0/4] modules: add support for target-specific modules., Gerd Hoffmann, 2021/06/16