Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 641187

Summary: Any value that is out of range of cpu_shares can be specified.
Product: Red Hat Enterprise Linux 6 Reporter: Humble Chirammal <hchiramm>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: ajia, dallan, eblake, weizhan, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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 13:22:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Humble Chirammal 2010-10-08 00:38:20 UTC
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 07:40:51 UTC
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-04 03:16:33 UTC
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 13:22:38 UTC
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