On 02/06/2015 10:32 AM, Kristian Hagsted Rasmussen wrote:
On Wednesday, February 4, 2015 05:41, Juergen Gross <jgr...@suse.com> wrote:
To: Kristian Hagsted Rasmussen; Olaf Hering; xen-de...@lists.xensource.com
Subject: Re: pvSCSI test
On 02/03/2015 07:16 PM, Kristian Hagsted Rasmussen wrote:
Hi Olaf and Juergen
I am interested in testing pvSCSI as I have a system were it would be ideal.
I have tried to apply this patch "http://marc.info/?l=xen-devel&m=139885599019457&w=2"
called "libbxl: add support for pvscsi, iteration 1", to my xen-4.5 tree.
I am using kernel 3.18.4 compiled with xen-scsiback and xen-scsifront compiled
into the kernel, for both Dom0 and DomU.
My Ubuntu domU is running fine, however the scsi disk I want to pass through
does not appear.
in my config I have added the line:
vscsi= ['3:0:0:0,0:0:0:0']
I have also tried with:
vscsi= ['/dev/sdb,0:0:0:0']
but no matter which syntax I use I get the following error in dmesg log:
xen-pvscsi: 3:0:0:0 doesn't exist
I have no errors in the log files for the domU.
Am I missing something in my configuration, perhaps some device hiding like for
pci pass through?
The upstream pvscsi backend is using the target infrastructure. Until
the tools are aware of this you'll have to configure the device to
pass to a domain in Dom0 e.g. via a script:
#!/bin/bash
# usage:
# mkpvscsi device
# e.g. mkpvscsi /dev/sr0
DEV=$1
gen_uuid()
{
cat /proc/sys/kernel/random/uuid | \
awk '{print "naa.6001405" substr($1,1,8) substr($1,10,1);}'
}
TARG=`gen_uuid`
INIT=`gen_uuid`
NODE=`lsscsi | awk '$(NF) == "'$DEV'"
{ print substr($1,2,length($1)-4); }'`
NAME=`echo $NODE | sed 's/:/_/g'`
I used targetcli to create the pscsi target, so
skipped from here
modprobe configfs
mount -t configfs configfs /sys/kernel/config
modprobe xen-scsiback
modprobe target_core_mod
to here
cd /sys/kernel/config/target
and here to
mkdir -p core/pscsi_0/$NAME
echo "$DEV" >core/pscsi_0/$NAME/udev_path
to here
mkdir -p xen-pvscsi/$TARG/tpgt_0
echo "$NODE" >xen-pvscsi/$TARG/tpgt_0/param/alias
echo $INIT >xen-pvscsi/$TARG/tpgt_0/nexus
mkdir xen-pvscsi/$TARG/tpgt_0/lun/lun_0
cd xen-pvscsi/$TARG/tpgt_0/lun/lun_0
ln -s ../../../../../../target/core/pscsi_0/$NAME xen-pvscsi_port
-------------
After doing this you can use the xen tools to give the device to a domU.
Please note: this script is untested, I've used a simpler one which
fitted my needs (using targetcli, which isn't available everywhere).
I have tested all single steps of the script above, though.
Thanks for the script, I had some problems with the symlinking when
running the script, so tried to make the pscsi in targetcli, and then
shortening the script to skip all script lines concerning the core dir.
This made the script working for me, however I still get:
xen-pvscsi: 3:0:0:0 doesn't exist
error in dmesg log.
Are you using another patch for the xen-tree than the one I listed above?
I've used xm to get the drivers working, not xl. I wanted to have only
one changed component during tests in order to know which component is
failing. :-)
What are the contents of
/sys/kernel/config/target/xen-pvscsi/$TARG/tpgt_0/param/alias
($TARG replaced by the UUID generated above, of course)?
This should be "3:0:0:0" in your case. That's where the backend is
looking for the match from xenstore.
And the final symlink in the script is required. $NAME can be anything,
but has to match the pscsi name, of course.
Juergen
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel