summaryrefslogtreecommitdiffstats
path: root/libvirt-override-api.xml
diff options
context:
space:
mode:
authorGuannan Ren <gren@redhat.com>2012-03-23 01:10:46 +0800
committerDaniel Veillard <veillard@redhat.com>2012-03-26 13:52:51 +0800
commita333d94eb3b2135c1cf9129b2e5a9aa5307b9882 (patch)
tree26e4ed98a0325000cac36126f35f3d1596b16bf0 /libvirt-override-api.xml
parentf14ce3e4bdae296653d3ebc03ba65f35d3120676 (diff)
downloadlibvirt-python-v6-a333d94eb3b2135c1cf9129b2e5a9aa5307b9882.tar.gz
libvirt-python-v6-a333d94eb3b2135c1cf9129b2e5a9aa5307b9882.tar.xz
libvirt-python-v6-a333d94eb3b2135c1cf9129b2e5a9aa5307b9882.zip
python: add virDomainGetCPUStats python binding API
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=800366 dom.getCPUStats(True, 0) [{'cpu_time': 24699446159L, 'system_time': 10870000000L, 'user_time': 950000000L}] dom.getCPUStats(False, 0) [{'cpu_time': 8535292289L}, {'cpu_time': 1005395355L}, {'cpu_time': 9351766377L}, {'cpu_time': 5813545649L}] *generator.py Add a new naming rule *libvirt-override-api.xml The API function description *libvirt-override.c Implement it. (cherry picked from commit a772f4eebc9e62870ac03dfaaac1102d0fa967b4)
Diffstat (limited to 'libvirt-override-api.xml')
-rw-r--r--libvirt-override-api.xml13
1 files changed, 13 insertions, 0 deletions
diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml
index ab8f33a..06986ec 100644
--- a/libvirt-override-api.xml
+++ b/libvirt-override-api.xml
@@ -149,6 +149,19 @@
<arg name='path' type='char *' info='the path for the block device'/>
<arg name='flags' type='int' info='flags (unused; pass 0)'/>
</function>
+ <function name='virDomainGetCPUStats' file='python'>
+ <info>Extracts CPU statistics for a running domain. On success it will
+ return a list of data of dictionary type. If boolean total is False, the
+ first element of the list refers to CPU0 on the host, second element is
+ CPU1, and so on. The format of data struct is as follows:
+ [{cpu_time:xxx}, {cpu_time:xxx}, ...]
+ If it is True, it returns total domain CPU statistics in the format of
+ [{cpu_time:xxx, user_time:xxx, system_time:xxx}]</info>
+ <return type='str *' info='returns a list of dictionary in case of success, None in case of error'/>
+ <arg name='domain' type='virDomainPtr' info='pointer to domain object'/>
+ <arg name='total' type='bool' info='on true, return total domain CPU statistics, false return per-cpu info'/>
+ <arg name='flags' type='int' info='flags (unused; pass 0)'/>
+ </function>
<function name='virDomainInterfaceStats' file='python'>
<info>Extracts interface device statistics for a domain</info>
<return type='virDomainInterfaceStats' info='a tuple of statistics'/>