| Summary: | Expose 'virNodeGetMemoryStats' and 'virNodeGetCPUStats' APIs in python binding | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Alex Jia <ajia> |
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.2 | CC: | acathrow, dallan, dyuan, gsun, mzhan, rwu |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-0.9.9-1.el6 | Doc Type: | Bug Fix |
| Doc Text: |
No Documentation needed
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-06-20 06:36:02 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Alex Jia
2011-10-25 08:47:52 UTC
Requested functions were exported with upstream commits:
commit 17c7795561f408814a6925966d5ef57aaf17f7f2
Author: Peter Krempa <pkrempa>
Date: Mon Nov 28 18:19:28 2011 +0100
python: Expose binding for virNodeGetMemoryStats()
This patch adds binding for virNodeGetMemoryStats method of libvirtd.
Return value is represented as a python dictionary mapping field
names to values.
commit 49556023f28d7960c3a27b4a30270dcac08c5e52
Author: Peter Krempa <pkrempa>
Date: Mon Nov 28 18:19:27 2011 +0100
python: Expose binding for virNodeGetCPUStats()
This patch adds binding for virNodeGetCPUStats method of libvirtd.
Return value is represented as a python dictionary mapping field names
to values.
Tested with code:
import libvirt
conn = libvirt.open('qemu:///system')
mem = conn.getMemoryStats(libvirt.VIR_NODE_MEMORY_STATS_ALL_CELLS, 0)
cpu = conn.getCPUStats(libvirt.VIR_NODE_CPU_STATS_ALL_CPUS, 0)
print mem
print cpu
Result:
{'cached': 809104L, 'total': 2027708L, 'buffers': 70756L, 'free': 553156L}
{'kernel': 191770000000L, 'idle': 3176360000000L, 'user': 711340000000L, 'iowait': 92490000000L}
# 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) >>> conn.getCPUStats(libvirt.VIR_NODE_CPU_STATS_ALL_CPUS, 0) {'kernel': 1155780000000L, 'idle': 161385760000000L, 'user': 1524500000000L, 'iowait': 319040000000L} >>> conn.getMemoryStats(libvirt.VIR_NODE_MEMORY_STATS_ALL_CELLS, 0) {'cached': 493128L, 'total': 3856644L, 'buffers': 140576L, 'free': 3000864L} >>> so, this is fixed. (In reply to comment #4) > # 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) > >>> conn.getCPUStats(libvirt.VIR_NODE_CPU_STATS_ALL_CPUS, 0) > {'kernel': 1155780000000L, 'idle': 161385760000000L, 'user': 1524500000000L, > 'iowait': 319040000000L} > >>> conn.getMemoryStats(libvirt.VIR_NODE_MEMORY_STATS_ALL_CELLS, 0) > {'cached': 493128L, 'total': 3856644L, 'buffers': 140576L, 'free': 3000864L} > >>> > > > so, this is fixed. # rpm -q libvirt libvirt-python libvirt-0.9.9-1.el6.x86_64 libvirt-python-0.9.9-1.el6.x86_64
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
No Documentation needed
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 |