qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 4f0869: ide: Correct the CHS 'cyls_max' limit


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 4f0869: ide: Correct the CHS 'cyls_max' limit to be 65535
Date: Tue, 26 Jan 2016 02:30:03 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 4f0869948201af740114fed4468165cf927614fa
      
https://github.com/qemu/qemu/commit/4f0869948201af740114fed4468165cf927614fa
  Author: Shmulik Ladkani <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/ide/qdev.c

  Log Message:
  -----------
  ide: Correct the CHS 'cyls_max' limit to be 65535

In b7eb0c9:
  hw/block-common: Factor out fall back to legacy -drive cyls=...
'blkconf_geometry()' was introduced, factoring out CHS limit validation
code that was repeated in ide, scsi, virtio-blk.

The original IDE CHS limit prior b7eb0c9 was 65535,16,255 (as per ATA
CHS addressing).
However the 'cyls_max' argument passed to 'blkconf_geometry' in the
ide_dev_initfn case was accidentally set to 65536 instead of 65535.

Fix, providing the correct 'cyls_max'.

Signed-off-by: Shmulik Ladkani <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: John Snow <address@hidden>


  Commit: 9a97223399f58986d85dad457c8f69d484ed822b
      
https://github.com/qemu/qemu/commit/9a97223399f58986d85dad457c8f69d484ed822b
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c

  Log Message:
  -----------
  fdc: move pick_geometry

Code motion: I want to refactor this function to work with FDrive
directly, so shuffle it below that definition.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: 21862658fdd1f3024cb477834a959588cfad036f
      
https://github.com/qemu/qemu/commit/21862658fdd1f3024cb477834a959588cfad036f
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c

  Log Message:
  -----------
  fdc: reduce number of pick_geometry arguments

Modify this function to operate directly on FDrive objects instead of
unpacking and passing all of those parameters manually. Reduces the
complexity in the caller and reduces the number of args to just one.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: 2da44dd0c60488727e9ca429ec1480e0968d0ca1
      
https://github.com/qemu/qemu/commit/2da44dd0c60488727e9ca429ec1480e0968d0ca1
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c
    M hw/i386/pc.c
    M include/hw/block/fdc.h
    M qapi/block.json

  Log Message:
  -----------
  fdc: add drive type qapi enum

Change the floppy drive type to a QAPI enum type, to allow us to
specify the floppy drive type from the CLI in a forthcoming patch.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: 16c1e3ece4052ebeb2fdf3b6560cca431d0359b9
      
https://github.com/qemu/qemu/commit/16c1e3ece4052ebeb2fdf3b6560cca431d0359b9
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c

  Log Message:
  -----------
  fdc: add disk field

Currently, 'drive' is used both to represent the current diskette
type as well as the current drive type.

This patch adds a 'disk' field that is updated explicitly to match
the type of the disk.

As of this patch, disk and drive are always the same, but forthcoming
patches to change the behavior of pick_geometry will invalidate this
assumption.

disk does not need to be migrated because it is not user-visible state
nor is it currently used for any calculations. It is purely informative,
and will be rebuilt automatically via fd_revalidate on the new host.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: 69ce1ac26dcdd2073d4b4dc0eb52787eb9fca628
      
https://github.com/qemu/qemu/commit/69ce1ac26dcdd2073d4b4dc0eb52787eb9fca628
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c

  Log Message:
  -----------
  fdc: Throw an assertion on misconfigured fd_formats table

pick_geometry is a convoluted function that makes it difficult to tell
at a glance what QEMU's current behavior for choosing a floppy drive
type is when it can't quite identify the diskette.

The code iterates over all entries in the candidate geometry table
("fd_formats") and if our specific drive type matches a row in the table,
then either "match" is set to that entry (an exact match) and the loop
exits, or "first_match" will be non-negative (the first such entry that
shares the same drive type), and the loop continues. If our specific
drive type is NONE, then all drive types in the candidate geometry table
are considered. After iteration, if "match" was not set, we fall back to
"first match".

This means that either "match" was set, or we exited the loop without an
exact match, in which case:

- If drive type is NONE, the default is truly fd_formats[0], a 1.44MB
  type, because "first_match" will always get set to the first item.

- If drive type is not NONE, pick_geometry's iteration was fussier and
  only looked at rows that matched our drive type. However, since all
  possible drive types are represented in the table, we still know that
  "first match" was set.

- If drive type is not NONE and the fd_formats table lists no options for
  our drive type, we choose fd_formats[1], an incomprehensibly bizarre
  choice that can never happen anyway.

Correct this: If first_match is -1, it can ONLY mean we didn't edit our
fd_formats table correctly. Throw an assertion instead.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: d5d47efc856c139ec0cd1887e2d018ff9a93c32d
      
https://github.com/qemu/qemu/commit/d5d47efc856c139ec0cd1887e2d018ff9a93c32d
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c

  Log Message:
  -----------
  fdc: add pick_drive

Split apart pick_geometry by creating a pick_drive routine that will only
ever called during device bring-up instead of relying on pick_geometry to
be used in both cases.

With this change, the drive field is changed to be 'write once'. It is
not altered after the initialization routines exit.

media_validated does not need to be migrated. The target VM
will just revalidate the media on post_load anyway.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: a73275dd6fc3bfda33165bebc28e0c33c20cb0a0
      
https://github.com/qemu/qemu/commit/a73275dd6fc3bfda33165bebc28e0c33c20cb0a0
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c
    M hw/core/qdev-properties.c
    M include/hw/qdev-properties.h

  Log Message:
  -----------
  fdc: Add fallback option

Currently, QEMU chooses a drive type automatically based on the inserted
media. If there is no disk inserted, it chooses a 1.44MB drive type.

Change this behavior to be configurable, but leave it defaulted to 1.44.

This is not earnestly intended to be used by a user or a management
library, but rather exists so that pre-2.6 board types can configure it
to be a legacy value.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: fff4687b9ea7da910bb503d5d3d276868f0a1d0f
      
https://github.com/qemu/qemu/commit/fff4687b9ea7da910bb503d5d3d276868f0a1d0f
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c

  Log Message:
  -----------
  fdc: add drive type option

This patch adds a new explicit Floppy Drive Type option. The existing
behavior in QEMU is to automatically guess a drive type based on the
media inserted, or if a diskette is not present, arbitrarily assign one.

This behavior can be described as "auto." This patch adds the option
to pick an explicit behavior: 120, 144, 288 or none. The new "auto"
option is intended to mimic current behavior, while the other types
pick one explicitly.

Set the type given by the CLI during fd_init. If the type remains the
default (auto), we'll attempt to scan an inserted diskette if present
to determine a type. If auto is selected but no diskette is present,
we fall back to a predetermined default (currently 1.44MB to match
legacy QEMU behavior.)

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: 109c17bc208c09a72d9c6c237f3f7b84c6ac91a4
      
https://github.com/qemu/qemu/commit/109c17bc208c09a72d9c6c237f3f7b84c6ac91a4
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c

  Log Message:
  -----------
  fdc: add physical disk sizes

2.88MB capable drives can accept 1.44MB floppies,
for instance. To rework the pick_geometry function,
we need to know if our current drive can even accept
the type of disks we're considering.

NB: This allows us to distinguish between all of the
"total sectors" collisions between 1.20MB and 1.44MB
diskette types, by using the physical drive size as a
differentiator.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: f31937aa8cc144f8196de91be6ec81390da92b1e
      
https://github.com/qemu/qemu/commit/f31937aa8cc144f8196de91be6ec81390da92b1e
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c

  Log Message:
  -----------
  fdc: rework pick_geometry

This one is the crazy one.

fd_revalidate currently uses pick_geometry to tell if the diskette
geometry has changed upon an eject/insert event, but it won't allow us
to insert a 1.44MB diskette into a 2.88MB drive. This is inflexible.

The new algorithm applies a new heuristic to guessing disk geometries
that allows us to switch diskette types as long as the physical size
matches before falling back to the old heuristic.

The old one is roughly:
 - If the size (sectors) and type matches, choose it.
 - Fall back to the first geometry that matched our type.

The new one is:
 - If the size (sectors) and type matches, choose it.
 - If the size (sectors) and physical size match, choose it.
 - Fall back to the first geometry that matched our type.

Signed-off-by: John Snow <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden


  Commit: 62c762504e5d77400e2fefb12e5a9711f8619f3b
      
https://github.com/qemu/qemu/commit/62c762504e5d77400e2fefb12e5a9711f8619f3b
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M tests/fdc-test.c

  Log Message:
  -----------
  qtest/fdc: Support for 2.88MB drives

The old test assumes a 1.44MB drive.
Assert that the QEMU default drive is now either 1.44 or 2.88.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: 4812fa27fa75bce89738a82a191755853dd88408
      
https://github.com/qemu/qemu/commit/4812fa27fa75bce89738a82a191755853dd88408
  Author: John Snow <address@hidden>
  Date:   2016-01-25 (Mon, 25 Jan 2016)

  Changed paths:
    M hw/block/fdc.c
    M include/hw/compat.h

  Log Message:
  -----------
  fdc: change auto fallback drive for ISA FDC to 288

The 2.88 drive is more suitable as a default because
it can still read 1.44 images correctly, but the reverse
is not true.

Since there exist virtio-win drivers that are shipped on
2.88 floppy images, this patch will allow VMs booted without
a floppy disk inserted to later insert a 2.88MB floppy and
have that work.

This patch has been tested with msdos, freedos, fedora,
windows 8 and windows 10 without issue: if problems do
arise for certain guests being unable to cope with 2.88MB
drives as the default, they are in the minority and can use
type=144 as needed (or insert a proper boot medium and omit
type=144/288 or use type=auto) to obtain different drive types.

As icing, the default will remain auto/144 for any pre-2.6
machine types, hopefully minimizing the impact of this change
in legacy hw to basically zero.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden


  Commit: 1535a6d699487740b490369e44f9ca8d305463cd
      
https://github.com/qemu/qemu/commit/1535a6d699487740b490369e44f9ca8d305463cd
  Author: Peter Maydell <address@hidden>
  Date:   2016-01-26 (Tue, 26 Jan 2016)

  Changed paths:
    M hw/block/fdc.c
    M hw/core/qdev-properties.c
    M hw/i386/pc.c
    M hw/ide/qdev.c
    M include/hw/block/fdc.h
    M include/hw/compat.h
    M include/hw/qdev-properties.h
    M qapi/block.json
    M tests/fdc-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into 
staging

# gpg: Signature made Mon 25 Jan 2016 19:39:58 GMT using RSA key ID AAFC390E
# gpg: Good signature from "John Snow (John Huston) <address@hidden>"

* remotes/jnsnow/tags/ide-pull-request:
  fdc: change auto fallback drive for ISA FDC to 288
  qtest/fdc: Support for 2.88MB drives
  fdc: rework pick_geometry
  fdc: add physical disk sizes
  fdc: add drive type option
  fdc: Add fallback option
  fdc: add pick_drive
  fdc: Throw an assertion on misconfigured fd_formats table
  fdc: add disk field
  fdc: add drive type qapi enum
  fdc: reduce number of pick_geometry arguments
  fdc: move pick_geometry
  ide: Correct the CHS 'cyls_max' limit to be 65535

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/6ee06cc3dc7e...1535a6d69948

reply via email to

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