Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 771591 - Expose 'virDomain{G, S}etNumaParameters' APIs in python binding
Expose 'virDomain{G, S}etNumaParameters' APIs in python binding
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Gunannan Ren
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-04 04:04 EST by Alex Jia
Modified: 2012-06-20 02:46 EDT (History)
6 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:46:05 EDT
Type: ---
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-2012:0748 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 15:31:38 EDT

  None (edit)
Description Alex Jia 2012-01-04 04:04:38 EST
Description of problem:
virsh numatune works well and need to expose 'virDomain{G, S}etNumaParameters' APIs in python binding.

Version-Release number of selected component (if applicable):
libvirt-python-0.9.9-0rc1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
# python
Python 2.6.6 (r266:84292, Sep 12 2011, 14:03:14) 
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> con = libvirt.open(None)
>>> dom = con.lookupByName(con.listDefinedDomains()[0])
>>> dom.numaParameters(0, 0, 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 999, in numaParameters
    ret = libvirtmod.virDomainGetNumaParameters(self._o, params, nparams, flags)
AttributeError: 'module' object has no attribute 'virDomainGetNumaParameters'
>>> dom.setNumaParameters(0, 0, 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1198, in setNumaParameters
    ret = libvirtmod.virDomainSetNumaParameters(self._o, params, nparams, flags)
AttributeError: 'module' object has no attribute 'virDomainSetNumaParameters'
  
Actual results:

AttributeError: 'module' object has no attribute 'virDomainGetNumaParameters'
AttributeError: 'module' object has no attribute 'virDomainSetNumaParameters'

Expected results:
expose them in python binding.

Additional info:

# nm -a -D /usr/lib64/python2.6/site-packages/libvirtmod.so |grep -ni virDomainGetNumaParameters
# nm -a -D /usr/lib64/python2.6/site-packages/libvirtmod.so |grep -ni virDomainSetNumaParameters
Comment 1 Gunannan Ren 2012-01-16 06:00:02 EST
the patch has been sent to upstream
https://www.redhat.com/archives/libvir-list/2012-January/msg00585.html
Comment 2 Gunannan Ren 2012-02-10 01:52:43 EST
commit 9c8466daac19379c41be39ec8f18db36c9573c02
Author: Guannan Ren <gren@redhat.com>
Date:   Wed Feb 8 20:20:50 2012 +0800

    python: refactoring virTypedParameter conversion for NUMA tuning APIs
    
              *getPyVirTypedParameter
              *setPyVirTypedParameter
              *virDomainSetNumaParameters
              *virDomainGetNumaParameters
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
Comment 5 Wayne Sun 2012-02-14 05:48:25 EST
# rpm -q libvirt
libvirt-0.9.10-1.el6.x86_64

# python
Python 2.6.6 (r266:84292, Sep 12 2011, 14:03:14) 
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.open(None)
>>> dom = conn.lookupByName("rhel6u2")
>>> dir(dom)
['ID', 'OSType', 'UUID', 'UUIDString', 'XMLDesc', '__del__', '__doc__', '__init__', '__module__', '_conn', '_o', 'abortJob', 'attachDevice', 'attachDeviceFlags', 'autostart', 'blkioParameters', 'blockInfo', 'blockIoTune', 'blockJobAbort', 'blockJobInfo', 'blockJobSetSpeed', 'blockPeek', 'blockPull', 'blockRebase', 'blockResize', 'blockStats', 'blockStatsFlags', 'cPUStats', 'connect', 'controlInfo', 'coreDump', 'create', 'createWithFlags', 'destroy', 'destroyFlags', 'detachDevice', 'detachDeviceFlags', 'diskErrors', 'hasCurrentSnapshot', 'hasManagedSaveImage', 'info', 'injectNMI', 'interfaceParameters', 'interfaceStats', 'isActive', 'isPersistent', 'isUpdated', 'jobInfo', 'managedSave', 'managedSaveRemove', 'maxMemory', 'maxVcpus', 'memoryParameters', 'memoryPeek', 'memoryStats', 'metadata', 'migrate', 'migrate2', 'migrateGetMaxSpeed', 'migrateSetMaxDowntime', 'migrateSetMaxSpeed', 'migrateToURI', 'migrateToURI2', 'name', 'numaParameters', 'openConsole', 'openGraphics', 'pMSuspendForDuration', 'pinVcpu', 'pinVcpuFlags', 'reboot', 'reset', 'resume', 'revertToSnapshot', 'save', 'saveFlags', 'schedulerParameters', 'schedulerParametersFlags', 'schedulerType', 'screenshot', 'sendKey', 'setAutostart', 'setBlkioParameters', 'setBlockIoTune', 'setInterfaceParameters', 'setMaxMemory', 'setMemory', 'setMemoryFlags', 'setMemoryParameters', 'setMetadata', 'setNumaParameters', 'setSchedulerParameters', 'setSchedulerParametersFlags', 'setVcpus', 'setVcpusFlags', 'shutdown', 'shutdownFlags', 'snapshotCreateXML', 'snapshotCurrent', 'snapshotListNames', 'snapshotLookupByName', 'snapshotNum', 'state', 'suspend', 'undefine', 'undefineFlags', 'updateDeviceFlags', 'vcpuPinInfo', 'vcpus', 'vcpusFlags']
>>> dom.numaParameters(0)
{'numa_nodeset': '0-1', 'numa_mode': 0}
>>> param = {'numa_nodeset': '1', 'numa_mode': 1}
>>> dom.setNumaParameters(param, 2)
0

# destroy and start the domain in another console

>>> dom.numaParameters(0)
{'numa_nodeset': '0-1', 'numa_mode': 1}

So, it's working.
Comment 7 errata-xmlrpc 2012-06-20 02:46:05 EDT
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-2012-0748.html

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