Bug 510430 - nodedev-destroy can hang libvirtd
Summary: nodedev-destroy can hang libvirtd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.4
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-09 09:00 UTC by zhanghaiyan
Modified: 2010-03-30 08:10 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:10:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Backport of upstream changeset (622 bytes, text/plain)
2009-12-09 18:02 UTC, Cole Robinson
no flags Details
rebased patch - 0 fuzz (434 bytes, application/octet-stream)
2009-12-11 05:04 UTC, Laine Stump
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0205 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2010-03-29 12:27:37 UTC

Description zhanghaiyan 2009-07-09 09:00:03 UTC
Description of problem:
After # virsh nodedev-destroy pci_****_***, 
then # virsh nodedev-list --tree, no output.
It seems libvirtd is hanged


Version-Release number of selected component (if applicable):
libvirt-0.6.3-14.el5
RHEL5.4-Server-x86_64-xen
kernel-xen-2.6.18-156.el5

How reproducible:
100%

Steps to Reproduce:
1.# virsh nodedev-list --tree
  computer
  |
  +-pci_8086_10bd
  |   |
  |   +-net_00_1e_4f_a8_ee_27
  |     
  +-pci_8086_244e
  +-pci_8086_2914
   ................

2. # virsh nodedev-destroy pci_8086_10bd
   Destroyed node device 'pci_8086_10bd'

3. # virsh nodedev-list --tree
   <no output>
 
Actual results:
After step3, output the same result with step1

Expected results:
no output

Additional info:
After restart libvirtd, can list node device info
4. # service libvirtd restart
   Stopping libvirtd daemon:                                  [  OK  ]
   Starting libvirtd daemon:                                  [  OK  ]
5. # virsh nodedev-list --tree
  computer
  |
  +-pci_8086_10bd
  |   |
  |   +-net_00_1e_4f_a8_ee_27
  |     
  +-pci_8086_244e
  +-pci_8086_2914
   ................

Comment 1 Daniel Berrangé 2009-10-30 15:59:20 UTC
The scenario described shows an attempt to destroy a NIC interface. The Nodedev destroy functionality only covers NPIV  HBAs. So this hang is probably a flaw in our error detection path for non-NPIV devices.

Comment 2 Cole Robinson 2009-12-09 17:34:41 UTC
My guess is this is solved by the following upstream commit:

http://libvirt.org/git/?p=libvirt.git;a=commit;h=d686056f624474c61f901762604034fb88301783

However there is still an issue with virsh nodedev-destroy reporting success for devices that it doesn't actually destroy, though that is a separate issue.

Comment 3 Cole Robinson 2009-12-09 18:02:39 UTC
Created attachment 377258 [details]
Backport of upstream changeset

Upstream change applied cleanly and builds fine.

Comment 4 Laine Stump 2009-12-11 05:04:19 UTC
Created attachment 377667 [details]
rebased patch - 0 fuzz

I've verified that the patch eliminates the libvirtd crash.

The original patch had some fuzz, so I regenerated a patch with 0 fuzz.

Comment 5 Daniel Veillard 2009-12-11 09:42:41 UTC
Posted and ACK'ed on virtualist,

Daniel

Comment 6 Daniel Veillard 2009-12-15 15:48:24 UTC
libvirt-0.6.3-25.el5 has been built in dist-5E-qu-candidate with the fix,

Daniel

Comment 8 Alex Jia 2009-12-29 09:14:33 UTC
This bug has been verified with libvirt 0.6.3-25.el5 on RHEL-5.5. Already
fixed,set status to VERIFIED.

Version-Release number of selected component (if applicable):
[root@dhcp-66-70-62 libvirt]# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.18-183.el5xen #1 SMP Mon Dec 21 18:46:14 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-62 libvirt]# rpm -qa|grep libvirt
libvirt-0.6.3-25.el5
libvirt-python-0.6.3-25.el5
libvirt-debuginfo-0.6.3-25.el5
[root@dhcp-66-70-62 libvirt]# rpm -qa|grep xen
xen-libs-3.0.3-102.el5
xen-devel-3.0.3-102.el5
kmod-gnbd-xen-0.1.5-2.el5
kmod-gfs-xen-0.1.34-9.el5
xen-3.0.3-102.el5
xen-libs-3.0.3-102.el5
kernel-xen-2.6.18-183.el5
kmod-cmirror-xen-0.1.22-3.el5

Steps to Reproduce:
[root@dhcp-66-70-62 libvirt]# virsh nodedev-list --tree
computer
  |
  +-pci_8086_10bd
  |   |
  |   +-net_00_23_ae_6f_f1_d7
  |     
  +-pci_8086_244e
  +-pci_8086_2914
......

[root@dhcp-66-70-62 libvirt]# virsh nodedev-destroy pci_8086_10bd
Destroyed node device 'pci_8086_10bd'

[root@dhcp-66-70-62 libvirt]# virsh nodedev-list --tree
computer
  |
  +-pci_8086_10bd
  |   |
  |   +-net_00_23_ae_6f_f1_d7
  |     
  +-pci_8086_244e
  +-pci_8086_2914
......

Comment 13 errata-xmlrpc 2010-03-30 08:10:41 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0205.html


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