From: John Snow <jsnow@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 05/11] fdc: Add fallback option
Date: Fri, 18 Dec 2015 12:22:25 -0500 [thread overview]
Message-ID: <567440D1.7070104@redhat.com> (raw)
In-Reply-To: <87lh8r4umw.fsf@blackfin.pond.sub.org>
On 12/18/2015 10:57 AM, Markus Armbruster wrote:
> John Snow <jsnow@redhat.com> writes:
>
>> Add the fallback drive type as an option so we can control
>> the behavior as a function of the QEMU machine version.
>
> What's a "fallback drive type", and what does (or will) it do?
>
I assume you mean "Make your commit messages better."
The fallback type accompanies the "auto" drive type as the fallback
drive type that gets selected if there is an issue auto-guessing from
the diskette.
It comes into play in two places:
(1) There's simply no diskette, or
(2) We couldn't figure out what kind of diskette it was.
The legacy behavior is implicitly type=auto,fallback=144. It is now
explicitly so, and the new behavior (at patch 11) is type=auto,fallback=288.
>>
>> Signed-off-by: John Snow <jsnow@redhat.com>
>> ---
>> hw/block/fdc.c | 23 +++++++++++++++++++++++
>> 1 file changed, 23 insertions(+)
>>
>> diff --git a/hw/block/fdc.c b/hw/block/fdc.c
>> index ad0e052..b587de8 100644
>> --- a/hw/block/fdc.c
>> +++ b/hw/block/fdc.c
>> @@ -155,6 +155,9 @@ typedef struct FDrive {
>> bool media_inserted; /* Is there a medium in the tray */
>> } FDrive;
>>
>> +
>> +static FloppyDriveType get_fallback_drive_type(FDrive *drv);
>> +
>> static void fd_init(FDrive *drv)
>> {
>> /* Drive */
>> @@ -570,8 +573,15 @@ struct FDCtrl {
>> uint8_t timer0;
>> uint8_t timer1;
>>
>> + FloppyDriveType fallback;
>> };
>>
>> +__attribute__((__unused__))
>> +static FloppyDriveType get_fallback_drive_type(FDrive *drv)
>> +{
>> + return drv->fdctrl->fallback;
>> +}
>> +
>> #define TYPE_SYSBUS_FDC "base-sysbus-fdc"
>> #define SYSBUS_FDC(obj) OBJECT_CHECK(FDCtrlSysBus, (obj), TYPE_SYSBUS_FDC)
>>
>> @@ -2302,6 +2312,10 @@ static void fdctrl_realize_common(FDCtrl *fdctrl, Error **errp)
>> int i, j;
>> static int command_tables_inited = 0;
>>
>> + if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
>> + error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'");
>> + }
>> +
>> /* Fill 'command_to_handler' lookup table */
>> if (!command_tables_inited) {
>> command_tables_inited = 1;
>> @@ -2433,6 +2447,9 @@ static Property isa_fdc_properties[] = {
>> DEFINE_PROP_DEFAULT("fdtypeB", FDCtrlISABus, state.drives[1].drive,
>> FDRIVE_DEFAULT, qdev_prop_fdc_drive_type,
>> FloppyDriveType),
>> + DEFINE_PROP_DEFAULT("fallback", FDCtrlISABus, state.fallback,
>> + FLOPPY_DRIVE_TYPE_144, qdev_prop_fdc_drive_type,
>> + FloppyDriveType),
>> DEFINE_PROP_END_OF_LIST(),
>> };
>>
>> @@ -2487,6 +2504,9 @@ static Property sysbus_fdc_properties[] = {
>> DEFINE_PROP_DEFAULT("fdtypeB", FDCtrlSysBus, state.drives[1].drive,
>> FDRIVE_DEFAULT, qdev_prop_fdc_drive_type,
>> FloppyDriveType),
>> + DEFINE_PROP_DEFAULT("fallback", FDCtrlISABus, state.fallback,
>> + FLOPPY_DRIVE_TYPE_144, qdev_prop_fdc_drive_type,
>> + FloppyDriveType),
>> DEFINE_PROP_END_OF_LIST(),
>> };
>>
>> @@ -2510,6 +2530,9 @@ static Property sun4m_fdc_properties[] = {
>> DEFINE_PROP_DEFAULT("fdtype", FDCtrlSysBus, state.drives[0].drive,
>> FDRIVE_DEFAULT, qdev_prop_fdc_drive_type,
>> FloppyDriveType),
>> + DEFINE_PROP_DEFAULT("fallback", FDCtrlISABus, state.fallback,
>> + FLOPPY_DRIVE_TYPE_144, qdev_prop_fdc_drive_type,
>> + FloppyDriveType),
>> DEFINE_PROP_END_OF_LIST(),
>> };
next prev parent reply other threads:[~2015-12-18 17:22 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 22:16 [Qemu-devel] [PATCH v3 00/11] fdc: fix 2.88mb floppy diskette support John Snow
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 01/11] fdc: move pick_geometry John Snow
2015-12-18 16:15 ` Eric Blake
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 02/11] fdc: refactor pick_geometry John Snow
2015-12-17 7:53 ` Markus Armbruster
2015-12-17 17:50 ` John Snow
2015-12-17 19:09 ` Markus Armbruster
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 03/11] fdc: add disk field John Snow
2015-12-17 8:30 ` Markus Armbruster
2015-12-17 16:59 ` John Snow
2015-12-17 18:15 ` Markus Armbruster
2015-12-17 18:55 ` John Snow
2015-12-17 19:04 ` Markus Armbruster
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 04/11] fdc: add default drive type option John Snow
2015-12-16 23:03 ` Eric Blake
2015-12-18 15:54 ` Markus Armbruster
2015-12-18 17:20 ` John Snow
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 05/11] fdc: Add fallback option John Snow
2015-12-18 15:57 ` Markus Armbruster
2015-12-18 17:22 ` John Snow [this message]
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 06/11] fdc: do not call revalidate on eject John Snow
2015-12-18 16:11 ` Markus Armbruster
2015-12-18 20:13 ` John Snow
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 07/11] fdc: implement new drive type property John Snow
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 08/11] fdc: add physical disk sizes John Snow
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 09/11] fdc: rework pick_geometry John Snow
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 10/11] qtest/fdc: Support for 2.88MB drives John Snow
2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 11/11] fdc: change auto fallback drive for ISA FDC to 288 John Snow
2015-12-16 22:30 ` 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=567440D1.7070104@redhat.com \
--to=jsnow@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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).