atapi: reset cdrom tray statuses on ide_reset
authorPavel Hrdina <phrdina@redhat.com>
Tue, 11 Dec 2012 07:55:48 +0000 (08:55 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 13 Dec 2012 10:17:35 +0000 (11:17 +0100)
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>
hw/ide/core.c

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