Bug 641187 - Any value that is out of range of cpu_shares can be specified.
Any value that is out of range of cpu_shares can be specified.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.1
All Linux
low Severity medium
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-07 20:38 EDT by Humble Chirammal
Modified: 2011-05-19 09:22 EDT (History)
5 users (show)

See Also:
Fixed In Version: libvirt-0.8.7-5.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 09:22:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Humble Chirammal 2010-10-07 20:38:20 EDT
Description of Problem:

Any value that is out of range of cpu_shares can be specified.
virsh's man page says that a valid value range is 0-262144 for
cpu_shares. If an invalid value (e.g. -1) is specified when
"virsh schedinfo" is run, it changes the value to 262144 automatically.
In this case, "virsh schedinfo" shouldn't change the value, and should
report an error message like "cpu_shares is out of range". 


Version-Release number of selected component:

Red Hat Enterprise Linux Version Number: 6
Release Number: snapshot13
Architecture: x86_64
Kernel Version: kernel-2.6.32-70.el6.x86_64
Related Package Version: libvirt-client-0.8.1-27.el6.x86_64


How reproducible:
Always

Step to Reproduce:
1. Check that a guest OS is running.
# virsh list
Id Name State
----------------------------------
...
23 test01 running
...
<The guest "test01" is running.>


2. Change the cpu_shares to an invalid value.
# virsh schedinfo test01 --set cpu_shares=-1
Scheduler : posix
cpu_shares : 262144

Actual Results:
The value of cpu_shares is 262144 when an invalid value is specified.

Expected Results:
"virsh schedinfo" doesn't set 262144 to cpu_shares, and reports an
error message. 

--Humble
Comment 5 Alex Jia 2011-02-12 02:40:51 EST
I can reproduce the bug on rhel6.0 with libvirt-0.8.1-27.el6.x86_64, and the bug has been verified with libvirt-0.8.7-5.el6.x86_64 on rhel6 (2.6.32-113.el6.x86_64), and developers have improved virsh man page for this section:

Note: The cpu_shares parameter has a valid value range of 0-262144; Negative values are wrapped to positive, and larger values are capped at the maximum.  Therefore, -1 is a useful shorthand for 262144.
Comment 8 Osier Yang 2011-05-03 23:16:33 EDT
This is a documentation update, so that user could known for setting cpu.shares:

The cpu_shares parameter has a valid value range of 0-262144; Negative values are wrapped to positive, and larger values are capped at the maximum. Therefore, -1 is a useful shorthand for 262144.

We aleady documented this in virsh manual. (man virsh)
Comment 9 errata-xmlrpc 2011-05-19 09:22:38 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0596.html

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