]> git.proxmox.com Git - mirror_qemu.git/commitdiff
ide: Fix ATA command READ to set ATAPI signature for CD-ROM
authorMarkus Armbruster <armbru@redhat.com>
Tue, 6 Sep 2011 16:58:34 +0000 (18:58 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 12 Sep 2011 13:17:18 +0000 (15:17 +0200)
Must set the ATAPI device signature, see ATA4 8.27.5.2 Outputs for
PACKET Command feature set devices, and ACS-2 7.36.6 Outputs for
PACKET feature set devices.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/ide/core.c

index 1806e008bc66c0b5544ab2237e12224b3410fbcd..def01266d0efb71926f1c21ab8751f01c99116c0 100644 (file)
@@ -983,8 +983,10 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
        lba48 = 1;
     case WIN_READ:
     case WIN_READ_ONCE:
-        if (!s->bs)
+        if (s->drive_kind == IDE_CD) {
+            ide_set_signature(s); /* odd, but ATA4 8.27.5.2 requires it */
             goto abort_cmd;
+        }
        ide_cmd_lba48_transform(s, lba48);
         s->req_nb_sectors = 1;
         ide_sector_read(s);