Bug 828023 - [libvirt] Setting numa parameters causes guest xml error
[libvirt] Setting numa parameters causes guest xml error
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
:
: 838049 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-03 23:03 EDT by zhe peng
Modified: 2013-02-21 02:16 EST (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0.10.0-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:16:14 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)

  None (edit)
Description zhe peng 2012-06-03 23:03:20 EDT
Description of problem:
'virDomain{G, S}etNumaParameters' APIs generate wrong guest xml 

Version-Release number of selected component (if applicable):
libvirt-0.9.10-21.el6.x86_64
rhel6.3 rc build

How reproducible:
always

Steps to Reproduce:
1.# python
Python 2.6.6 (r266:84292, May  1 2012, 13:52:17)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.open(None)
>>> dom = conn.lookupByName("rhel6.3rc")
>>> dom.numaParameters(0)
{'numa_nodeset': '1', 'numa_mode': 1}
>>> param = {'numa_nodeset': '1', 'numa_mode': 1}
>>> dom.setNumaParameters(param, 2)
0

# destroy and start the domain in another console




Actual results:
the guest can't restart
# virsh start rhel6.3rc
error: Failed to start domain rhel6.3rc
error: (domain_definition):8: error parsing attribute name
    <memory mode='preferred'   </numatune>
-------------------------------^

#virsh dumpxml rhel6.3rc
.............
 <vcpu placement='static'>1</vcpu>
  <numatune>
    <memory mode='preferred'   </numatune>
.............


Expected results:
the guest can start without error

Additional info:
use command :
#virsh numatune rhel6.3rcqcow2 --nodeset 1 --config
will get the same error.

refer bug :https://bugzilla.redhat.com/show_bug.cgi?id=771591 , this bug verify in libvirt-0.9.10-1,
i can't reproduce this on
libvirt-0.9.10-16.el6.x86_64
so it's a regression bug.
Comment 2 Alex Jia 2012-06-03 23:55:37 EDT
This problem hasn't any relationship with libvirt client such as virsh or python binding, it's a underlying implementatin issue, which probaly is introduced by upstream commit 8d26a7f or 97010eb1, however, I haven't check it further.

Osier, could you help confirm this? thanks.
Comment 10 Dave Allan 2012-07-06 10:47:11 EDT
*** Bug 838049 has been marked as a duplicate of this bug. ***
Comment 11 Osier Yang 2012-07-23 10:18:20 EDT
v2 posted upstream. https://www.redhat.com/archives/libvir-list/2012-June/msg01018.html
Comment 12 Osier Yang 2012-08-28 21:50:04 EDT
commit 6fd1708fad221956c1ca7de023a7babfb100a4dc
Author: Osier Yang <jyang@redhat.com>
Date:   Tue Aug 28 20:13:31 2012 +0800

    qemu: Set placement when setting numa parameters
    
    To keep the internal data structure consistent.
Comment 14 Wayne Sun 2012-08-31 04:11:56 EDT
pkgs:
libvirt-0.10.0-1.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.297.el6_3.x86_64
kernel-2.6.32-279.el6.x86_64

steps:
1.
# virsh start libvirt_test_api
Domain libvirt_test_api started

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 4     libvirt_test_api               running

2. numatune
# virsh numatune libvirt_test_api --nodeset 2 --config


success, so no xml problem now.

3. destroy domain 
# virsh destroy libvirt_test_api
Domain libvirt_test_api destroyed

4. start domain

# virsh start libvirt_test_api
Domain libvirt_test_api started

# virsh dumpxml libvirt_test_api
...
  <numatune>
    <memory mode='strict' nodeset='2'/>
  </numatune>
...


5. check with python
# python
Python 2.6.6 (r266:84292, May  1 2012, 13:52:17) 
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.open(None)
>>> dom = conn.lookupByName("libvirt_test_api")
>>> dom.numaParameters(0)
{'numa_nodeset': '2', 'numa_mode': 0}
>>> param = {'numa_nodeset': '4', 'numa_mode': 1}
>>> dom.setNumaParameters(param, 2)
0
>>>

# virsh destroy libvirt_test_api
Domain libvirt_test_api destroyed

# virsh start libvirt_test_api
Domain libvirt_test_api started

# virsh dumpxml libvirt_test_api
...
  <numatune>
    <memory mode='preferred' nodeset='4'/>
  </numatune>
...
Comment 15 errata-xmlrpc 2013-02-21 02:16:14 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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html

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