qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Christian Schoenebeck <qemu_oss@crudebyte.com>,
	Greg Kurz <groug@kaod.org>,
	cfontana@suse.de, jose.ziviani@suse.com, pbonzini@redhat.com,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: [PATCH 4/4] modules: build virtio-9p modular
Date: Thu, 10 Jun 2021 12:15:53 +0200	[thread overview]
Message-ID: <20210610101553.943689-5-kraxel@redhat.com> (raw)
In-Reply-To: <20210610101553.943689-1-kraxel@redhat.com>

Simple target for testing 😊

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/9pfs/virtio-9p-device.c |  2 ++
 hw/9pfs/meson.build        | 11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 14371a78efd8..9a2df7b5126d 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -265,6 +265,8 @@ static const TypeInfo virtio_device_info = {
     .instance_size = sizeof(V9fsVirtioState),
     .class_init = virtio_9p_class_init,
 };
+module_obj(TYPE_VIRTIO_9P);
+module_arch(TARGET_NAME);
 
 static void virtio_9p_register_types(void)
 {
diff --git a/hw/9pfs/meson.build b/hw/9pfs/meson.build
index 99be5d911968..584e9432ab46 100644
--- a/hw/9pfs/meson.build
+++ b/hw/9pfs/meson.build
@@ -1,3 +1,5 @@
+hw_9pfs_modules = {}
+
 fs_ss = ss.source_set()
 fs_ss.add(files(
   '9p-local.c',
@@ -17,4 +19,11 @@ fs_ss.add(files(
 fs_ss.add(when: 'CONFIG_XEN', if_true: files('xen-9p-backend.c'))
 softmmu_ss.add_all(when: 'CONFIG_FSDEV_9P', if_true: fs_ss)
 
-specific_ss.add(when: 'CONFIG_VIRTIO_9P', if_true: files('virtio-9p-device.c'))
+if config_all_devices.has_key('CONFIG_VIRTIO_9P')
+  virtio_9p_ss = ss.source_set()
+  virtio_9p_ss.add(when: 'CONFIG_VIRTIO_9P',
+                   if_true: files('virtio-9p-device.c'))
+  hw_9pfs_modules += {'virtio-9p-device': virtio_9p_ss}
+endif
+
+target_modules += { 'hw-9pfs': hw_9pfs_modules }
-- 
2.31.1



  parent reply	other threads:[~2021-06-10 10:33 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 ` Gerd Hoffmann [this message]
2021-06-10 10:34 ` [PATCH 0/4] modules: add support for target-specific modules Claudio Fontana
2021-06-10 12:23   ` Gerd Hoffmann
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=20210610101553.943689-5-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=cfontana@suse.de \
    --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 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).