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 - Any value that is out of range of cpu_shares can be specified.
Summary: Any value that is out of range of cpu_shares can be specified.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.1
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-08 00:38 UTC by Humble Chirammal
Modified: 2018-11-14 19:47 UTC (History)
5 users (show)

Fixed In Version: libvirt-0.8.7-5.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 13:22:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0596 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-05-18 17:56:36 UTC

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


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