Bug 1121583 - non-root user can use memtune to set limits but it can't work
Summary: non-root user can use memtune to set limits but it can't work
Keywords:
Status: CLOSED DUPLICATE of bug 1023366
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 7.0
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-21 09:35 UTC by Luyao Huang
Modified: 2014-07-28 13:34 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-28 13:34:50 UTC


Attachments (Terms of Use)

Description Luyao Huang 2014-07-21 09:35:30 UTC
description of problem:
non-root user can use memtune to set limits but it can't work.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-29.el7_0.1.x86_64


How reproducible:
100%

Steps to Reproduce:
1.$ virsh uri
qemu:///session

2.$ virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     sdsd                           shut off

3.$ virsh memtune sdsd
hard_limit     : unlimited
soft_limit     : unlimited
swap_hard_limit: unlimited

4.$ virsh memtune sdsd --hard-limit 1024000 --soft-limit 1024000 --swap-hard-limit 1024000

5.$ virsh memtune sdsd
hard_limit     : 1024000
soft_limit     : 1024000
swap_hard_limit: 1024000

6.check in xml
$ virsh dumpxml sdsd
 <memtune>
    <hard_limit unit='KiB'>1024000</hard_limit>
    <soft_limit unit='KiB'>1024000</soft_limit>
    <swap_hard_limit unit='KiB'>1024000</swap_hard_limit>
  </memtune>

7.$ virsh start sdsd
Domain sdsd started

8.$ virsh memtune sdsd
error: Unable to get number of memory parameters
error: Requested operation is not valid: cgroup memory controller is not mounted

9.make sure there is no guest dir in cgroup

/sys/fs/cgroup/memory/machine.slice/

10.$ virsh memtune sdsd --hard-limit 1024000 --soft-limit 1024000 --swap-hard-limit 1024000 --live
error: Unable to change memory parameters
error: Requested operation is not valid: cgroup memory controller is not mounted

$ virsh memtune sdsd --hard-limit 1024000 --soft-limit 1024000 --swap-hard-limit 1024000
error: Unable to change memory parameters
error: Requested operation is not valid: cgroup memory controller is not mounted

$ virsh memtune sdsd --hard-limit 1024000 --soft-limit 1024000 --swap-hard-limit 1024000 --config


Actual results:
memtune can't work in non-root user although it can set hard-limit soft-limit swap-hard-limit in xml,
the output limit numerical value is not from cgroup and libvirt can't change cgroup in non-root user.


Expected results:
memtune can't be used in non-root and report error message should be:memtune can't use in user mode/session mode

Additional info:

Comment 2 Ján Tomko 2014-07-28 13:34:50 UTC

*** This bug has been marked as a duplicate of bug 1023366 ***


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