RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 952105 - [NPIV]Can't create a vHBA with libvirt and scsi_host information is not correct
Summary: [NPIV]Can't create a vHBA with libvirt and scsi_host information is not correct
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: John Ferlan
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 726797 1059956
TreeView+ depends on / blocked
 
Reported: 2013-04-15 08:17 UTC by zhpeng
Modified: 2018-12-02 16:13 UTC (History)
16 users (show)

Fixed In Version: libvirt-1.1.0-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 10:30:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhpeng 2013-04-15 08:17:51 UTC
Description
Can't create a vHBA with libvirt and nodedev-dumpxml scsi_host information is not correct

Version
libvirt-1.0.4-1.el7.x86_64

Steps
1. # virsh nodedev-dumpxml scsi_host5
<device>
  <name>scsi_host5</name>
  <parent>pci_0000_04_00_1</parent>
  <capability type='scsi_host'>
    <host>5</host>
    <capability type='fc_host'>
      <wwnn>2001001b</wwnn>                ---> not correct
      <wwpn>2101001b</wwpn>                ---> not correct
      <fabric_wwn>2001000d</fabric_wwn>    ---> not correct
    </capability>
  </capability>
</device>

2. # virsh nodedev-create vHba.xml
[root@amd-1352-8-2 zhpeng]# virsh nodedev-create newvport.xml
error: Failed to create node device from newvport.xml
error: internal error Parent device scsi_host5 is not capable of vport operations

Actual result
As steps

Expect result
No error, and result is correct.

Additional info
I've confirmed this with osier

zhpeng
BR

Comment 3 Osier Yang 2013-05-13 09:20:55 UTC
commit e106c0112a3a5d06fcea74b0d1d130c720c1c829
Author: Osier Yang <jyang>
Date:   Mon May 6 20:45:12 2013 +0800

    util: Fix regression introduced by commit 4360a098441
    
    Which refactored the old code, and introduced new helper
    virIsCapableVport, but the path for checking with access() is not
    correctly constructed.

commit b76284afb1e2251b03a9d62a1cb5bde7f2255333
Author: Osier Yang <jyang>
Date:   Mon May 6 20:45:11 2013 +0800

    util: Fix regression of wwn reading
    
    Introduced by commit 244ce462e29, which refactored the helper for wwn
    reading, however, it forgot to change the old "strndup" and "sizeof(buf)",
    "sizeof(buf)" operates on the fixed length array ("buf") in the old code,
    but now "buf" is a pointer.

Comment 4 Luwen Su 2013-06-06 06:33:49 UTC
Hi Osier , 

The VHBA still can't be created with same error like before ,
and the libvirtd will report some error messages once it started,

Failed to open file '/sys/class/fc_host//host0/max_npiv_vports': No such file or directory
ibvirtd[1758]: Failed to read max_npiv_vports for host4

Any advices ? Thanks

Package:
libvirt-1.0.6-1.el7.x86_64
kernel-3.10.0-0.rc4.59.el7.x86_64

Steps:
1.# virsh nodedev-dumpxml scsi_host6
<device>
  <name>scsi_host6</name>
  <parent>scsi_host5</parent>
  <capability type='scsi_host'>
    <host>6</host>
    <capability type='fc_host'>
      <wwnn>2101001b32a9f25b</wwnn>
      <wwpn>2001001b32a9f001</wwpn>
      <fabric_wwn>2001000dec9877c1</fabric_wwn>
    </capability>
  </capability>
</device>

2.
# cat vHBA.xml 
<device>
  <parent>scsi_host5</parent>
  <capability type='scsi_host'>
    <capability type='fc_host'>
      <wwnn>2101001b32a9f25b</wwnn>
      <wwpn>2001001b32a9f001</wwpn>
      <fabric_wwn>2001000dec9877c1</fabric_wwn>
    </capability>
  </capability>
</device>

3.
# virsh nodedev-create vHBA.xml 
error: Failed to create node device from vHBA.xml
error: internal error Parent device scsi_host5 is not capable of vport operations

4.
When libvirtd start , it will report
Failed to open file '/sys/class/fc_host//host0/max_npiv_vports': No such file or directory
libvirtd[1758]: Failed to read max_npiv_vports for host4
libvirtd[1758]: Failed to open file '/sys/class/fc_host//host0/max_npiv_vports': No such file or directory
libvirtd[1758]: Failed to read max_npiv_vports for host5

Comment 5 Osier Yang 2013-06-17 07:17:50 UTC
(In reply to time.su from comment #4)
> Hi Osier , 
> 
> The VHBA still can't be created with same error like before ,
> and the libvirtd will report some error messages once it started,
> 
> Failed to open file '/sys/class/fc_host//host0/max_npiv_vports': No such
> file or directory

Hum, incorrect file path. Something is wrong.

> ibvirtd[1758]: Failed to read max_npiv_vports for host4
> 

I change back to ASSIGNED. Since the problem is not fixed exhaustively.

Comment 6 Osier Yang 2013-06-17 07:32:33 UTC
(In reply to Osier Yang from comment #5)
> (In reply to time.su from comment #4)
> > Hi Osier , 
> > 
> > The VHBA still can't be created with same error like before ,
> > and the libvirtd will report some error messages once it started,
> > 
> > Failed to open file '/sys/class/fc_host//host0/max_npiv_vports': No such
> > file or directory
> 
> Hum, incorrect file path. Something is wrong.

Fixed by http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=371c155. So move to POST again. 

> 
> > ibvirtd[1758]: Failed to read max_npiv_vports for host4
> > 
> 
> I change back to ASSIGNED. Since the problem is not fixed exhaustively.

Comment 7 zhpeng 2013-07-02 07:28:22 UTC
Test with: libvirt  1.1.0-1.el7

# virsh nodedev-dumpxml scsi_host5
<device>
  <name>scsi_host5</name>
  <path>/sys/devices/pci0000:00/0000:00:0d.0/0000:04:00.1/host5</path>
  <parent>pci_0000_04_00_1</parent>
  <capability type='scsi_host'>
    <host>5</host>
    <capability type='fc_host'>
      <wwnn>2001001b32a9da4e</wwnn>
      <wwpn>2101001b32a9da4e</wwpn>
      <fabric_wwn>2001000dec9877c1</fabric_wwn>
    </capability>
    <capability type='vport_ops'>
      <max_vports>127</max_vports>
      <vports>0</vports>
    </capability>
  </capability>
</device>


# virsh nodedev-create vHBA.xml 
Node device scsi_host6 created from vHBA.xml

# systemctl restart libvirtd
# echo $?
0

So it's verified.

Comment 10 Ludek Smid 2014-06-13 10:30:13 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.