From: Nicholas Bellinger<address@hidden>
This patch adds initial support for using the Linux BSG interface with
write/read vectored
AIO as a QEMU backstore (SCSIDeviceInfo) with hw/scsi-bus.c compatible HBA
emulation.
So far it has been tested with x86_64 host and guest using hw/megasas.c and
TCM_Loop LLD
Port LUNs. Because this patch uses struct iovec for struct
sg_io_v4->d[out,in]_xferp payloads,
which currently requires a patch to linux/block/bsg.c:bsg_map_hdr() in order to
setup the
user -> kernel iovecs. This patch can be found in lio-core-2.6.git here:
commit fec4e8457c744de50e1ead69a36d5c4ee089d1ac
Author: Nicholas Bellinger<address@hidden>
Date: Sun Jun 13 23:13:20 2010 -0700
[BSG]: Add support for struct sg_io_v4->d[out,in]_iovec_count
This also will only currently work with paired user/kernel (eg: 64bit user /
64bit kernel)
because of different pointer sizes in struct iovec->iov_base.
There are also two FIXMEs in hw/scsi-bsg.c:bsg_generic_initfn() related to
extraction of
SCSI LUN and device type values using BSG and required by QEMU-KVM.