qemu-patch-raspberry4/hw/ide
Markus Armbruster a1aff5bf67 block: Revert entanglement of bdrv_is_inserted() with tray status
Commit 4be9762a changed bdrv_is_inserted() to fail when the tray is
open.  Unfortunately, there are two different kinds of users, with
conflicting needs.

1. Device models using bdrv_eject(), currently ide-cd and scsi-cd.
They expect bdrv_is_inserted() to reflect the tray status.  Commit
4be9762a makes them happy.

2. Code that wants to know whether a BlockDriverState has media, such
as find_image_format(), bdrv_flush_all().  Commit 4be9762a makes them
unhappy.  In particular, it breaks flush on VM stop for media ejected
by the guest.

Revert the change to bdrv_is_inserted().  Check the tray status in the
device models instead.

Note on IDE: Since only ATAPI devices have a tray, and they don't
accept ATA commands since the recent commit "ide: Reject ATA commands
specific to drive kinds", checking in atapi.c suffices.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-12 15:17:20 +02:00
..
ahci.c block: explicit I/O accounting 2011-08-25 18:18:42 +02:00
ahci.h Use new macro QEMU_PACKED for packed structures 2011-09-03 10:45:59 +00:00
atapi.c block: Revert entanglement of bdrv_is_inserted() with tray status 2011-09-12 15:17:20 +02:00
cmd646.c pci: rename pci_register_bar_region() to pci_register_bar() 2011-08-08 10:22:30 -05:00
core.c ide: Reject ATA commands specific to drive kinds 2011-09-12 15:17:19 +02:00
ich.c pci: rename pci_register_bar_region() to pci_register_bar() 2011-08-08 10:22:30 -05:00
internal.h ide/atapi: Track tray open/close state 2011-09-12 15:17:20 +02:00
isa.c Remove unused sysemu.h include directives 2011-04-15 18:25:41 +00:00
macio.c block: explicit I/O accounting 2011-08-25 18:18:42 +02:00
microdrive.c Use glib memory allocation and free functions 2011-08-20 23:01:08 -05:00
mmio.c Use glib memory allocation and free functions 2011-08-20 23:01:08 -05:00
pci.c ide: convert to memory API 2011-08-08 10:15:54 -05:00
pci.h ide: convert to memory API 2011-08-08 10:15:54 -05:00
piix.c xen: Clean up pci_piix3_xen_ide_unplug()'s test for "not a CD" 2011-09-06 11:24:07 +02:00
qdev.c Use glib memory allocation and free functions 2011-08-20 23:01:08 -05:00
via.c pci: rename pci_register_bar_region() to pci_register_bar() 2011-08-08 10:22:30 -05:00