Revision 33ebad12

b/hw/scsi-disk.c
1703 1703
    case WRITE_VERIFY_10:
1704 1704
    case WRITE_VERIFY_12:
1705 1705
    case WRITE_VERIFY_16:
1706
        return scsi_req_alloc(&scsi_disk_reqops, &s->qdev, tag, lun,
1707
                              hba_private);
1706
        /* MMC writing cannot be done via pread/pwrite, because it sometimes
1707
         * involves writing beyond the maximum LBA or to negative LBA (lead-in).
1708
         * And once you do these writes, reading from the block device is
1709
         * unreliable, too.  It is even possible that reads deliver random data
1710
         * from the host page cache (this is probably a Linux bug).
1711
         *
1712
         * We might use scsi_disk_reqops as long as no writing commands are
1713
         * seen, but performance usually isn't paramount on optical media.  So,
1714
         * just make scsi-block operate the same as scsi-generic for them.
1715
         */
1716
        if (s->qdev.type != TYPE_ROM) {
1717
            return scsi_req_alloc(&scsi_disk_reqops, &s->qdev, tag, lun,
1718
                                  hba_private);
1719
        }
1708 1720
    }
1709 1721

  
1710 1722
    return scsi_req_alloc(&scsi_generic_req_ops, &s->qdev, tag, lun,

Also available in: Unified diff