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 1022430 - [RFE] Dump max vports, vports and port state in use for HBA's XML
Summary: [RFE] Dump max vports, vports and port state in use for HBA's XML
Keywords:
Status: CLOSED DUPLICATE of bug 997756
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: John Ferlan
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-23 09:28 UTC by Alex Jia
Modified: 2014-04-02 08:52 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-02 08:52:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Alex Jia 2013-10-23 09:28:11 UTC
Description of problem:
The current libvirt upstream commit 448be8f7 has implemented dumping max vports and vports in use for HBA's XML, and it's backported to libvirt rhel7.0 downstream, but the libvirt rhel6.5 is missing the patch. Except this, it will be more convenient to create vHBA for users if they can know connectivity of the port. In addition, if the port state is Linkdown/Offline then users will hit error like "error: Write of 'XXXX:XXXX' to '/sys/class/fc_host/host$NUM/vport_create' during vport create/delete failed: Operation not supported", it's also not friendly for users.

Version-Release number of selected component (if applicable):
rpm -q libvirt kernel
libvirt-0.10.2-29.el6.x86_64
kernel-2.6.32-288.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1. # cat /tmp/check_vhba.sh
for i in $(virsh nodedev-list --cap scsi_host); do
    if virsh nodedev-dumpxml $i | grep vport_ops > /dev/null; then
        echo $i;
    fi
done

2. # sh /tmp/check_vhba.sh
scsi_host4
scsi_host5

3. # cat /tmp/vhba.scsi_host4.xml
    <device>
      <parent>scsi_host4</parent>
      <capability type='scsi_host'>
        <capability type='fc_host'>
        </capability>
      </capability>
    </device>

4. # virsh nodedev-create /tmp/vhba.scsi_host4.xml
error: Failed to create node device from /tmp/vhba.scsi_host4.xml
error: Write of '5001a4a94a1c33d0:5001a4ae1b949893' to '/sys/class/fc_host/host4/vport_create' during vport create/delete failed: Operation not supported

Notes, to improve error message and show port state.

5. # cat /tmp/vhba.scsi_host5.xml
    <device>
      <parent>scsi_host5</parent>
      <capability type='scsi_host'>
        <capability type='fc_host'>
        </capability>
      </capability>
    </device>

6. # virsh nodedev-create /tmp/vhba.scsi_host5.xml
Node device scsi_host6 created from /tmp/vhba.scsi_host5.xml


Actual results:
please see above

Expected results:

Can dump max vports, vports and port state and improve error message for creating device on Linkdown/Offline port.


Additional info:

# virsh nodedev-dumpxml scsi_host4
<device>
  <name>scsi_host4</name>
  <parent>pci_0000_04_00_0</parent>
  <capability type='scsi_host'>
    <host>4</host>
    <capability type='fc_host'>
      <wwnn>2000001b3289da4e</wwnn>
      <wwpn>2100001b3289da4e</wwpn>
      <fabric_wwn>ffffffff</fabric_wwn>
    </capability>
    <capability type='vport_ops' />
  </capability>
</device>


# 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>2001001b32a9da4e</wwnn>
      <wwpn>2101001b32a9da4e</wwpn>
      <fabric_wwn>2001000dec9877c1</fabric_wwn>
    </capability>
    <capability type='vport_ops' />
  </capability>
</device>

Notes, to show max_vports, vports and port_state.


# virsh nodedev-dumpxml scsi_host6
<device>
  <name>scsi_host6</name>
  <parent>scsi_host5</parent>
  <capability type='scsi_host'>
    <host>9</host>
    <capability type='fc_host'>
      <wwnn>5001a4a3551abf31</wwnn>
      <wwpn>5001a4a408e2e86b</wwpn>
      <fabric_wwn>ffffffff</fabric_wwn>
    </capability>
  </capability>
</device>

Notes, the fabric_wwn of the scsi_host6 inherits scsi_host4 not scsi_host5, is it an expected result? in addition, the 'ffffffff' means the port isn't available or offline? or we also need to check '/sys/class/fc_host/host$NUM/port_state' to make sure connectivity of the port.



# git show 448be8f7
commit 448be8f706693327d77756fb47aa275edfb14977
Author: Osier Yang <jyang>
Date:   Tue Jan 8 01:05:32 2013 +0800

    nodedev: Dump max vports and vports in use for HBA's XML

    This enrichs HBA's xml by dumping the number of max vports and
    vports in use. Format is like:

      <capability type='vport_ops'>
        <max_vports>164</max_vports>
        <vports>5</vports>
      </capability>

    * docs/formatnode.html.in: (Document the new XML)
    * docs/schemas/nodedev.rng: (Add the schema)
    * src/conf/node_device_conf.h: (New member for data.scsi_host)
    * src/node_device/node_device_linux_sysfs.c: (Collect the value of
      max_vports and vports)

Comment 1 Jiri Denemark 2014-04-02 08:52:41 UTC

*** This bug has been marked as a duplicate of bug 997756 ***


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