]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
scsi-disk: allow the MODE_PAGE_R_W_ERROR AWRE bit to be changeable for CDROM drives
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Wed, 22 Jun 2022 10:53:11 +0000 (11:53 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 Jul 2022 14:58:58 +0000 (16:58 +0200)
A/UX sends a MODE_PAGE_R_W_ERROR command with the AWRE bit set to 0 when enumerating
CDROM drives. Since the bit is currently hardcoded to 1 then indicate that the AWRE
bit can be changed (even though we don't care about the value) so that
the MODE_PAGE_R_W_ERROR page can be set successfully.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20220622105314.802852-12-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/scsi-disk.c

index 2b2e496ebdd62b82ee1d606464162a5f4e7ffd0c..db27e834dae33f0c7477d581d6a1a30d96cdc987 100644 (file)
@@ -1188,6 +1188,10 @@ static int mode_sense_page(SCSIDiskState *s, int page, uint8_t **p_outbuf,
     case MODE_PAGE_R_W_ERROR:
         length = 10;
         if (page_control == 1) { /* Changeable Values */
+            if (s->qdev.type == TYPE_ROM) {
+                /* Automatic Write Reallocation Enabled */
+                p[0] = 0x80;
+            }
             break;
         }
         p[0] = 0x80; /* Automatic Write Reallocation Enabled */