On Wed, Aug 22, 2012 at 11:48 AM, Nicholas A. Bellinger <nab@xxxxxxxxxxxxxxx> wrote: > On Fri, 2012-08-17 at 17:26 +0800, Asias He wrote: >> This patch brings virito-scsi support to kvm tool. >> >> With the introduce of tcm_vhost (vhost-scsi) >> >> tcm_vhost: Initial merge for vhost level target fabric driver >> >> we can implement virito-scsi by simply having vhost-scsi to handle the >> SCSI command. > > Excited to see vhost-scsi support within kvm-tool btw. :) > > Just one comment below wrt syncing up with v3.6-rc3 code.. > >> diff --git a/tools/kvm/include/kvm/virtio-scsi.h b/tools/kvm/include/kvm/virtio-scsi.h >> new file mode 100644 >> index 0000000..a780d7e >> --- /dev/null >> +++ b/tools/kvm/include/kvm/virtio-scsi.h >> @@ -0,0 +1,26 @@ >> +#ifndef KVM__SCSI_VIRTIO_H >> +#define KVM__SCSI_VIRTIO_H >> + >> +#include "kvm/disk-image.h" >> + >> +struct kvm; >> + >> +int virtio_scsi_init(struct kvm *kvm); >> +int virtio_scsi_exit(struct kvm *kvm); >> + >> +/*----------------------------------------------------*/ >> +/* TODO: Remove this when tcm_vhost goes upstream */ >> +#define TRANSPORT_IQN_LEN 224 >> +#define VHOST_SCSI_ABI_VERSION 0 >> +struct vhost_scsi_target { >> + int abi_version; >> + unsigned char vhost_wwpn[TRANSPORT_IQN_LEN]; >> + unsigned short vhost_tpgt; >> +}; >> +/* VHOST_SCSI specific defines */ >> +#define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target) >> +#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) >> +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target) >> +/*----------------------------------------------------*/ >> + > > Just a heads up that these have changed slightly based upon MST's > feedback over the last weeks.. > > The vhost-scsi RFC-v3 for QEMU 1.3 + v3.6-rc3 PULL request for target > rc-fixes have gone out today containing a slightly modified version of > these definitions, so you'll want to go ahead and update to follow > what's now in target-pending/master, which for vhost-scsi IOCTL ops are: > > struct vhost_scsi_target { > int abi_version; > char vhost_wwpn[TRANSPORT_IQN_LEN]; > unsigned short vhost_tpgt; > unsigned short reserved; > }; > > and update the GET_ABI_VERSION to return 'int': > > #define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int) OK. Will sync these bits to kvm-tool. > Aside from this minor bit, I think the patch looks good wrt to upstream > tcm_vhost kernel code. Feel free to add my: > > Reviewed-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> > > Nice work Asias! Cheers, thanks for reviewing the kvm tool bits. -- Asias He -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html