aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2021-05-19 11:08:02 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-06-15 17:17:09 +0200
commit35579b523cf8f441da12f968ce5dcf6ae0bfbfea (patch)
treef5c9201cd863373da7fc85ee6bfd767a44678c3d
parente62a959afd2b1a13b27dda9d03f10c7feb36aa9b (diff)
esp: revert 75ef849696 "esp: correctly fill bus id with requested lun"
This commit from nearly 10 years ago is now broken due to the improvements in esp emulation (or perhaps was never correct). It shows up as a bug in detecting the CDROM drive under MacOS. The error is caused by the MacOS CDROM driver sending this CDB with an "S without ATN" command and without DMA: 0x12 0x00 0x00 0x00 0x05 0x00 (INQUIRY) This is a valid INQUIRY command, however with this logic present the 3rd byte (0x0) is copied over the 1st byte (0x12) which silently converts the INQUIRY command to a TEST UNIT READY command before passing it to the QEMU SCSI layer. Since the TEST UNIT READY command has a zero length response the MacOS CDROM driver never receives a response and assumes the CDROM is not present. The logic was to ignore the IDENTIFY byte and copy the LUN over from the CDB, which did store the LUN in bits 5-7 of the second byte in olden times. This however is all obsolete, so just drop the code. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20210519100803.10293-5-mark.cave-ayland@ilande.co.uk> [Tweaked commit message. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--hw/scsi/esp.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 8e314ef156..16e4b7ead6 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -260,9 +260,6 @@ static uint32_t get_cmd(ESPState *s, uint32_t maxlen)
return 0;
}
n = esp_fifo_pop_buf(&s->fifo, buf, dmalen);
- if (n >= 3) {
- buf[0] = buf[2] >> 5;
- }
n = MIN(fifo8_num_free(&s->cmdfifo), n);
fifo8_push_all(&s->cmdfifo, buf, n);
}