qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [RFC 02/10] fdc: add default drive type op


From: Markus Armbruster
Subject: Re: [Qemu-block] [Qemu-devel] [RFC 02/10] fdc: add default drive type option
Date: Fri, 03 Jul 2015 15:21:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

John Snow <address@hidden> 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 <address@hidden>
> ---
>  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[].

[...]



reply via email to

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