Bug 1022430 - [RFE] Dump max vports, vports and port state in use for HBA's XML
[RFE] Dump max vports, vports and port state in use for HBA's XML
Status: CLOSED DUPLICATE of bug 997756
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: John Ferlan
Virtualization Bugs
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2013-10-23 05:28 EDT by Alex Jia
Modified: 2014-04-02 04:52 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-04-02 04:52:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alex Jia 2013-10-23 05:28:11 EDT
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

How reproducible:

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;

2. # sh /tmp/check_vhba.sh

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

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
      <capability type='scsi_host'>
        <capability type='fc_host'>

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
  <capability type='scsi_host'>
    <capability type='fc_host'>
    <capability type='vport_ops' />

# virsh nodedev-dumpxml scsi_host5
  <capability type='scsi_host'>
    <capability type='fc_host'>
    <capability type='vport_ops' />

Notes, to show max_vports, vports and port_state.

# virsh nodedev-dumpxml scsi_host6
  <capability type='scsi_host'>
    <capability type='fc_host'>

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@redhat.com>
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'>

    * 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 04:52:41 EDT

*** 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.