From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aM1YW-0008Gl-Dc for qemu-devel@nongnu.org; Wed, 20 Jan 2016 17:48:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aM1YV-0001KL-C7 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 17:48:48 -0500 References: <1453272694-17106-1-git-send-email-jsnow@redhat.com> <1453272694-17106-10-git-send-email-jsnow@redhat.com> From: Eric Blake Message-ID: <56A00EC9.9000702@redhat.com> Date: Wed, 20 Jan 2016 15:48:41 -0700 MIME-Version: 1.0 In-Reply-To: <1453272694-17106-10-git-send-email-jsnow@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6xRDLB99uVADJar85QsjoNweVsTr5Kvcb" Subject: Re: [Qemu-devel] [PATCH v4 09/12] fdc: add physical disk sizes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6xRDLB99uVADJar85QsjoNweVsTr5Kvcb Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/19/2016 11:51 PM, John Snow wrote: > 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. >=20 > 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. >=20 > Signed-off-by: John Snow > --- > hw/block/fdc.c | 40 ++++++++++++++++++++++++++++++++-------- > 1 file changed, 32 insertions(+), 8 deletions(-) >=20 > +/* In many cases, the total sector size of a format is enough to uniqu= ely > + * identify it. However, there are some total sector collisions betwee= n > + * formats of different physical size, and these are noted below by > + * highlighting the total sector size for entries with collisions. */ > static const FDFormat fd_formats[] =3D { > /* First entry is default format */ > /* 1.44 MB 3"1/2 floppy disks */ > - { FLOPPY_DRIVE_TYPE_144, 18, 80, 1, FDRIVE_RATE_500K, }, > - { FLOPPY_DRIVE_TYPE_144, 20, 80, 1, FDRIVE_RATE_500K, }, > + { FLOPPY_DRIVE_TYPE_144, 18, 80, 1, FDRIVE_RATE_500K, }, /* 3.5" 2= 880 */ > + { FLOPPY_DRIVE_TYPE_144, 20, 80, 1, FDRIVE_RATE_500K, }, /* 3.5" 3= 200 */ > { FLOPPY_DRIVE_TYPE_144, 21, 80, 1, FDRIVE_RATE_500K, }, > { FLOPPY_DRIVE_TYPE_144, 21, 82, 1, FDRIVE_RATE_500K, }, > { FLOPPY_DRIVE_TYPE_144, 21, 83, 1, FDRIVE_RATE_500K, }, > @@ -85,7 +95,7 @@ static const FDFormat fd_formats[] =3D { > { FLOPPY_DRIVE_TYPE_288, 44, 80, 1, FDRIVE_RATE_1M, }, > { FLOPPY_DRIVE_TYPE_288, 48, 80, 1, FDRIVE_RATE_1M, }, > /* 720 kB 3"1/2 floppy disks */ > - { FLOPPY_DRIVE_TYPE_144, 9, 80, 1, FDRIVE_RATE_250K, }, > + { FLOPPY_DRIVE_TYPE_144, 9, 80, 1, FDRIVE_RATE_250K, }, /* 3.5" 1= 400 */ Typo? I think you meant 1440. > +__attribute__((__unused__)) > +static FDriveSize drive_size(FloppyDriveType drive) > +{ > + switch (drive) { > + case FLOPPY_DRIVE_TYPE_120: > + return FDRIVE_SIZE_525; > + case FLOPPY_DRIVE_TYPE_144: > + case FLOPPY_DRIVE_TYPE_288: > + return FDRIVE_SIZE_350; > + default: > + return FDRIVE_SIZE_UNKNOWN; > + } > +} With that fixed, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6xRDLB99uVADJar85QsjoNweVsTr5Kvcb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWoA7JAAoJEKeha0olJ0Nq40sH/0axZWaEQLIn8qt18YgHYn8Z hIz1NFlqX47l3Bm11+hHng0FRfVxJiOTRHBTybJXXbEO2zwCE21ZJ7gyZnR6bUlz pvAlw4VNZ9L9rmT24Ka8h9vQY7teRLjnUsxOAqvs74WqhiBA4d2gYEHNLImeWN+p zYK7i95/T8F2+DBxDyfuqWtNjW6UcsiDLCCaqvUQaPX3nbz7kts7CMs4sQEKKg36 TaqAeq6iok/eZ3usn0isTEGuIbjDzrjv7np9NtL0Ja1LIFlrINz8pFGAMibnSkNp lhWHyTb4UKUrlJMjfsvYYzY0bQ9nUhTU2Qvh9lUxT5+fKOUReFdCEpQlQx4lDvs= =Ddxl -----END PGP SIGNATURE----- --6xRDLB99uVADJar85QsjoNweVsTr5Kvcb--