qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] How to correctly use more than 2 floppy drives?


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] How to correctly use more than 2 floppy drives?
Date: Fri, 5 Apr 2019 11:53:27 +0100
User-agent: Mutt/1.11.4 (2019-03-13)

* Philippe Mathieu-Daudé (address@hidden) wrote:
> Hi,
> 
> I am trying to understand the possible values for the MAX_FD variable
> used by the floppy controller model (hw/block/fdc.c).
> 
> Looking at git history:
> 
> - 2004-01-05 7138fcfbf7dd + 8977f3c107ef (Jocelyn Mayer):
>   FDC introduced with "#define MAX_FD 2"
> 
> - 2008-04-29 78ae820cfeb0 (Hervé Poussineau):
>   Supports up to 4 floppy drives if MAX_FD is set to 4
>   Migration stream knows about runtime value of MAX_FD
> 
> - 2009-09-10 d7a6c2703577 (Juan Quintela):
>   FDC vmstate-ified
>   Migration stream use compile time value of MAX_FD
> 
> Since 7138fcfbf7dd MAX_FD has always been defined as 2.
> 
> Since d7a6c2703577 MAX_FD can not be different than 2 without breaking
> migration.
> 
> If I understand correctly migration, first we should change in
> vmstate_fdc the user-definable MAX_FD by a constant 2 value.

Right.

> Then to be able to use >2 floppy disks I have to modify the the
> vmstate.version_id, and
> 
> 1/ add a new field in the vmstate_fdc containing the number of drives
> and add code to check >2 and adapt
> 
> or
> 
> 2/ change MAX_FD to 4 for all the codebase, adding some code to migrate
> to older FDC with only 2 disks...

Or, you add a subsection which is conditional on MAX_FD > 2 and which
only stores the state of the extra FDs.

> Another option I don't like is:
> 
> 3/ get ride of MAX_FD != 2 and clean the codebase...

Seems sane to me.

> $ git grep '#if MAX_FD'
> hw/block/fdc.c:744:#if MAX_FD == 4
> hw/block/fdc.c:758:#if MAX_FD == 4
> hw/block/fdc.c:1317:#if MAX_FD == 4
> hw/block/fdc.c:1340:#if MAX_FD == 4
> hw/block/fdc.c:2041:#if MAX_FD == 4
> hw/block/fdc.c:2079:#if MAX_FD == 4
> hw/block/fdc.c:2104:#if MAX_FD == 4
> 
> Hervé, what board are/were you using with 4 floppy drives?
> 
> BTW this link is somehow interesting :)
> https://www.seasip.info/VintagePC/floppies.html

Ah interesting; I did wonder because I've never seen machines
with more than 2 (double sided) drives.

Dave

> Thanks,
> 
> Phil.
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

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