John Snow <js...@redhat.com> writes: > We want to change the current default drive type, > but to be kind, we need to allow users to specify > the old drive type somehow. > > Signed-off-by: John Snow <js...@redhat.com> > --- > hw/block/fdc.c | 13 +++++++++++++ > hw/core/qdev-properties.c | 12 ++++++++++++ > include/hw/block/fdc.h | 7 +------ > include/hw/qdev-properties.h | 1 + > qapi/block.json | 15 +++++++++++++++ > 5 files changed, 42 insertions(+), 6 deletions(-) > > diff --git a/hw/block/fdc.c b/hw/block/fdc.c > index cdf9e09..1023a01 100644 > --- a/hw/block/fdc.c > +++ b/hw/block/fdc.c > @@ -67,6 +67,8 @@ typedef struct FDFormat { > FDriveRate rate; > } FDFormat; > > +#define FDRIVE_DEFAULT FDRIVE_DRV_144 > + > static const FDFormat fd_formats[] = { > /* First entry is default format */ > /* 1.44 MB 3"1/2 floppy disks */ > @@ -578,6 +580,9 @@ struct FDCtrl { > /* Timers state */ > uint8_t timer0; > uint8_t timer1; > + > + FDriveType defaultA; > + FDriveType defaultB; > }; > > #define TYPE_SYSBUS_FDC "base-sysbus-fdc" > @@ -2423,6 +2428,10 @@ static Property isa_fdc_properties[] = { > DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.drives[1].blk), > DEFINE_PROP_BIT("check_media_rate", FDCtrlISABus, state.check_media_rate, > 0, true), > + DEFINE_PROP_DEFAULT("defaultA", FDCtrlISABus, state.defaultA, > + FDRIVE_DEFAULT, qdev_prop_fdc_drive_type, > FDriveType), > + DEFINE_PROP_DEFAULT("defaultB", FDCtrlISABus, state.defaultB, > + FDRIVE_DEFAULT, qdev_prop_fdc_drive_type, > FDriveType), > DEFINE_PROP_END_OF_LIST(), > }; > > @@ -2471,6 +2480,10 @@ static const VMStateDescription vmstate_sysbus_fdc ={ > static Property sysbus_fdc_properties[] = { > DEFINE_PROP_DRIVE("driveA", FDCtrlSysBus, state.drives[0].blk), > DEFINE_PROP_DRIVE("driveB", FDCtrlSysBus, state.drives[1].blk), > + DEFINE_PROP_DEFAULT("defaultA", FDCtrlSysBus, state.defaultA, > + FDRIVE_DEFAULT, qdev_prop_fdc_drive_type, > FDriveType), > + DEFINE_PROP_DEFAULT("defaultB", FDCtrlSysBus, state.defaultB, > + FDRIVE_DEFAULT, qdev_prop_fdc_drive_type, > FDriveType), > DEFINE_PROP_END_OF_LIST(), > }; >
You missed sun4m_fdc_properties[]. [...]