Red Hat Bugzilla – Bug 882915
virsh doesn't report error if updated data argument for command "schedinfo" is invalid
Last modified: 2013-02-21 02:28:04 EST
Description of problem: When the user provides an invalid argument for "virsh schedinfo --set tunable=argument" virsh doesn't report an error and fails ($? == 1) Version-Release number of selected component (if applicable): libvirt-client-0.10.2-10.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. virsh schedinfo guest --set emulator_period=1aaa --config ; echo $? Actual results: $ virsh schedinfo pxe --set emulator_period=1aaa --config ; echo $? Scheduler : posix 1 Expected results: An error message printed: $ virsh schedinfo pxe --set emulator_period=1aaa --config ; echo $? error: invalid argument: Invalid value for tunable emulator_period
Fix posted upstream: http://www.redhat.com/archives/libvir-list/2012-December/msg00012.html
Fixed with: commit bf7209595445782dc106fadaf01d81afc34c4afb Author: Peter Krempa <pkrempa@redhat.com> Date: Mon Dec 3 14:17:52 2012 +0100 virsh: Report errors if arguments of the schedinfo command are incorrect Libvirt's helper API's when called directly don't raise the error so that virsh remembers it. Subsequent calls to libvirt API's might reset the error. In case of schedinfo virDomainFree() in the cleanup section resets the error when virTypedParameterAssignFromStr() fails. This patch adds function vshSaveLibvirtError() that can be called after calling libvirt helper APIs to ensure the error is remembered.
Verified the bug with libvirt-0.10.2-11.el6.x86_64: # virsh schedinfo r6u3 --set emulator_period=1aaa --config ; echo $? Scheduler : posix error: invalid argument: Invalid value for field 'emulator_period': expected unsigned long long 1 Get error info when updated data argument is invalid; and working well when giving valid argument: # virsh schedinfo r6u3 --set emulator_period=1000 --config ; echo $? Scheduler : posix cpu_shares : 0 vcpu_period : 0 vcpu_quota : 0 emulator_period: 1000 emulator_quota : 0 0 So moving to VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0276.html