aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2011-08-03 15:08:09 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-06 11:24:06 +0200
commit18d90055293adc4937c91fb7b87743b1994d8bc5 (patch)
tree734e4815f0ea900db8f49d1cd770f806b25148db /block.c
parent8e49ca46249481588c881918d5bd023e16209095 (diff)
downloadqemu-18d90055293adc4937c91fb7b87743b1994d8bc5.zip
qemu-18d90055293adc4937c91fb7b87743b1994d8bc5.tar.gz
qemu-18d90055293adc4937c91fb7b87743b1994d8bc5.tar.bz2
fdc: Make media change detection more robust
fdctrl_change_cb() gets called on a virtual media change via monitor. It would be nice if host device block drivers called it on physical media change, but they don't. bdrv_media_changed() lets you poll for media change, but it returns "don't know" except with block driver "host_floppy". FDrive member media_changed gets set on device initialization and by fdctrl_change_cb(), and cleared by fdctrl_media_changed(). Thus, it's set on first entry to fdctrl_media_changed() since device initialization or virtual media change. fdctrl_media_changed() ignores media_changed unless bdrv_media_changed() returns "don't know". If we change media via monitor (setting media_changed), and the new media's block driver returns 0, we lose. Fortunately, "host_floppy" always returns 1 on first call. Brittle. Clean it up not to rely on it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
0 files changed, 0 insertions, 0 deletions