[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 6/9] vhost-scsi: new device supporting the tcm_v

From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH 6/9] vhost-scsi: new device supporting the tcm_vhost Linux kernel module
Date: Wed, 29 May 2013 17:05:31 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

于 2013-5-28 17:00, Wenchao Xia 写道:
于 2013-5-28 16:33, Asias He 写道:
On Tue, May 28, 2013 at 10:01:14AM +0200, Paolo Bonzini wrote:
Il 28/05/2013 09:13, Wenchao Xia ha scritto:
From: Nicholas Bellinger <address@hidden>

The WWPN specified in configfs is passed to "-device vhost-scsi-pci".
The tgpt field of the SET_ENDPOINT ioctl is obsolete now, so it is
available from the QEMU command-line.  Instead, I hardcode it to

Hi, Paolo
   Any document about how to config it correctly in configfs, before
invoking qemu with the WWPN number?

Unfortunately no, but vhost-scsi doesn't have many knobs (unlike
iSCSI for example) so it's quite simple.  Here is an example:

cd /sys/kernel/config/target
mkdir -p core/fileio_0/fileio
echo 'fd_dev_name=/home/pbonzini/test.img,fd_dev_size=5905580032' >
echo 1 > core/fileio_0/fileio/enable
mkdir -p vhost/naa.600140554cf3a18e/tpgt_0/lun/lun_0
cd vhost/naa.600140554cf3a18e/tpgt_0
ln -sf ../../../../../core/fileio_0/fileio/ lun/lun_0/virtual_scsi_port
echo naa.60014053226f0388 > nexus

The "nexus" value is the initiator WWN.  naa.600140554cf3a18e is the
target WWN that you have to pass to "-device vhost-scsi-pci".


For me, I always use targetcli utils instead of the sysfs interface.
targetcli in F18 has vhost support now.

   Thanks very much for above information, I'll try it for test.

  I have done a basic test of vhost-scsi, following is the result I'd
like to post, generally it seems fine:

  fdisk/mkfs: fdisk can find it, mke2fs works fine.
  mount: can mount it.
  file I/O: dd 90M zero to a file in that disk succeed.

  1) in fdisk -l, sometime timeout with dmesg "end_request: I/O error,
dev  fd0, sector 0", I guess it is caused by nested KVM that failed
to kick host kernel?
  2) in fdisk -l, it shows 512 bytes larger than the parameter I
specified in fd_dev_size parameter in configfs on host.(shows
104858112 bytes, see the invocation script below)

 nested KVM:

(Qemu Virtual CPU 1.5.50, Linux 3.10.0.rc3)
                          |  (100M vhost-scsi hooked with file backend)
(Common KVM processer, Linux 3.10.0.rc3,
qemu-system-x86_64 1.5.50+, 6a4e17711442849bf2cc731ccddef5a2a2d92d29,
seabios, e9725dd76d5d7212cb4a97fd18ff2599538955cf)
                      Fefora 18
(Intel Xeon X5650, Linux version 3.8.11-200.fc18.x86_64,
 QEMU emulator version 1.2.2)

Invocation details:
  On RH6.4 host:
  1  with root, execute following script to prepare configfs system:


mkdir -p /sys/kernel/config/target/core/$FILEIO/fileio
echo "fd_dev_name=$IMAGE,fd_dev_size=$SIZE" > /sys/kernel/config/target/core/$FILEIO/fileio/control
echo 1 > /sys/kernel/config/target/core/$FILEIO/fileio/enable

mkdir -p /sys/kernel/config/target/vhost/$QEMU_WWPN/tpgt_0/lun/lun_0
ln -sf /sys/kernel/config/target/core/$FILEIO/fileio/ /sys/kernel/config/target/vhost/$QEMU_WWPN/tpgt_0/lun/lun_0/virtual_scsi_port
echo $NEXUS > /sys/kernel/config/target/vhost/$QEMU_WWPN/tpgt_0/nexus

  2 invoke qemu, test_guest_RH64.qcow2 is a pre-made disk containing
RH6.4 system:

x86_64-softmmu/qemu-system-x86_64 --enablem 1024 -drive file=/mnt/nfs/test_guest_RH64.qcow2,if=ide,cache=writethrough -vnc -L mybios/ -device vhost-scsi-pci,wwpn=naa.600140554cf3a1fe,event_idx=off

Best Regards

Wenchao Xia

reply via email to

[Prev in Thread] Current Thread [Next in Thread]