[libvirt] [PATCH] virsh-domain: Refactor error paths for cmdCPUStats

Peter Krempa pkrempa at redhat.com
Tue Jan 22 17:03:44 UTC 2013


On 01/22/13 16:05, Michal Privoznik wrote:
> On 22.01.2013 12:22, Peter Krempa wrote:
>> This patch fixes the following issues in the cpu-stats virsh command:
>>
>> 1) Renames label failed_params to no_memory to match coding style
>> 2) Uses proper typed parameter cleanup in error paths to avoid leaks
>> 3) Adds a ret variable and simplifies error labels
>> 4) Changes error message to a slightly more descriptive one and gets rid
>>     of the newline at the end:
>>
>> Before:
>> $ virsh cpu-stats tr
>> error: Failed to virDomainGetCPUStats()
>>
>> error: Requested operation is not valid: domain is not running
>>
>> After:
>> $ tools/virsh cpu-stats tr
>> error: Failed to retrieve CPU statistics for domain 'tr'
>> error: Requested operation is not valid: domain is not running
>> ---
>>   tools/virsh-domain.c | 27 ++++++++++++++-------------
>>   1 file changed, 14 insertions(+), 13 deletions(-)
>
> ACK

Pushed. Thanks.

Peter

>
> Michal
>




More information about the libvir-list mailing list