Re: [PATCH v3] python: add virDomainGetCPUStats python binding API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/19/2012 12:27 AM, Guannan Ren wrote:
>     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.
> ---
>  python/generator.py             |    5 +-
>  python/libvirt-override-api.xml |   13 ++++
>  python/libvirt-override.c       |  147 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 164 insertions(+), 1 deletions(-)

ACK once you fix one bug:

> +
> +            for (i = 0; i < queried_ncpus; i++) {
> +                cpuparams = &params[i * i_retval];

s/i_retval/nparams/

Your testing worked because you happened to have a situation where
i_retval==nparams, but the API allows for i_retval < nparams (that is,
the number of filled entries within a stride can be less than the number
of slots reserved by the stride).

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]