RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 771591 - Expose 'virDomain{G, S}etNumaParameters' APIs in python binding
Summary: Expose 'virDomain{G, S}etNumaParameters' APIs in python binding
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Gunannan Ren
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-04 09:04 UTC by Alex Jia
Modified: 2012-06-20 06:46 UTC (History)
6 users (show)

Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 06:46:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description Alex Jia 2012-01-04 09:04:38 UTC
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 11:00:02 UTC
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 06:52:43 UTC
commit 9c8466daac19379c41be39ec8f18db36c9573c02
Author: Guannan Ren <gren>
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>

Comment 5 Wayne Sun 2012-02-14 10:48:25 UTC
# 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 06:46:05 UTC
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.