This is my QEMU Google Summer of Code project. Here I introduce new device - ATAPI-SCSI bridge. Its purpose is to unify IDE ATAPI CD-ROM emulation with SCSI CD-ROM emulation to reduce code duplication and squash bugs. It's purpose is simple - it just forwards ATAPI commands to SCSI side for parsing and execution.
Example of using: qemu-system-x86_64 \ -drive if=none,file=<filename>,id=cdrom \ -drive if=none,id=fake \ -device ide-bridge,id=bridge,drive=fake \ -device scsi-cd,drive=cdrom,bus=bridge.0 \ -hda diskimage \ -m 1024 Acked-by: Hannes Reinecke <h...@suse.de> Changelog: v2: reduced amount of patches, some patches merged with each other v3: order of patches changes for successful compilation after every patch v4: SCSIRequest * in IDEState renamed to scsi_req v5: checks for treating bridge as CDROM added to ACHI code Alexander Bezzubikov (5): ide: ATAPI-SCSI bridge TypeInfo and init function created scsi: SCSIDiskReq declaration moved to header ide: necessary checks corrected to treat ATAPI-SCSI bridge as CDROM ATAPI-SCSI bridge functions created an can be used by bridge ide: ATAPI-SCSI bridge transfer is treated as PIO hw/ide/Makefile.objs | 2 +- hw/ide/ahci.c | 6 ++- hw/ide/atapi.c | 20 ++++++++- hw/ide/bridge.c | 114 +++++++++++++++++++++++++++++++++++++++++++++++++ hw/ide/bridge.h | 10 +++++ hw/ide/core.c | 28 +++++++----- hw/ide/internal.h | 6 ++- hw/ide/qdev.c | 43 ++++++++++++++++++- hw/scsi/scsi-disk.c | 55 ++++++++++++++++++------ include/hw/scsi/scsi.h | 16 +++++++ 10 files changed, 271 insertions(+), 29 deletions(-) create mode 100644 hw/ide/bridge.c create mode 100644 hw/ide/bridge.h -- 2.1.4