mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-08-23 14:36:11 +00:00
a67da3beff
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.
Howto use:
1) Setup the tcm_vhost target through /sys/kernel/config
[Stefan Hajnoczi, Thanks for the script to setup tcm_vhost]
** Setup wwpn and tpgt
$ wwpn="naa.0"
$ tpgt=/sys/kernel/config/target/vhost/$wwpn/tpgt_0
$ nexus=$tpgt/nexus
$ mkdir -p $tpgt
$ echo -n $wwpn > $nexus
** Setup lun using /dev/ram
$ n=0
$ lun=$tpgt/lun/lun_${n}
$ data=/sys/kernel/config/target/core/iblock_0/data_${n}
$ ram=/dev/ram${n}
$ mkdir -p $lun
$ mkdir -p $data
$ echo -n udev_path=${ram} > $data/control
$ echo -n 1 > $data/enable
$ ln -s $data $lun
2) Run kvm tool with the new disk option '-d scsi:$wwpn:$tpgt', e.g
$ lkvm run -k /boot/bzImage -d ~/img/sid.img -d scsi:naa.0:0
Signed-off-by: Asias He <asias.hejun@gmail.com>
Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
39 lines
1.0 KiB
C
39 lines
1.0 KiB
C
#ifndef VIRTIO_PCI_DEV_H_
|
|
#define VIRTIO_PCI_DEV_H_
|
|
|
|
#include <linux/virtio_ids.h>
|
|
|
|
/*
|
|
* Virtio PCI device constants and resources
|
|
* they do use (such as irqs and pins).
|
|
*/
|
|
|
|
#define PCI_DEVICE_ID_VIRTIO_NET 0x1000
|
|
#define PCI_DEVICE_ID_VIRTIO_BLK 0x1001
|
|
#define PCI_DEVICE_ID_VIRTIO_CONSOLE 0x1003
|
|
#define PCI_DEVICE_ID_VIRTIO_RNG 0x1004
|
|
#define PCI_DEVICE_ID_VIRTIO_BLN 0x1005
|
|
#define PCI_DEVICE_ID_VIRTIO_SCSI 0x1008
|
|
#define PCI_DEVICE_ID_VIRTIO_9P 0x1009
|
|
#define PCI_DEVICE_ID_VESA 0x2000
|
|
#define PCI_DEVICE_ID_PCI_SHMEM 0x0001
|
|
|
|
#define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4
|
|
#define PCI_VENDOR_ID_PCI_SHMEM 0x0001
|
|
#define PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET 0x1af4
|
|
|
|
#define PCI_SUBSYSTEM_ID_VESA 0x0004
|
|
#define PCI_SUBSYSTEM_ID_PCI_SHMEM 0x0001
|
|
|
|
#define PCI_CLASS_BLK 0x018000
|
|
#define PCI_CLASS_NET 0x020000
|
|
#define PCI_CLASS_CONSOLE 0x078000
|
|
/*
|
|
* 0xFF Device does not fit in any defined classes
|
|
*/
|
|
#define PCI_CLASS_RNG 0xff0000
|
|
#define PCI_CLASS_BLN 0xff0000
|
|
#define PCI_CLASS_9P 0xff0000
|
|
|
|
#endif /* VIRTIO_PCI_DEV_H_ */
|