Red Hat Bugzilla – Bug 1033398
Nodedev-destroy commands both doc and error message when destroy HBA are not clear
Last modified: 2016-04-26 10:19:47 EDT
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:
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
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
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.
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. ......
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