From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Max Reitz <mreitz@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>, John Snow <jsnow@redhat.com>
Subject: [PATCH 6/7] floppy: build as modules.
Date: Wed, 4 Aug 2021 16:27:36 +0200 [thread overview]
Message-ID: <20210804142737.3366441-7-kraxel@redhat.com> (raw)
In-Reply-To: <20210804142737.3366441-1-kraxel@redhat.com>
Add module_obj() annotations, update meson build rules.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/block/fdc-isa.c | 2 ++
hw/block/fdc-sysbus.c | 4 ++++
hw/block/fdc.c | 2 ++
hw/block/meson.build | 17 ++++++++++++++---
4 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c
index a5a124fb9236..fb2139760f8c 100644
--- a/hw/block/fdc-isa.c
+++ b/hw/block/fdc-isa.c
@@ -259,6 +259,7 @@ static const TypeInfo isa_fdc_info = {
.class_init = isabus_fdc_class_init,
.instance_init = isabus_fdc_instance_init,
};
+module_obj(TYPE_ISA_FDC);
static void isa_fdc_register_types(void)
{
@@ -266,3 +267,4 @@ static void isa_fdc_register_types(void)
}
type_init(isa_fdc_register_types)
+module_dep("hw-block-fdc");
diff --git a/hw/block/fdc-sysbus.c b/hw/block/fdc-sysbus.c
index b358b6467ef5..8cc65cd92642 100644
--- a/hw/block/fdc-sysbus.c
+++ b/hw/block/fdc-sysbus.c
@@ -137,6 +137,7 @@ static const TypeInfo sysbus_fdc_common_typeinfo = {
.class_init = sysbus_fdc_common_class_init,
.class_size = sizeof(FDCtrlSysBusClass),
};
+module_obj(TYPE_SYSBUS_FDC);
static Property sysbus_fdc_properties[] = {
DEFINE_PROP_SIGNED("fdtypeA", FDCtrlSysBus, state.qdev_for_drives[0].type,
@@ -164,6 +165,7 @@ static const TypeInfo sysbus_fdc_typeinfo = {
.parent = TYPE_SYSBUS_FDC,
.class_init = sysbus_fdc_class_init,
};
+module_obj("sysbus-fdc");
static Property sun4m_fdc_properties[] = {
DEFINE_PROP_SIGNED("fdtype", FDCtrlSysBus, state.qdev_for_drives[0].type,
@@ -190,6 +192,7 @@ static const TypeInfo sun4m_fdc_typeinfo = {
.parent = TYPE_SYSBUS_FDC,
.class_init = sun4m_fdc_class_init,
};
+module_obj("sun-fdtwo");
static void sysbus_fdc_register_types(void)
{
@@ -199,3 +202,4 @@ static void sysbus_fdc_register_types(void)
}
type_init(sysbus_fdc_register_types)
+module_dep("hw-block-fdc");
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index ba42537e8d26..95a1467f3faf 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -74,6 +74,7 @@ static const TypeInfo floppy_bus_info = {
.parent = TYPE_BUS,
.instance_size = sizeof(FloppyBus),
};
+module_obj(TYPE_FLOPPY_BUS);
static void floppy_bus_create(FDCtrl *fdc, FloppyBus *bus, DeviceState *dev)
{
@@ -564,6 +565,7 @@ static const TypeInfo floppy_drive_info = {
.instance_size = sizeof(FloppyDrive),
.class_init = floppy_drive_class_init,
};
+module_obj(TYPE_FLOPPY_DRIVE);
/********************************************************/
/* Intel 82078 floppy disk controller emulation */
diff --git a/hw/block/meson.build b/hw/block/meson.build
index 8460042fe320..b336773ac591 100644
--- a/hw/block/meson.build
+++ b/hw/block/meson.build
@@ -1,3 +1,5 @@
+hw_block_modules = {}
+
softmmu_ss.add(files(
'block.c',
'cdrom.c',
@@ -5,9 +7,6 @@ softmmu_ss.add(files(
))
softmmu_ss.add(when: 'CONFIG_ECC', if_true: files('ecc.c'))
softmmu_ss.add(when: 'CONFIG_FDC', if_true: files('fdc-module.c'))
-softmmu_ss.add(when: 'CONFIG_FDC', if_true: files('fdc.c'))
-softmmu_ss.add(when: 'CONFIG_FDC_ISA', if_true: files('fdc-isa.c'))
-softmmu_ss.add(when: 'CONFIG_FDC_SYSBUS', if_true: files('fdc-sysbus.c'))
softmmu_ss.add(when: 'CONFIG_NAND', if_true: files('nand.c'))
softmmu_ss.add(when: 'CONFIG_ONENAND', if_true: files('onenand.c'))
softmmu_ss.add(when: 'CONFIG_PFLASH_CFI01', if_true: files('pflash_cfi01.c'))
@@ -20,4 +19,16 @@ softmmu_ss.add(when: 'CONFIG_TC58128', if_true: files('tc58128.c'))
specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-blk.c'))
+fdc_ss = ss.source_set()
+fdc_isa_ss = ss.source_set()
+fdc_sysbus_ss = ss.source_set()
+fdc_ss.add(when: 'CONFIG_FDC', if_true: files('fdc.c'))
+fdc_isa_ss.add(when: 'CONFIG_FDC_ISA', if_true: files('fdc-isa.c'))
+fdc_sysbus_ss.add(when: 'CONFIG_FDC_SYSBUS', if_true: files('fdc-sysbus.c'))
+hw_block_modules += {'fdc': fdc_ss,
+ 'fdc-isa' : fdc_isa_ss,
+ 'fdc-sysbus' : fdc_sysbus_ss }
+
subdir('dataplane')
+
+modules += { 'hw-block': hw_block_modules }
--
2.31.1
next prev parent reply other threads:[~2021-08-04 14:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 14:27 [PATCH 0/7] floppy: build as modules Gerd Hoffmann
2021-08-04 14:27 ` [PATCH 1/7] floppy: move isa_fdc_get_drive_type to separate source file Gerd Hoffmann
2021-08-04 14:27 ` [PATCH 2/7] floppy: move isa_fdc_init_drives + fdctrl_init_drives Gerd Hoffmann
2021-08-04 14:27 ` [PATCH 3/7] floppy: move fdctrl_init_sysbus Gerd Hoffmann
2021-08-04 14:27 ` [PATCH 4/7] floppy: move sun4m_fdctrl_init Gerd Hoffmann
2021-08-04 14:27 ` [PATCH 5/7] floppy: move cmos_get_fd_drive_type Gerd Hoffmann
2021-08-04 14:27 ` Gerd Hoffmann [this message]
2021-08-04 14:27 ` [PATCH 7/7] pc: add floppy=OnOffAuto Gerd Hoffmann
2021-08-04 15:19 ` [PATCH 0/7] floppy: build as modules Philippe Mathieu-Daudé
2021-08-05 7:11 ` Gerd Hoffmann
2021-08-16 21:55 ` John Snow
2021-08-17 9:09 ` Philippe Mathieu-Daudé
2021-08-17 13:19 ` John Snow
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=20210804142737.3366441-7-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=ehabkost@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 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).