Received: from eggs.gnu.org ([2001:4830:134:3::10]:60449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB0uG-0003oj-LE for qemu-devel@nongnu.org; Fri, 03 Jul 2015 09:21:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZB0uF-0000s3-GE for qemu-devel@nongnu.org; Fri, 03 Jul 2015 09:21:28 -0400 From: Markus Armbruster References: <1435713640-12362-1-git-send-email-jsnow@redhat.com> <1435713640-12362-3-git-send-email-jsnow@redhat.com> Date: Fri, 03 Jul 2015 15:21:15 +0200 In-Reply-To: <1435713640-12362-3-git-send-email-jsnow@redhat.com> (John Snow's message of "Tue, 30 Jun 2015 21:20:32 -0400") Message-ID: <87wpyh5qd0.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [RFC 02/10] fdc: add default drive type option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org John Snow 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 > --- > 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[]. [...]