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 1245476 - error not right when set memtune but get failed
Summary: error not right when set memtune but get failed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-22 07:24 UTC by Luyao Huang
Modified: 2016-11-03 18:20 UTC (History)
3 users (show)

Fixed In Version: libvirt-1.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:20:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Luyao Huang 2015-07-22 07:24:00 UTC
Description of problem:
error not right when set memtune but get failed

Version-Release number of selected component (if applicable):

libvirt-1.2.17-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
prepare a running guest:

# virsh list
 Id    Name                           State
----------------------------------------------------
 13    rhel7.0-rhel                   running


2. set some invalid memory hard limit :

# virsh memtune rhel7.0-rhel 1
error: Unable to change memory parameters
error: unable to set memory hard_limit tunable: Operation not permitted

3. check the log:

2015-07-22 07:13:14.560+0000: 28633: error : virCgroupSetValueStr:735 : Unable to write to '/sys/fs/cgroup/memory/machine.slice/machine-qemu\x2drhel7.0\x2drhel.scope/memory.limit_in_bytes': Device or resource busy
2015-07-22 07:13:14.560+0000: 28633: error : qemuDomainSetMemoryParameters:9909 : unable to set memory hard_limit tunable: Operation not permitted

Actual results:

memtune report Operation not permitted but should be Device or resource busy

Expected results:

not cover the error from the virCgroup*:
Unable to write to '/sys/fs/cgroup/memory/machine.slice/machine-qemu\x2drhel7.0\x2drhel.scope/memory.limit_in_bytes': Device or resource busy

or just:
unable to set memory hard_limit tunable: Device or resource busy

Additional info:


We will report the error in the cgroup code after commit 0d7f45a, so the cgroup function will return -1, and as 1 is defined as:

#define EPERM        1  /* Operation not permitted */

so we will always report Operation not permitted.

Comment 1 Luyao Huang 2015-07-22 07:37:36 UTC
I have sent a patch to upstream:

http://www.redhat.com/archives/libvir-list/2015-July/msg00831.html

Comment 2 Peter Krempa 2015-07-22 10:10:53 UTC
Fixed upstream:

commit 704cf06a14ca92dcb9be2c3db6bdf1b21f02e1f7
Author: Luyao Huang <lhuang>
Date:   Wed Jul 22 15:35:14 2015 +0800

    qemu: fix the error cover issue in SetMemoryParameters
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1245476
    
    We won't return the errno after commit 0d7f45ae, and
    the more clearly error will be set in the code in vircgroup*.
    Also We will always report error "Operation not permitted",
    because the return is -1.
    
    Signed-off-by: Luyao Huang <lhuang>

v1.2.17-158-g704cf06

Comment 5 Luyao Huang 2016-06-01 08:19:20 UTC
Verify this bug on libvirt-1.3.4-1.el7.x86_64:

1. prepare a running guest:

# virsh  list --all
 Id    Name                           State
----------------------------------------------------
 56    rhel72-test                    running


2. set set guest memory hard limit with a too small value:

# virsh memtune rhel72-test 1
error: Unable to change memory parameters
error: Unable to write to '/sys/fs/cgroup/memory/machine.slice/machine-qemu\x2d56\x2drhel72\x2dtest.scope/memory.limit_in_bytes': Device or resource busy

3. check libvirtd log:

2016-06-01 08:12:02.349+0000: 8702: error : virCgroupSetValueStr:788 : Unable to write to '/sys/fs/cgroup/memory/machine.slice/machine-qemu\x2d56\x2drhel72\x2dtest.scope/memory.limit_in_bytes': Device or resource busy

Comment 7 errata-xmlrpc 2016-11-03 18:20: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.

https://rhn.redhat.com/errata/RHSA-2016-2577.html


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