qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4] modules: build virtio-9p modular


From: Gerd Hoffmann
Subject: [PATCH 4/4] modules: build virtio-9p modular
Date: Thu, 10 Jun 2021 12:15:53 +0200

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]