]> git.proxmox.com Git - qemu.git/commit - block/iscsi.c
ISCSI: Add SCSI passthrough via scsi-generic to libiscsi
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 25 May 2012 11:59:01 +0000 (21:59 +1000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Jul 2012 08:18:41 +0000 (10:18 +0200)
commit983924532f61091fd90d1f2fafa4aa938c414dbb
tree6e5b0d42da73b28d6c6ad261768d0fb4cc29e621
parent1a4f0c3a0621e6644f3cfc0121478641337ac9ca
ISCSI: Add SCSI passthrough via scsi-generic to libiscsi

Update iscsi to allow passthrough of SG_IO scsi commands when the iscsi
device is forced to be scsi-generic.

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 that the iscsi lun should be treated
as a scsi-generic device.

Example:
    -device lsi -device scsi-generic,drive=MyISCSI \
    -drive file=iscsi://10.1.1.125/iqn.ronnie.test/1,if=none,id=MyISCSI

Note, you can currently not boot a qemu guest from a 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>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block/iscsi.c
hw/scsi-generic.c