Bug 882915 - virsh doesn't report error if updated data argument for command "schedinfo" is invalid
Summary: virsh doesn't report error if updated data argument for command "schedinfo" i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 886216
TreeView+ depends on / blocked
 
Reported: 2012-12-03 10:50 UTC by Peter Krempa
Modified: 2013-02-21 07:28 UTC (History)
6 users (show)

Fixed In Version: libvirt-0.10.2-11.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 07:28:04 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Description Peter Krempa 2012-12-03 10:50:35 UTC
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 14:19:06 UTC
Fix posted upstream: http://www.redhat.com/archives/libvir-list/2012-December/msg00012.html

Comment 2 Peter Krempa 2012-12-03 15:46:43 UTC
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 05:35:04 UTC
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 07:28:04 UTC
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.