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

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



On 03/14/2012 06:12 AM, Guannan Ren wrote:
> On 03/14/2012 05:10 PM, Eric Blake wrote:
>> On 03/14/2012 03:02 AM, Daniel Veillard wrote:
>>> On Wed, Mar 14, 2012 at 03:06:38PM +0800, Alex Jia wrote:
>>>> On 03/14/2012 01:57 PM, Guannan Ren wrote:
>>>>>     dom.cPUStats(True, 0)
>>>> I'd like getVcpuStats or cpuStats function naming.
>>>    Based on existing conventions, it should be getVcpuStats() method,
>> getVcpuStats is wrong - if flags is 0, we are getting stats on the
>> physical cpu of the host, not the vcpu of the guest.
>>
>> I think we want getCpuStats.
>>
> 
>      getCPUStats is occupied by virNodeGetCPUStates. Renaming it is not
> good idea.
>      It probably impact on those calling python code.

No it won't - you get the right stats according to which object you call
the method on.  Remember that python is object oriented.  There's a
difference between:

conn.getCPUStats => virNodeGetCPUStats

and

dom.getCPUStats => virDomainGetCPUStats

However, this _does_ point out that for consistent capitalization with
existing python bindings, we want to name it getCPUStats, not getCpuStats.


>      I propose getDomCPUStates, what do you think about it?

No, getCPUStats is sufficient.  And careful to avoid typos - it's Stats,
not States.

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

Attachment: signature.asc
Description: OpenPGP digital signature


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