Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1033398 - Nodedev-destroy commands both doc and error message when destroy HBA are not clear
Nodedev-destroy commands both doc and error message when destroy HBA are not ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: John Ferlan
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-21 22:11 EST by Luwen Su
Modified: 2016-04-26 10:19 EDT (History)
6 users (show)

See Also:
Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:26:13 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description Luwen Su 2013-11-21 22:11:22 EST
Description of problem:
In virsh.pod's doc , it says the command works on HBA , and when destroy a HBA with it , the error message doesn't make sense

Version-Release number of selected component (if applicable):
libvirt-1.1.1-12.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Basing on libvirt 1.1.1-12 branch , in virsh.pod line  2140 , nodedev-destroy part

Destroy (stop) a device on the host. I<device> can be either device
name or wwn pair in "wwnn,wwpn" format (only works for HBA). Note
that this makes libvirt quit managing a host device, and may even make
that device unusable by the rest of the physical host until a reboot.


2.Destroy a real HBA
# virsh nodedev-dumpxml scsi_host4
<device>
  <name>scsi_host4</name>
  <path>/sys/devices/pci0000:00/0000:00:0d.0/0000:04:00.0/host4</path>
  <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>2001000dec987841</fabric_wwn>
    </capability>
    <capability type='vport_ops'>
      <max_vports>127</max_vports>
      <vports>0</vports>
    </capability>
  </capability>
</device>


#virsh nodedev-destroy scsi_host4
error: Failed to destroy node device 'scsi_host4'
error: internal error: Parent device pci_0000_04_00_0 is not capable of vport operations

#virsh nodedev-list --cap scsi_host | grep 4
scsi_host4


Actual results:
Like the description and steps


Expected results:
If libvirt can't destroy a real HBA , both the doc and the error info should be more clear


Additional info:
Comment 2 Luwen Su 2013-11-21 22:42:33 EST
One more thing , 
Will dumpxml a non-exist nodes error not exposed in terminal ?
Like

# virsh nodedev-dumpxml 1
error: Could not find matching device '1'
error: invalid node device pointer in virNodeDeviceFree    <---here
Comment 7 Jiri Denemark 2014-07-30 04:18:43 EDT
commit ec2fb767bbd087c30b421b6c10eb2de25e90aa62
Author: Osier Yang <jyang@redhat.com>
Date:   Fri Nov 22 20:55:25 2013 +0800

    Doc: Explicitly declaring that nodedev-destroy only works for vHBA

    Though trying to destroy a physical HBA doesn't make sense at all,
    it's still a bit misleading with saying "only works for HBA".

    Signed-off-by: Osier Yang <jyang@redhat.com>

v1.2.0-21-gec2fb76
Comment 9 Pei Zhang 2014-12-04 04:58:31 EST
verify version:
libvirt-1.2.8-10.el7.x86_64

install libvirt-1.2.8-10.el7.src.rpm 

# vim src/libvirt.c
......
/**
 * virNodeDeviceDestroy:
 * @dev: a device object
 *
 * Destroy the device object. The virtual device (only works for vHBA
 * currently) is removed from the host operating system.  This function
 * may require privileged access.
 *

......

# vim tools/virsh.pod 
......
name or wwn pair in "wwnn,wwpn" format (only works for vHBA currently).
Note that this makes libvirt quit managing a host device, and may even
make that device unusable by the rest of the physical host until a reboot.
......

move to verified.
Comment 10 Pei Zhang 2014-12-04 22:10:17 EST
verify in libvirt.org and man page :

check http://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceDestroy

......
Destroy the device object. The virtual device (only works for vHBA currently) is removed from the host operating system. This function may require privileged access.
......

check man page :
......
nodedev-destroy device
           Destroy (stop) a device on the host. device can be either device name or wwn pair in "wwnn,wwpn" format (only works for vHBA currently).  Note that this makes libvirt quit managing a host device, and may even make that device unusable by the rest of the physical host until a reboot.
......
Comment 12 errata-xmlrpc 2015-03-05 02:26:13 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0323.html

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