Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 510426

Summary: Command 'virsh nodedev-create': error: out of memory
Product: Red Hat Enterprise Linux 5 Reporter: zhanghaiyan <yoyzhang>
Component: libvirtAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: ajia, crobinso, hbrock, jialiu, llim, veillard, virt-maint, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 08:10:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Backport of upstream changeset none

Description zhanghaiyan 2009-07-09 08:21:48 UTC
Description of problem:
Failed to create node device from .xml file, got out of memory error

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

How reproducible:
100%

Steps to Reproduce:
1.# virsh nodedev-list --tree
  ............
  +-pci_8086_29b2
  +-pci_8086_29b3
  +-pci_8086_29b4
  +-pci_8086_29b6
  +-pci_8086_29b7

2.# virsh nodedev-dumpxml pci_8086_29b7
  <device>
  <name>pci_8086_29b7</name>
  <parent>computer</parent>
  <capability type='pci'>
    <domain>0</domain>
    <bus>0</bus>
    <slot>3</slot>
    <function>3</function>
    <product id='0x29b7'>82Q35 Express Serial KT Controller</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
  </capability>
</device>

3. Create node.xml file as below, modify <name> <product id>:
   
  <device>
  <name>pci_8086_29b8</name>
  <parent>computer</parent>
  <capability type='pci'>
    <domain>0</domain>
    <bus>0</bus>
    <slot>3</slot>
    <function>3</function>
    <product id='0x29b8'>82Q35 Express Serial KT Controller</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
  </capability>
</device>

4. # virsh nodedev-create node.xml

Actual results:
Output:
error: Failed to create node device from node.xml
error: out of memory

Expected results:
pci_8086_29b8 is created successfully

Additional info:
After # virsh nodedev-dumpxml pci_8086_29b7, 
have to # service libvirtd restart
This has a Bug 509261 -  nodedev-dumpxml can hang libvirtd

Comment 1 Cole Robinson 2009-12-09 17:37:13 UTC
Pretty sure this is fixed by the following upstream commit:

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

Comment 2 Cole Robinson 2009-12-09 18:02:41 UTC
Created attachment 377259 [details]
Backport of upstream changeset

Applies cleanly and builds fine.

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

Daniel

Comment 5 Alex Jia 2009-12-29 08:01:14 UTC
This bug has been verified with libvirt 0.6.3-25.el5 on RHEL-5.5. Already
fixed, but a another error is raised:
"error: Failed to create node device from node.xml
error: this function is not supported by the hypervisor: Device is not a fibre channel HBA"

it seems only can create a fibre channel HBA device from xml,Is it a correct
behavior?

Version-Release number of selected component (if applicable):
[root@dhcp-66-70-62 bug]# 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 bug]# 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 bug]# 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 ~]# cat node.xml
<device>
  <name>pci_8086_29b8</name>
  <parent>computer</parent>
  <capability type='pci'>
    <domain>0</domain>
    <bus>0</bus>
    <slot>3</slot>
    <function>3</function>
    <product id='0x29b8'>82Q35 Express Serial KT Controller</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
  </capability>
</device>

[root@dhcp-66-70-62 ~]# virsh nodedev-create node.xml
error: Failed to create node device from node.xml
error: this function is not supported by the hypervisor: Device is not a fibre channel HBA

Comment 6 Cole Robinson 2010-01-04 16:23:29 UTC
The error in comment #5 is expected. nodedev-create and nodedev-destroy only work on fibre channel devices, as the error indicates. The improper 'out of memory' error is no longer seen, so it appears this bug is fixed.

Comment 11 errata-xmlrpc 2010-03-30 08:10:38 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