summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2016-01-22 15:50:57 -0500
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:29:54 -0600
commit2a42a37abfb8365d91c89405905262660f971094 (patch)
tree11c3fa07bf6242e96fb78c9a8dcba7e983925905 /hw
parent7682c3d86931956570b1d3e197fe7a081ef5e5cd (diff)
downloadhqemu-2a42a37abfb8365d91c89405905262660f971094.zip
hqemu-2a42a37abfb8365d91c89405905262660f971094.tar.gz
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 <eblake@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1453495865-9649-5-git-send-email-jsnow@redhat.com
Diffstat (limited to 'hw')
-rw-r--r--hw/block/fdc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index e37934d..18e363b 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -141,6 +141,7 @@ typedef struct FDrive {
uint8_t track;
uint8_t sect;
/* Media */
+ FloppyDriveType disk; /* Current disk type */
FDiskFlags flags;
uint8_t last_sect; /* Nb sector per track */
uint8_t max_track; /* Nb of tracks */
@@ -158,6 +159,7 @@ static void fd_init(FDrive *drv)
drv->drive = FLOPPY_DRIVE_TYPE_NONE;
drv->perpendicular = 0;
/* Disk */
+ drv->disk = FLOPPY_DRIVE_TYPE_NONE;
drv->last_sect = 0;
drv->max_track = 0;
}
@@ -287,6 +289,7 @@ static void pick_geometry(FDrive *drv)
drv->max_track = parse->max_track;
drv->last_sect = parse->last_sect;
drv->drive = parse->drive;
+ drv->disk = drv->media_inserted ? parse->drive : FLOPPY_DRIVE_TYPE_NONE;
drv->media_rate = parse->rate;
}
OpenPOWER on IntegriCloud