aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-03-09 17:12:11 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-03-19 15:18:43 +0100
commit36585e2b12c25133b88fc8acfc5c603b0b539074 (patch)
tree251a8e5b60ae218d0c5e43afe84b5d961a719838 /hw
parentbd36f1fe1aa96e85d781df017651fda4945f9968 (diff)
downloadqemu-36585e2b12c25133b88fc8acfc5c603b0b539074.zip
qemu-36585e2b12c25133b88fc8acfc5c603b0b539074.tar.gz
qemu-36585e2b12c25133b88fc8acfc5c603b0b539074.tar.bz2
fdc: Drop deprecated floppy configuration
Drop the crap deprecated in commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" (v5.1.0). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20210309161214.1402527-3-armbru@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/block/fdc.c54
1 files changed, 2 insertions, 52 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 198940e..f978ddf 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -870,7 +870,6 @@ struct FDCtrl {
uint8_t num_floppies;
FDrive drives[MAX_FD];
struct {
- BlockBackend *blk;
FloppyDriveType type;
} qdev_for_drives[MAX_FD];
int reset_sensei;
@@ -2517,56 +2516,12 @@ static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev,
{
unsigned int i;
FDrive *drive;
- DeviceState *dev;
- BlockBackend *blk;
- bool ok;
- const char *fdc_name, *drive_suffix;
for (i = 0; i < MAX_FD; i++) {
drive = &fdctrl->drives[i];
drive->fdctrl = fdctrl;
-
- /* If the drive is not present, we skip creating the qdev device, but
- * still have to initialise the controller. */
- blk = fdctrl->qdev_for_drives[i].blk;
- if (!blk) {
- fd_init(drive);
- fd_revalidate(drive);
- continue;
- }
-
- fdc_name = object_get_typename(OBJECT(fdc_dev));
- drive_suffix = !strcmp(fdc_name, "SUNW,fdtwo") ? "" : i ? "B" : "A";
- warn_report("warning: property %s.drive%s is deprecated",
- fdc_name, drive_suffix);
- error_printf("Use -device floppy,unit=%d,drive=... instead.\n", i);
-
- dev = qdev_new("floppy");
- qdev_prop_set_uint32(dev, "unit", i);
- qdev_prop_set_enum(dev, "drive-type", fdctrl->qdev_for_drives[i].type);
-
- /*
- * Hack alert: we move the backend from the floppy controller
- * device to the floppy device. We first need to detach the
- * controller, or else floppy_create()'s qdev_prop_set_drive()
- * will die when it attaches floppy device. We also need to
- * take another reference so that blk_detach_dev() doesn't
- * free blk while we still need it.
- *
- * The hack is probably a bad idea.
- */
- blk_ref(blk);
- blk_detach_dev(blk, fdc_dev);
- fdctrl->qdev_for_drives[i].blk = NULL;
- ok = qdev_prop_set_drive_err(dev, "drive", blk, errp);
- blk_unref(blk);
- if (!ok) {
- return;
- }
-
- if (!qdev_realize_and_unref(dev, &fdctrl->bus.bus, errp)) {
- return;
- }
+ fd_init(drive);
+ fd_revalidate(drive);
}
}
@@ -2882,8 +2837,6 @@ static Property isa_fdc_properties[] = {
DEFINE_PROP_UINT32("iobase", FDCtrlISABus, iobase, 0x3f0),
DEFINE_PROP_UINT32("irq", FDCtrlISABus, irq, 6),
DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
- DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.qdev_for_drives[0].blk),
- DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.qdev_for_drives[1].blk),
DEFINE_PROP_SIGNED("fdtypeA", FDCtrlISABus, state.qdev_for_drives[0].type,
FLOPPY_DRIVE_TYPE_AUTO, qdev_prop_fdc_drive_type,
FloppyDriveType),
@@ -2941,8 +2894,6 @@ static const VMStateDescription vmstate_sysbus_fdc ={
};
static Property sysbus_fdc_properties[] = {
- DEFINE_PROP_DRIVE("driveA", FDCtrlSysBus, state.qdev_for_drives[0].blk),
- DEFINE_PROP_DRIVE("driveB", FDCtrlSysBus, state.qdev_for_drives[1].blk),
DEFINE_PROP_SIGNED("fdtypeA", FDCtrlSysBus, state.qdev_for_drives[0].type,
FLOPPY_DRIVE_TYPE_AUTO, qdev_prop_fdc_drive_type,
FloppyDriveType),
@@ -2971,7 +2922,6 @@ static const TypeInfo sysbus_fdc_info = {
};
static Property sun4m_fdc_properties[] = {
- DEFINE_PROP_DRIVE("drive", FDCtrlSysBus, state.qdev_for_drives[0].blk),
DEFINE_PROP_SIGNED("fdtype", FDCtrlSysBus, state.qdev_for_drives[0].type,
FLOPPY_DRIVE_TYPE_AUTO, qdev_prop_fdc_drive_type,
FloppyDriveType),