Comments

Update scsi-generic to allow passthrough of SG_IO scsi commands
to iscsi devices too in addition to the real scsi-generic devices.
Implement both bdrv_ioctl() and bdrv_aio_ioctl() in the iscsi backend,
emulate the SG_IO ioctl and pass the SCSI commands across to the
iscsi target.
This allows end-to-end passthrough of SCSI all the way from the guest,
to qemu, via scsi-generic, then libiscsi all the way to the iscsi target.
To activate this you need to specify interface type as scsi when
creating the device.
Example:
-drive file=iscsi://10.1.1.125/iqn.ronnie.test/1,if=scsi,bus=0,unit=5
Note, you can currently not boot a qemu guest from a 'if=scsi' device.
Note,
This only works when the host is linux, since the emulation relies on
definitions of SG_IO from the scsi-generic implementation in the
linux kernel.
It should be fairly easy to re-implement some structures similar enough
for non-linux hosts to do the same style of passthrough via a fake
scsi generic layer and libiscsi if need be.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
---
block.c | 18 ++++--
block.h | 1 +
block/iscsi.c | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
block_int.h | 1 +
hw/scsi-bus.c | 7 ++-
hw/scsi-disk.c | 4 +
hw/scsi-generic.c | 4 +-
7 files changed, 216 insertions(+), 10 deletions(-)