提交 e14c8062 编写于 作者: B Blue Swirl

pc: fix wrong CMOS values for floppy drives

Before commit 63ffb564, states for
floppy drives were calculated in fdc.c:fd_revalidate(). There it is
also considered whether a disk is inserted or not. The commit didn't copy
the logic completely to pc.c, which caused a regression.

Fix by adding the same check also to pc.c.
Reported-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Tested-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 c4374bb7
...@@ -382,7 +382,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size, ...@@ -382,7 +382,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
/* floppy type */ /* floppy type */
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
fd[i] = drive_get(IF_FLOPPY, 0, i); fd[i] = drive_get(IF_FLOPPY, 0, i);
if (fd[i]) { if (fd[i] && bdrv_is_inserted(fd[i]->bdrv)) {
bdrv_get_floppy_geometry_hint(fd[i]->bdrv, &nb_heads, &max_track, bdrv_get_floppy_geometry_hint(fd[i]->bdrv, &nb_heads, &max_track,
&last_sect, FDRIVE_DRV_NONE, &last_sect, FDRIVE_DRV_NONE,
&fd_type[i]); &fd_type[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册