]> xenbits.xensource.com Git - libvirt.git/commit
virsh-domain: Refactor error paths for cmdCPUStats
authorPeter Krempa <pkrempa@redhat.com>
Tue, 22 Jan 2013 11:17:18 +0000 (12:17 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 22 Jan 2013 16:36:45 +0000 (17:36 +0100)
commita54f25a9460b70088dcc99f0d637c3cc0d957702
tree16b1ea1da6288c19a3f30a6f27d34fd4d3f664c9
parent35c30522a5720bc4c61f2afef230915ecae75720
virsh-domain: Refactor error paths for cmdCPUStats

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