* [Qemu-devel] How to correctly use more than 2 floppy drives?
@ 2019-04-05 10:29 Philippe Mathieu-Daudé
2019-04-05 10:29 ` Philippe Mathieu-Daudé
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-04-05 10:29 UTC (permalink / raw)
To: Hervé Poussineau, Juan Quintela, Dr. David Alan Gilbert,
Thomas Huth, Mark Cave-Ayland
Cc: John Snow, Kevin Wolf, Markus Armbruster, QEMU Developers
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.
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...
Another option I don't like is:
3/ get ride of MAX_FD != 2 and clean the codebase...
$ 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
Thanks,
Phil.
^ permalink raw reply [flat|nested] 14+ messages in thread* [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-05 10:29 [Qemu-devel] How to correctly use more than 2 floppy drives? Philippe Mathieu-Daudé @ 2019-04-05 10:29 ` Philippe Mathieu-Daudé 2019-04-05 10:53 ` Dr. David Alan Gilbert 2019-04-05 16:35 ` Hervé Poussineau 2 siblings, 0 replies; 14+ messages in thread From: Philippe Mathieu-Daudé @ 2019-04-05 10:29 UTC (permalink / raw) To: Hervé Poussineau, Juan Quintela, Dr. David Alan Gilbert, Thomas Huth, Mark Cave-Ayland Cc: Kevin Wolf, John Snow, Markus Armbruster, QEMU Developers 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. 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... Another option I don't like is: 3/ get ride of MAX_FD != 2 and clean the codebase... $ 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 Thanks, Phil. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-05 10:29 [Qemu-devel] How to correctly use more than 2 floppy drives? Philippe Mathieu-Daudé 2019-04-05 10:29 ` Philippe Mathieu-Daudé @ 2019-04-05 10:53 ` Dr. David Alan Gilbert 2019-04-05 10:53 ` Dr. David Alan Gilbert 2019-04-05 16:35 ` Hervé Poussineau 2 siblings, 1 reply; 14+ messages in thread From: Dr. David Alan Gilbert @ 2019-04-05 10:53 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: Hervé Poussineau, Juan Quintela, Thomas Huth, Mark Cave-Ayland, John Snow, Kevin Wolf, Markus Armbruster, QEMU Developers * Philippe Mathieu-Daudé (philmd@redhat.com) 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 / dgilbert@redhat.com / Manchester, UK ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-05 10:53 ` Dr. David Alan Gilbert @ 2019-04-05 10:53 ` Dr. David Alan Gilbert 0 siblings, 0 replies; 14+ messages in thread From: Dr. David Alan Gilbert @ 2019-04-05 10:53 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: Kevin Wolf, Thomas Huth, Juan Quintela, Mark Cave-Ayland, Markus Armbruster, QEMU Developers, Hervé Poussineau, John Snow [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 2172 bytes --] * Philippe Mathieu-Daudé (philmd@redhat.com) 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 / dgilbert@redhat.com / Manchester, UK ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-05 10:29 [Qemu-devel] How to correctly use more than 2 floppy drives? Philippe Mathieu-Daudé 2019-04-05 10:29 ` Philippe Mathieu-Daudé 2019-04-05 10:53 ` Dr. David Alan Gilbert @ 2019-04-05 16:35 ` Hervé Poussineau 2019-04-05 16:35 ` Hervé Poussineau 2019-04-08 5:38 ` Markus Armbruster 2 siblings, 2 replies; 14+ messages in thread From: Hervé Poussineau @ 2019-04-05 16:35 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Juan Quintela, Dr. David Alan Gilbert, Thomas Huth, Mark Cave-Ayland Cc: John Snow, Kevin Wolf, Markus Armbruster, QEMU Developers Le 05/04/2019 à 12:29, Philippe Mathieu-Daudé a écrit : > 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. > > 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... > > Another option I don't like is: > > 3/ get ride of MAX_FD != 2 and clean the codebase... > > $ 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? That was only an attempt to support 4 drives in code, as controller was able to do it. However, no emulated board took advantage of it, so that's why it kind-of regressed. Feel free to choose the solution you prefer. Hervé > BTW this link is somehow interesting :) > https://www.seasip.info/VintagePC/floppies.html > > Thanks, > > Phil. > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-05 16:35 ` Hervé Poussineau @ 2019-04-05 16:35 ` Hervé Poussineau 2019-04-08 5:38 ` Markus Armbruster 1 sibling, 0 replies; 14+ messages in thread From: Hervé Poussineau @ 2019-04-05 16:35 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Juan Quintela, Dr. David Alan Gilbert, Thomas Huth, Mark Cave-Ayland Cc: Kevin Wolf, John Snow, Markus Armbruster, QEMU Developers Le 05/04/2019 à 12:29, Philippe Mathieu-Daudé a écrit : > 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. > > 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... > > Another option I don't like is: > > 3/ get ride of MAX_FD != 2 and clean the codebase... > > $ 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? That was only an attempt to support 4 drives in code, as controller was able to do it. However, no emulated board took advantage of it, so that's why it kind-of regressed. Feel free to choose the solution you prefer. Hervé > BTW this link is somehow interesting :) > https://www.seasip.info/VintagePC/floppies.html > > Thanks, > > Phil. > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-05 16:35 ` Hervé Poussineau 2019-04-05 16:35 ` Hervé Poussineau @ 2019-04-08 5:38 ` Markus Armbruster 2019-04-08 5:38 ` Markus Armbruster 2019-04-08 19:30 ` John Snow 1 sibling, 2 replies; 14+ messages in thread From: Markus Armbruster @ 2019-04-08 5:38 UTC (permalink / raw) To: Hervé Poussineau Cc: Philippe Mathieu-Daudé, Juan Quintela, Dr. David Alan Gilbert, Thomas Huth, Mark Cave-Ayland, Kevin Wolf, John Snow, QEMU Developers Hervé Poussineau <hpoussin@reactos.org> writes: > Le 05/04/2019 à 12:29, Philippe Mathieu-Daudé a écrit : >> 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. >> >> 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... >> >> Another option I don't like is: >> >> 3/ get ride of MAX_FD != 2 and clean the codebase... >> >> $ 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? > > That was only an attempt to support 4 drives in code, as controller was able to do it. > However, no emulated board took advantage of it, so that's why it kind-of regressed. > > Feel free to choose the solution you prefer. Since no user has appeared since 2008, it feels safe enough to assume that none will appear going forward. I lean towards your "3/ get ride of MAX_FD != 2 and clean the codebase..." Explain in a comment that we emulate only a 2-drive floppy controller, not the genuine IBM PC 4-drive floppy controller. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-08 5:38 ` Markus Armbruster @ 2019-04-08 5:38 ` Markus Armbruster 2019-04-08 19:30 ` John Snow 1 sibling, 0 replies; 14+ messages in thread From: Markus Armbruster @ 2019-04-08 5:38 UTC (permalink / raw) To: Hervé Poussineau Cc: Kevin Wolf, Thomas Huth, Juan Quintela, John Snow, Mark Cave-Ayland, Dr. David Alan Gilbert, QEMU Developers, Philippe Mathieu-Daudé Hervé Poussineau <hpoussin@reactos.org> writes: > Le 05/04/2019 à 12:29, Philippe Mathieu-Daudé a écrit : >> 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. >> >> 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... >> >> Another option I don't like is: >> >> 3/ get ride of MAX_FD != 2 and clean the codebase... >> >> $ 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? > > That was only an attempt to support 4 drives in code, as controller was able to do it. > However, no emulated board took advantage of it, so that's why it kind-of regressed. > > Feel free to choose the solution you prefer. Since no user has appeared since 2008, it feels safe enough to assume that none will appear going forward. I lean towards your "3/ get ride of MAX_FD != 2 and clean the codebase..." Explain in a comment that we emulate only a 2-drive floppy controller, not the genuine IBM PC 4-drive floppy controller. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-08 5:38 ` Markus Armbruster 2019-04-08 5:38 ` Markus Armbruster @ 2019-04-08 19:30 ` John Snow 2019-04-08 19:30 ` John Snow 2019-04-09 11:38 ` Philippe Mathieu-Daudé 1 sibling, 2 replies; 14+ messages in thread From: John Snow @ 2019-04-08 19:30 UTC (permalink / raw) To: Markus Armbruster, Hervé Poussineau Cc: Philippe Mathieu-Daudé, Juan Quintela, Dr. David Alan Gilbert, Thomas Huth, Mark Cave-Ayland, Kevin Wolf, QEMU Developers On 4/8/19 1:38 AM, Markus Armbruster wrote: > Hervé Poussineau <hpoussin@reactos.org> writes: > >> Le 05/04/2019 à 12:29, Philippe Mathieu-Daudé a écrit : >>> 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. >>> >>> 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... >>> >>> Another option I don't like is: >>> >>> 3/ get ride of MAX_FD != 2 and clean the codebase... >>> >>> $ 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? >> >> That was only an attempt to support 4 drives in code, as controller was able to do it. >> However, no emulated board took advantage of it, so that's why it kind-of regressed. >> >> Feel free to choose the solution you prefer. > > Since no user has appeared since 2008, it feels safe enough to assume > that none will appear going forward. I lean towards your "3/ get ride > of MAX_FD != 2 and clean the codebase..." Explain in a comment that we > emulate only a 2-drive floppy controller, not the genuine IBM PC 4-drive > floppy controller. > I think I'd rather have MAX_FD set to 2 and a cleaner codebase than a half-working implementation for 4. Or, does it actually work with four? I think if Hervé wants to preserve this feature it should be formalized as a device property and made to work with migration ... or I am content to remove it. --js ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-08 19:30 ` John Snow @ 2019-04-08 19:30 ` John Snow 2019-04-09 11:38 ` Philippe Mathieu-Daudé 1 sibling, 0 replies; 14+ messages in thread From: John Snow @ 2019-04-08 19:30 UTC (permalink / raw) To: Markus Armbruster, Hervé Poussineau Cc: Kevin Wolf, Thomas Huth, Juan Quintela, Mark Cave-Ayland, Dr. David Alan Gilbert, QEMU Developers, Philippe Mathieu-Daudé On 4/8/19 1:38 AM, Markus Armbruster wrote: > Hervé Poussineau <hpoussin@reactos.org> writes: > >> Le 05/04/2019 à 12:29, Philippe Mathieu-Daudé a écrit : >>> 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. >>> >>> 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... >>> >>> Another option I don't like is: >>> >>> 3/ get ride of MAX_FD != 2 and clean the codebase... >>> >>> $ 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? >> >> That was only an attempt to support 4 drives in code, as controller was able to do it. >> However, no emulated board took advantage of it, so that's why it kind-of regressed. >> >> Feel free to choose the solution you prefer. > > Since no user has appeared since 2008, it feels safe enough to assume > that none will appear going forward. I lean towards your "3/ get ride > of MAX_FD != 2 and clean the codebase..." Explain in a comment that we > emulate only a 2-drive floppy controller, not the genuine IBM PC 4-drive > floppy controller. > I think I'd rather have MAX_FD set to 2 and a cleaner codebase than a half-working implementation for 4. Or, does it actually work with four? I think if Hervé wants to preserve this feature it should be formalized as a device property and made to work with migration ... or I am content to remove it. --js ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-08 19:30 ` John Snow 2019-04-08 19:30 ` John Snow @ 2019-04-09 11:38 ` Philippe Mathieu-Daudé 2019-04-09 11:38 ` Philippe Mathieu-Daudé 2019-04-09 17:38 ` John Snow 1 sibling, 2 replies; 14+ messages in thread From: Philippe Mathieu-Daudé @ 2019-04-09 11:38 UTC (permalink / raw) To: John Snow, Markus Armbruster, Hervé Poussineau Cc: Juan Quintela, Dr. David Alan Gilbert, Thomas Huth, Mark Cave-Ayland, Kevin Wolf, QEMU Developers On 4/8/19 9:30 PM, John Snow wrote: > On 4/8/19 1:38 AM, Markus Armbruster wrote: >> Hervé Poussineau <hpoussin@reactos.org> writes: >> >>> Le 05/04/2019 à 12:29, Philippe Mathieu-Daudé a écrit : >>>> Hi, >>>> >>>> I am trying to understand the possible values for the MAX_FD variable >>>> used by the floppy controller model (hw/block/fdc.c). > Out of curiosity, why? Cleaning Super I/O chipset I figured some code uses arrays of 2 elements while other use MAX_FD. If we want to have a build-configurable MAX_FD we can't simply replace "2" -> "MAX_FD" to clean the codebase, we need to correct various places, and fix migration. If we agree that MAX_FD is strictly 2, then we can clean the codebase and remove the MAX_FD != 2 cases (point 3/ below). >>>> 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. >>>> >>>> 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... >>>> >>>> Another option I don't like is: >>>> >>>> 3/ get ride of MAX_FD != 2 and clean the codebase... >>>> >>>> $ 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? >>> >>> That was only an attempt to support 4 drives in code, as controller was able to do it. >>> However, no emulated board took advantage of it, so that's why it kind-of regressed. >>> >>> Feel free to choose the solution you prefer. >> >> Since no user has appeared since 2008, it feels safe enough to assume >> that none will appear going forward. I lean towards your "3/ get ride >> of MAX_FD != 2 and clean the codebase..." Explain in a comment that we >> emulate only a 2-drive floppy controller, not the genuine IBM PC 4-drive >> floppy controller. >> > > I think I'd rather have MAX_FD set to 2 and a cleaner codebase than a > half-working implementation for 4. > > Or, does it actually work with four? I think if Hervé wants to preserve > this feature it should be formalized as a device property and made to > work with migration ... or I am content to remove it. I understand Hervé doesn't want to preserve his attempt ("no emulated board took advantage of it"), and the work is safe in the git history if someone want to restore it (in a way that doesn't break migration). Since we all seems to agree, I prepared a series to remove it and will send it soon (although there is no rush). Thanks, Phil. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-09 11:38 ` Philippe Mathieu-Daudé @ 2019-04-09 11:38 ` Philippe Mathieu-Daudé 2019-04-09 17:38 ` John Snow 1 sibling, 0 replies; 14+ messages in thread From: Philippe Mathieu-Daudé @ 2019-04-09 11:38 UTC (permalink / raw) To: John Snow, Markus Armbruster, Hervé Poussineau Cc: Kevin Wolf, Thomas Huth, Juan Quintela, Mark Cave-Ayland, QEMU Developers, Dr. David Alan Gilbert On 4/8/19 9:30 PM, John Snow wrote: > On 4/8/19 1:38 AM, Markus Armbruster wrote: >> Hervé Poussineau <hpoussin@reactos.org> writes: >> >>> Le 05/04/2019 à 12:29, Philippe Mathieu-Daudé a écrit : >>>> Hi, >>>> >>>> I am trying to understand the possible values for the MAX_FD variable >>>> used by the floppy controller model (hw/block/fdc.c). > Out of curiosity, why? Cleaning Super I/O chipset I figured some code uses arrays of 2 elements while other use MAX_FD. If we want to have a build-configurable MAX_FD we can't simply replace "2" -> "MAX_FD" to clean the codebase, we need to correct various places, and fix migration. If we agree that MAX_FD is strictly 2, then we can clean the codebase and remove the MAX_FD != 2 cases (point 3/ below). >>>> 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. >>>> >>>> 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... >>>> >>>> Another option I don't like is: >>>> >>>> 3/ get ride of MAX_FD != 2 and clean the codebase... >>>> >>>> $ 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? >>> >>> That was only an attempt to support 4 drives in code, as controller was able to do it. >>> However, no emulated board took advantage of it, so that's why it kind-of regressed. >>> >>> Feel free to choose the solution you prefer. >> >> Since no user has appeared since 2008, it feels safe enough to assume >> that none will appear going forward. I lean towards your "3/ get ride >> of MAX_FD != 2 and clean the codebase..." Explain in a comment that we >> emulate only a 2-drive floppy controller, not the genuine IBM PC 4-drive >> floppy controller. >> > > I think I'd rather have MAX_FD set to 2 and a cleaner codebase than a > half-working implementation for 4. > > Or, does it actually work with four? I think if Hervé wants to preserve > this feature it should be formalized as a device property and made to > work with migration ... or I am content to remove it. I understand Hervé doesn't want to preserve his attempt ("no emulated board took advantage of it"), and the work is safe in the git history if someone want to restore it (in a way that doesn't break migration). Since we all seems to agree, I prepared a series to remove it and will send it soon (although there is no rush). Thanks, Phil. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-09 11:38 ` Philippe Mathieu-Daudé 2019-04-09 11:38 ` Philippe Mathieu-Daudé @ 2019-04-09 17:38 ` John Snow 2019-04-09 17:38 ` John Snow 1 sibling, 1 reply; 14+ messages in thread From: John Snow @ 2019-04-09 17:38 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Markus Armbruster, Hervé Poussineau Cc: Juan Quintela, Dr. David Alan Gilbert, Thomas Huth, Mark Cave-Ayland, Kevin Wolf, QEMU Developers On 4/9/19 7:38 AM, Philippe Mathieu-Daudé wrote: > On 4/8/19 9:30 PM, John Snow wrote: >> On 4/8/19 1:38 AM, Markus Armbruster wrote: >>> Hervé Poussineau <hpoussin@reactos.org> writes: >>> >>>> Le 05/04/2019 à 12:29, Philippe Mathieu-Daudé a écrit : >>>>> Hi, >>>>> >>>>> I am trying to understand the possible values for the MAX_FD variable >>>>> used by the floppy controller model (hw/block/fdc.c). > >> Out of curiosity, why? > > Cleaning Super I/O chipset I figured some code uses arrays of 2 elements > while other use MAX_FD. If we want to have a build-configurable MAX_FD > we can't simply replace "2" -> "MAX_FD" to clean the codebase, we need > to correct various places, and fix migration. > If we agree that MAX_FD is strictly 2, then we can clean the codebase > and remove the MAX_FD != 2 cases (point 3/ below). OK! I just get nervous when people start poking around floppy disks :) It's "maintained" but really I just keep it on life support. If anyone were to claim responsibility for it I would happily let them. As you can guess, floppy disks are not a huge business priority for my employer and I am not personally passionate about them, so... I just keep it alive out of kindness and, for a time, support for loading virtio drivers on Windows XP VMs, which is a use case that Red Hat doesn't care about too much anymore. >> >> I think I'd rather have MAX_FD set to 2 and a cleaner codebase than a >> half-working implementation for 4. >> >> Or, does it actually work with four? I think if Hervé wants to preserve >> this feature it should be formalized as a device property and made to >> work with migration ... or I am content to remove it. > > I understand Hervé doesn't want to preserve his attempt ("no emulated > board took advantage of it"), and the work is safe in the git history if > someone want to restore it (in a way that doesn't break migration). > > Since we all seems to agree, I prepared a series to remove it and will > send it soon (although there is no rush). > > Thanks, > > Phil. > Sounds good, thank you! ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] How to correctly use more than 2 floppy drives? 2019-04-09 17:38 ` John Snow @ 2019-04-09 17:38 ` John Snow 0 siblings, 0 replies; 14+ messages in thread From: John Snow @ 2019-04-09 17:38 UTC (permalink / raw) To: Philippe Mathieu-Daudé, Markus Armbruster, Hervé Poussineau Cc: Kevin Wolf, Thomas Huth, Juan Quintela, Mark Cave-Ayland, QEMU Developers, Dr. David Alan Gilbert On 4/9/19 7:38 AM, Philippe Mathieu-Daudé wrote: > On 4/8/19 9:30 PM, John Snow wrote: >> On 4/8/19 1:38 AM, Markus Armbruster wrote: >>> Hervé Poussineau <hpoussin@reactos.org> writes: >>> >>>> Le 05/04/2019 à 12:29, Philippe Mathieu-Daudé a écrit : >>>>> Hi, >>>>> >>>>> I am trying to understand the possible values for the MAX_FD variable >>>>> used by the floppy controller model (hw/block/fdc.c). > >> Out of curiosity, why? > > Cleaning Super I/O chipset I figured some code uses arrays of 2 elements > while other use MAX_FD. If we want to have a build-configurable MAX_FD > we can't simply replace "2" -> "MAX_FD" to clean the codebase, we need > to correct various places, and fix migration. > If we agree that MAX_FD is strictly 2, then we can clean the codebase > and remove the MAX_FD != 2 cases (point 3/ below). OK! I just get nervous when people start poking around floppy disks :) It's "maintained" but really I just keep it on life support. If anyone were to claim responsibility for it I would happily let them. As you can guess, floppy disks are not a huge business priority for my employer and I am not personally passionate about them, so... I just keep it alive out of kindness and, for a time, support for loading virtio drivers on Windows XP VMs, which is a use case that Red Hat doesn't care about too much anymore. >> >> I think I'd rather have MAX_FD set to 2 and a cleaner codebase than a >> half-working implementation for 4. >> >> Or, does it actually work with four? I think if Hervé wants to preserve >> this feature it should be formalized as a device property and made to >> work with migration ... or I am content to remove it. > > I understand Hervé doesn't want to preserve his attempt ("no emulated > board took advantage of it"), and the work is safe in the git history if > someone want to restore it (in a way that doesn't break migration). > > Since we all seems to agree, I prepared a series to remove it and will > send it soon (although there is no rush). > > Thanks, > > Phil. > Sounds good, thank you! ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-04-09 17:40 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-04-05 10:29 [Qemu-devel] How to correctly use more than 2 floppy drives? Philippe Mathieu-Daudé 2019-04-05 10:29 ` Philippe Mathieu-Daudé 2019-04-05 10:53 ` Dr. David Alan Gilbert 2019-04-05 10:53 ` Dr. David Alan Gilbert 2019-04-05 16:35 ` Hervé Poussineau 2019-04-05 16:35 ` Hervé Poussineau 2019-04-08 5:38 ` Markus Armbruster 2019-04-08 5:38 ` Markus Armbruster 2019-04-08 19:30 ` John Snow 2019-04-08 19:30 ` John Snow 2019-04-09 11:38 ` Philippe Mathieu-Daudé 2019-04-09 11:38 ` Philippe Mathieu-Daudé 2019-04-09 17:38 ` John Snow 2019-04-09 17:38 ` John Snow
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).