atapi: reset cdrom tray statuses on ide_reset

Tray statuses should be also reseted. Some guests may lock the tray
and after reset before any kernel is loaded the tray should be unlocked.

Also if you reset the real computer the tray is closed. We should
do the same in qemu.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Pavel Hrdina 2012-12-11 08:55:48 +01:00 committed by Kevin Wolf
parent 91d4093dce
commit a7f3d65b65

View File

@ -1869,6 +1869,8 @@ static void ide_reset(IDEState *s)
s->io_buffer_index = 0; s->io_buffer_index = 0;
s->cd_sector_size = 0; s->cd_sector_size = 0;
s->atapi_dma = 0; s->atapi_dma = 0;
s->tray_locked = 0;
s->tray_open = 0;
/* ATA DMA state */ /* ATA DMA state */
s->io_buffer_size = 0; s->io_buffer_size = 0;
s->req_nb_sectors = 0; s->req_nb_sectors = 0;