Received: from eggs.gnu.org ([208.118.235.92]:46927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uhcfa-0001K7-Ds for qemu-devel@nongnu.org; Wed, 29 May 2013 05:27:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhcfT-00018y-C0 for qemu-devel@nongnu.org; Wed, 29 May 2013 05:27:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhcfT-00016K-3l for qemu-devel@nongnu.org; Wed, 29 May 2013 05:27:39 -0400 Date: Wed, 29 May 2013 17:27:31 +0800 From: Asias He Message-ID: <20130529092731.GA12639@hj.localdomain> References: <1366381460-6041-1-git-send-email-pbonzini@redhat.com> <1366381460-6041-7-git-send-email-pbonzini@redhat.com> <51A4590F.90503@linux.vnet.ibm.com> <51A4644A.6070002@redhat.com> <20130528083352.GA19799@hj.localdomain> <51A47244.9050203@linux.vnet.ibm.com> <51A5C4DB.9040307@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <51A5C4DB.9040307@linux.vnet.ibm.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 6/9] vhost-scsi: new device supporting the tcm_vhost Linux kernel module List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: Anthony Liguori , "Michael S. Tsirkin" , qemu-devel@nongnu.org, nab@linux-iscsi.org, Badari , Paolo Bonzini On Wed, May 29, 2013 at 05:05:31PM +0800, Wenchao Xia wrote: > =E4=BA=8E 2013-5-28 17:00, Wenchao Xia =E5=86=99=E9=81=93: > >=E4=BA=8E 2013-5-28 16:33, Asias He =E5=86=99=E9=81=93: > >>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 > >>>>>> > >>>>>>The WWPN specified in configfs is passed to "-device vhost-scsi-p= ci". > >>>>>>The tgpt field of the SET_ENDPOINT ioctl is obsolete now, so it i= s > >>>>>>not > >>>>>>available from the QEMU command-line. Instead, I hardcode it to > >>>>>>zero. > >>>>>> > >>>>Hi, Paolo > >>>> Any document about how to config it correctly in configfs, befor= e > >>>>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=3D/home/pbonzini/test.img,fd_dev_size=3D5905580032= ' > > >>>core/fileio_0/fileio/control > >>>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_p= ort > >>>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". > >>> > >>>Paolo > >> > >>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: >=20 > Result: > 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. >=20 > Issues: > 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? Did you run without nested KVM? > 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) Does targetcli give you the correct size? Also, to narrow the issue down, you can try other backstores, e.g block or ramdisk. > ENV: > nested KVM: >=20 > RH6.4 > (Qemu Virtual CPU 1.5.50, Linux 3.10.0.rc3) > | (100M vhost-scsi hooked with file backend) > RH6.4 > (Common KVM processer, Linux 3.10.0.rc3, > qemu-system-x86_64 1.5.50+, 6a4e17711442849bf2cc731ccddef5a2a2d92d29, > seabios 1.7.2.2, e9725dd76d5d7212cb4a97fd18ff2599538955cf) > | > Fefora 18 > (Intel Xeon X5650, Linux version 3.8.11-200.fc18.x86_64, > QEMU emulator version 1.2.2) >=20 > Invocation details: > On RH6.4 host: > 1 with root, execute following script to prepare configfs system: >=20 > FILEIO=3Dfileio_1 > IMAGE=3D/home/xiawenc/Work/qemu/test/test1.raw > SIZE=3D104857600 > QEMU_WWPN=3Dnaa.600140554cf3a1fe > NEXUS=3Dnaa.60014053226f03f8 >=20 > mkdir -p /sys/kernel/config/target/core/$FILEIO/fileio > echo "fd_dev_name=3D$IMAGE,fd_dev_size=3D$SIZE" > > /sys/kernel/config/target/core/$FILEIO/fileio/control > echo 1 > /sys/kernel/config/target/core/$FILEIO/fileio/enable >=20 > 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/confi= g/target/vhost/$QEMU_WWPN/tpgt_0/lun/lun_0/virtual_scsi_port > echo $NEXUS > /sys/kernel/config/target/vhost/$QEMU_WWPN/tpgt_0/nexus >=20 > 2 invoke qemu, test_guest_RH64.qcow2 is a pre-made disk containing > RH6.4 system: >=20 > x86_64-softmmu/qemu-system-x86_64 --enablem 1024 -drive > file=3D/mnt/nfs/test_guest_RH64.qcow2,if=3Dide,cache=3Dwritethrough -vn= c > 0.0.0.0:10 -L mybios/ -device > vhost-scsi-pci,wwpn=3Dnaa.600140554cf3a1fe,event_idx=3Doff >=20 >=20 > --=20 > Best Regards >=20 > Wenchao Xia >=20 --=20 Asias