[libvirt-users] Question about vport operation for FC HBA

Ján Tomko jtomko at redhat.com
Thu Jun 20 10:05:45 UTC 2013


On 06/20/2013 11:07 AM, Dennis Chen wrote:
> Hi,
> 
> When I want to use NPIV for a FC HBA in my Linux machine, I got the below
> error msg in virsh:
> 
> virsh # nodedev-create /home/kvm/vHBA.xml
> error: Failed to create node device from /home/kvm/vHBA.xml
> error: internal error Parent device scsi_host20 is not capable of vport
> operations
> 
> I checked the /sys/class folder for my HBA device that I want to use its NPIV
> feature, it's there:
> /sys/class/fc_host/host20/vport_create
> 
> I can create a vHBA by using "echo 'xxxx:xxxx' > ./vport_create", a new fc
> host will be created after that.
> 
> But I can't find any FC host with:
> #virsh nodedev-list --cap fc_host
> 
> SCSI hosts can be found for above "nodedev-list  --cap scsi_host".
> 
> The libvirt I am working on is based ver 1.0.5, I checked the code and found
> below function is seems related with this issue:
> src/util/virutil.c:
> int
> virIsCapableVport(const char *sysfs_prefix,
>                   int host)
> 
> This function looks up if there is "vport_create" file under
> /sys/class/fc_host/host20, as the way to decide if a HBA device is capable of
> vport operation.
> 
> But seems this file is not compiled and virsh doesn't call it in my source
> code environment... is there any tips  ?

Hi, there was a bug in the nodedev driver, it used ../fc_host/host0/.. even
when the host number was different.

It should be fixed by this commit (pushed in the git, but not yet a part of a
release):
http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=371c155

Hopefully that fixes it for you.

Relevant bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=952105
https://bugzilla.redhat.com/show_bug.cgi?id=973543

Jan




More information about the libvirt-users mailing list