[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/13] fdc: add disk field
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 05/13] fdc: add disk field |
Date: |
Mon, 25 Jan 2016 14:41:17 -0500 |
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
---
hw/block/fdc.c | 3 +++
1 file changed, 3 insertions(+)
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;
}
--
2.4.3
- [Qemu-devel] [PULL 03/13] fdc: reduce number of pick_geometry arguments, (continued)
- [Qemu-devel] [PULL 03/13] fdc: reduce number of pick_geometry arguments, John Snow, 2016/01/25
- [Qemu-devel] [PULL 12/13] qtest/fdc: Support for 2.88MB drives, John Snow, 2016/01/25
- [Qemu-devel] [PULL 01/13] ide: Correct the CHS 'cyls_max' limit to be 65535, John Snow, 2016/01/25
- [Qemu-devel] [PULL 13/13] fdc: change auto fallback drive for ISA FDC to 288, John Snow, 2016/01/25
- [Qemu-devel] [PULL 06/13] fdc: Throw an assertion on misconfigured fd_formats table, John Snow, 2016/01/25
- [Qemu-devel] [PULL 07/13] fdc: add pick_drive, John Snow, 2016/01/25
- [Qemu-devel] [PULL 10/13] fdc: add physical disk sizes, John Snow, 2016/01/25
- [Qemu-devel] [PULL 11/13] fdc: rework pick_geometry, John Snow, 2016/01/25
- [Qemu-devel] [PULL 08/13] fdc: Add fallback option, John Snow, 2016/01/25
- [Qemu-devel] [PULL 05/13] fdc: add disk field,
John Snow <=
- [Qemu-devel] [PULL 09/13] fdc: add drive type option, John Snow, 2016/01/25
- [Qemu-devel] [PULL 04/13] fdc: add drive type qapi enum, John Snow, 2016/01/25
- Re: [Qemu-devel] [PULL 00/13] IDE & FDC patches, Peter Maydell, 2016/01/26