Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 882915 - virsh doesn't report error if updated data argument for command "schedinfo" is invalid
virsh doesn't report error if updated data argument for command "schedinfo" i...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks: 886216
  Show dependency treegraph
 
Reported: 2012-12-03 05:50 EST by Peter Krempa
Modified: 2013-02-21 02:28 EST (History)
6 users (show)

See Also:
Fixed In Version: libvirt-0.10.2-11.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:28:04 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 16:18:26 EST

  None (edit)
Description Peter Krempa 2012-12-03 05:50:35 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
Comment 1 Peter Krempa 2012-12-03 09:19:06 EST
Fix posted upstream: http://www.redhat.com/archives/libvir-list/2012-December/msg00012.html
Comment 2 Peter Krempa 2012-12-03 10:46:43 EST
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.
Comment 5 EricLee 2012-12-07 00:35:04 EST
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.
Comment 6 errata-xmlrpc 2013-02-21 02:28:04 EST
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

Note You need to log in before you can comment on or make changes to this bug.