All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 00/11] fdc: fix 2.88mb floppy diskette support
@ 2015-12-16 22:16 John Snow
  2015-12-16 22:16 ` [Qemu-devel] [PATCH v3 01/11] fdc: move pick_geometry John Snow
                   ` (10 more replies)
  0 siblings, 11 replies; 29+ messages in thread
From: John Snow @ 2015-12-16 22:16 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, John Snow, armbru, qemu-devel

requires: 1448895398-13465-1-git-send-email-ehabkost@redhat.com
          pc: Add pc-*-2.6 machine classes

Yes, it's been broken for ten years.
No, it's not a CVE.

The problem is that QEMU doesn't have a configuration option for the type
of floppy drive you want. It determines that based on the type of
diskette inserted at boot time.

If you don't insert one, it always chooses a 1.44MB type.

If you want to insert a 2.88MB floppy after boot, you simply cannot.

"Wow, who cares?"

Good question -- Unfortunately, the virtio-win floppy disk images that
Red Hat/Fedora ship require a 2.88MB drive, so if you forgot to insert
them at boot, you'd have to change your VM configuration and try again.

For a one-shot operation, that's kind of obnoxious -- it'd be nice to
allow one to just insert the diskette on-demand.

"OK, What are you changing in this decades-old device?"

(1) Add a new property to allow users to specify what kind of drive they
    want without relying on magical guessing behavior.
    Choices are: 120, 144, 288, auto, and none.

    120, 144 and 288 refer to 1.20MB, 1.44MB, and 2.88MB drives.
    auto refers to the auto-detect behavior QEMU currently has.
    none ... hides the drive. You probably don't want to use this,
    but it's there if you feel like creating a drive you can't use.

(2) Add a new "fallback" property for use with the "auto" drive type
    that allows us to specify the backup behavior, too. In most cases
    this property won't be needed, but it is provided for allowing
    QEMU to be fully backwards compatible.

(3) Add the concept of physical diskette size to QEMU, classifying
    120-style diskettes as fundamentally different from 144 and 288 ones.

(4) Revamp the automatic guessing heuristic to understand that
    2.88MB style drives can accept 1.44MB diskettes.

(5) Change the automatic fallback type for the automatic guessing
    heuristic from 1.44MB to 2.88MB for 2.6 machines and beyond,
    leaving 2.5- machines set to default to auto/144.

(6) A lot of code cleanup in general.

"Won't this break everything, you madman?"

No: I tested this in MS-DOS 6.22, Fedora 23 and Windows 8.1. All
seemed perfectly happy with 2.88MB drives as the default for 1.44
or 2.88MB floppy diskette images.

And: Older machine types will happily still default to the 1.44
     type just like they used to, so really nothing should change
     at all for most guests.

If there ARE any guests affected in 2.6+ machine types, you are
urged to use an explicit drive type that matches your application
if the automatic behavior is unsuitable.

===
v3:
===

001/11:[----] [--] 'fdc: move pick_geometry'
002/11:[----] [--] 'fdc: refactor pick_geometry'
003/11:[----] [--] 'fdc: add disk field'
004/11:[0037] [FC] 'fdc: add default drive type option'
005/11:[down] 'fdc: Add fallback option'
006/11:[----] [-C] 'fdc: do not call revalidate on eject'
007/11:[0030] [FC] 'fdc: implement new drive type property'
008/11:[----] [-C] 'fdc: add physical disk sizes'
009/11:[0018] [FC] 'fdc: rework pick_geometry'
010/11:[----] [--] 'qtest/fdc: Support for 2.88MB drives'
011/11:[down] 'fdc: change auto fallback drive for ISA FDC to 288'

04: Remove typeA/typeB members of FDCtrl. Store e.g. -fdtypeA options
           directly into FDCtrl.drives[x].drive instead.
05: Add a new fallback= option that controls fdtype{A,B}=auto behavior.
07: replace get_default_drive_type which is no longer needed
    add get_fallback_drive_type.
09: Reworked the auto/fallback section of pick_geometry.

________________________________________________________________________________

For convenience, this branch is available at:
https://github.com/jnsnow/qemu.git branch fdc-default
https://github.com/jnsnow/qemu/tree/fdc-default

This version is tagged fdc-default-v3:
https://github.com/jnsnow/qemu/releases/tag/fdc-default-v3

John Snow (11):
  fdc: move pick_geometry
  fdc: refactor pick_geometry
  fdc: add disk field
  fdc: add default drive type option
  fdc: Add fallback option
  fdc: do not call revalidate on eject
  fdc: implement new drive type property
  fdc: add physical disk sizes
  fdc: rework pick_geometry
  qtest/fdc: Support for 2.88MB drives
  fdc: change auto fallback drive for ISA FDC to 288

 hw/block/fdc.c               | 317 +++++++++++++++++++++++++++++--------------
 hw/core/qdev-properties.c    |  11 ++
 hw/i386/pc.c                 |  17 +--
 include/hw/block/fdc.h       |   9 +-
 include/hw/compat.h          |   6 +-
 include/hw/qdev-properties.h |   1 +
 qapi/block.json              |  16 +++
 tests/fdc-test.c             |   2 +-
 8 files changed, 260 insertions(+), 119 deletions(-)

-- 
2.4.3

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2015-12-18 20:13 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.