[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-2.2 0/5] scsi: enable passthrough of vendor-spec
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH for-2.2 0/5] scsi: enable passthrough of vendor-specific commands |
Date: |
Wed, 16 Jul 2014 14:54:45 +0200 |
Right now scsi-generic is parsing the CDB, in order to compute
the expected number of bytes to be transferred. This is necessary
if DMA is done by the HBA via scsi_req_data, but it prevents executing
vendor-specific commands via scsi-generic because we don't know how
to parse them.
If DMA is delegated to the SCSI layer via get_sg_list, we know in
advance how many bytes the guest will want to receive and we can pass
the information straight from the guest to SG_IO. In this case, it is
unnecessary to parse the CDB to get the same information. scsi-disk needs
it to detect underruns and overruns, but scsi-generic and scsi-block can
just ask the HBA about the transfer direction and size.
This series introduces a new parse_cdb callback in both the device and
the HBA. The latter is called by scsi_bus_parse_cdb, which devices can
call for passthrough requests in their implementation of parse_cdb.
Tamuki-san, can you please test if these patches are okay for your
usecase?
Paolo
Paolo Bonzini (5):
scsi-bus: prepare scsi_req_new for introduction of parse_cdb
scsi-bus: introduce parse_cdb in SCSIDeviceClass and SCSIBusInfo
scsi-block: extract scsi_block_is_passthrough
scsi-block, scsi-generic: implement parse_cdb
virtio-scsi: implement parse_cdb
hw/scsi/scsi-bus.c | 68 ++++++++++++++++++++++++++++++++++----------------
hw/scsi/scsi-disk.c | 52 +++++++++++++++++++++++++++++---------
hw/scsi/scsi-generic.c | 7 ++++++
hw/scsi/virtio-scsi.c | 24 ++++++++++++++++++
include/hw/scsi/scsi.h | 7 ++++++
5 files changed, 124 insertions(+), 34 deletions(-)
--
1.9.3
- [Qemu-devel] [PATCH for-2.2 0/5] scsi: enable passthrough of vendor-specific commands,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 3/5] scsi-block: extract scsi_block_is_passthrough, Paolo Bonzini, 2014/07/16
- [Qemu-devel] [PATCH 2/5] scsi-bus: introduce parse_cdb in SCSIDeviceClass and SCSIBusInfo, Paolo Bonzini, 2014/07/16
- [Qemu-devel] [PATCH 1/5] scsi-bus: prepare scsi_req_new for introduction of parse_cdb, Paolo Bonzini, 2014/07/16
- [Qemu-devel] [PATCH 4/5] scsi-block, scsi-generic: implement parse_cdb, Paolo Bonzini, 2014/07/16
- [Qemu-devel] [PATCH 5/5] virtio-scsi: implement parse_cdb, Paolo Bonzini, 2014/07/16
- Re: [Qemu-devel] [PATCH for-2.2 0/5] scsi: enable passthrough of vendor-specific commands, TAMUKI Shoichi, 2014/07/18