[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 01/11] scsi-disk: add FORMAT UNIT command
From: |
Mark Cave-Ayland |
Subject: |
[PATCH v2 01/11] scsi-disk: add FORMAT UNIT command |
Date: |
Sun, 24 Apr 2022 17:49:25 +0100 |
When initialising a drive ready to install MacOS, Apple HD SC Setup first
attempts
to format the drive. Add a simple FORMAT UNIT command which simply returns
success
to allow the format to succeed.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/scsi/scsi-disk.c | 4 ++++
hw/scsi/trace-events | 1 +
2 files changed, 5 insertions(+)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 072686ed58..090679f3b5 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2127,6 +2127,9 @@ static int32_t scsi_disk_emulate_command(SCSIRequest
*req, uint8_t *buf)
trace_scsi_disk_emulate_command_WRITE_SAME(
req->cmd.buf[0] == WRITE_SAME_10 ? 10 : 16, r->req.cmd.xfer);
break;
+ case FORMAT_UNIT:
+ trace_scsi_disk_emulate_command_FORMAT_UNIT(r->req.cmd.xfer);
+ break;
default:
trace_scsi_disk_emulate_command_UNKNOWN(buf[0],
scsi_command_name(buf[0]));
@@ -2533,6 +2536,7 @@ static const SCSIReqOps *const
scsi_disk_reqops_dispatch[256] = {
[VERIFY_10] = &scsi_disk_emulate_reqops,
[VERIFY_12] = &scsi_disk_emulate_reqops,
[VERIFY_16] = &scsi_disk_emulate_reqops,
+ [FORMAT_UNIT] = &scsi_disk_emulate_reqops,
[READ_6] = &scsi_disk_dma_reqops,
[READ_10] = &scsi_disk_dma_reqops,
diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events
index 20fb0dc162..e91b55a961 100644
--- a/hw/scsi/trace-events
+++ b/hw/scsi/trace-events
@@ -334,6 +334,7 @@ scsi_disk_emulate_command_UNMAP(size_t xfer) "Unmap (len
%zd)"
scsi_disk_emulate_command_VERIFY(int bytchk) "Verify (bytchk %d)"
scsi_disk_emulate_command_WRITE_SAME(int cmd, size_t xfer) "WRITE SAME %d (len
%zd)"
scsi_disk_emulate_command_UNKNOWN(int cmd, const char *name) "Unknown SCSI
command (0x%2.2x=%s)"
+scsi_disk_emulate_command_FORMAT_UNIT(size_t xfer) "Format Unit (len %zd)"
scsi_disk_dma_command_READ(uint64_t lba, uint32_t len) "Read (sector %" PRId64
", count %u)"
scsi_disk_dma_command_WRITE(const char *cmd, uint64_t lba, int len) "Write
%s(sector %" PRId64 ", count %u)"
scsi_disk_new_request(uint32_t lun, uint32_t tag, const char *line) "Command:
lun=%d tag=0x%x data=%s"
--
2.20.1
- [PATCH v2 00/11] scsi: add quirks and features to support m68k Macs, Mark Cave-Ayland, 2022/04/24
- [PATCH v2 01/11] scsi-disk: add FORMAT UNIT command,
Mark Cave-Ayland <=
- [PATCH v2 02/11] scsi-disk: add new quirks bitmap to SCSIDiskState, Mark Cave-Ayland, 2022/04/24
- [PATCH v2 03/11] scsi-disk: add MODE_PAGE_APPLE_VENDOR quirk for Macintosh, Mark Cave-Ayland, 2022/04/24
- [PATCH v2 07/11] scsi-disk: allow truncated MODE SELECT requests, Mark Cave-Ayland, 2022/04/24
- [PATCH v2 06/11] q800: implement compat_props to enable quirk_mode_sense_rom_force_dbd for scsi-cd devices, Mark Cave-Ayland, 2022/04/24
- [PATCH v2 05/11] scsi-disk: add SCSI_DISK_QUIRK_MODE_SENSE_ROM_FORCE_DBD quirk for Macintosh, Mark Cave-Ayland, 2022/04/24
- [PATCH v2 04/11] q800: implement compat_props to enable quirk_mode_page_apple_vendor for scsi-hd devices, Mark Cave-Ayland, 2022/04/24
- [PATCH v2 08/11] scsi-disk: allow the MODE_PAGE_R_W_ERROR AWRE bit to be changeable for CDROM drives, Mark Cave-Ayland, 2022/04/24
- [PATCH v2 10/11] q800: add default vendor and product information for scsi-hd devices, Mark Cave-Ayland, 2022/04/24
- [PATCH v2 09/11] scsi-disk: allow MODE SELECT block descriptor to set the ROM device block size, Mark Cave-Ayland, 2022/04/24
- [PATCH v2 11/11] q800: add default vendor and product information for scsi-cd devices, Mark Cave-Ayland, 2022/04/24