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
Showing
想要评论请 注册 或 登录