fdc: fix media detection
commitcfb08fbafcd946341bdf14103293887763802697
authorPavel Hrdina <phrdina@redhat.com>
Thu, 24 May 2012 09:02:29 +0000 (24 11:02 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 25 May 2012 16:21:12 +0000 (25 18:21 +0200)
tree48ce6033ae4c8de786dfbebfc779372dfa33d383
parent9ecd394753919b7395e620dffb8a5e23c45b5e07
fdc: fix media detection

We have to set up 'media_changed' after guest start so floppy driver
could detect that there is no media in drive. For this purpose we call
'fdctrl_change_cb' instead of 'fd_revalidate' in 'fdctrl_connect_drives'.
'fd_revalidate' is called inside 'fdctrl_change_cb'.

We still have to set default drive geometry in 'fd_revalidate' even
if there is no media in drive. When you try to open (windows) or mount (linux)
floppy the driver tries to seek on track 1. Linux guest stuck in loop then
kernel crashes and windows guest prints error message.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/fdc.c