Bug 669069

Summary: virsh memtune command displays bogus large values instead of indicating "unlimited"
Product: Red Hat Enterprise Linux 6 Reporter: Justin Clift <jclift>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: ccui, dallan, dyuan, eblake, kwade, llim, mzhan, veillard, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
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:25:29 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 Justin Clift 2011-01-12 15:54:45 UTC
Description of problem:

  In virsh, the memtune command is displaying bogus large values when it should be clearly indicating
  a word like "unlimited".

    virsh # list
    Id Name                 State
    ----------------------------------
    4 Fedora_14_x64        running

    virsh # memtune Fedora_14_x64
    hard_limit     : 9007199254740991
    soft_limit     : 9007199254740991
    swap_hard_limit: 9007199254740991

The number "9007199254740991" here is incorrect.

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

 libvirt 0.8.7 and git master

How reproducible:

  Every time

Steps to Reproduce:
  1. Start a virtual machine using virsh or virt-manager (make sure the guest doesn't have memory limits set)
  2. Run the virsh "memtune" command on the running virtual machine

   The bug shows up now.
    
  
Actual results:

    virsh # memtune Fedora_14_x64
    hard_limit     : 9007199254740991
    soft_limit     : 9007199254740991
    swap_hard_limit: 9007199254740991


Expected results:

    virsh # memtune Fedora_14_x64
    hard_limit     : unlimited
    soft_limit     : unlimited
    swap_hard_limit: unlimited

  (or similar wording)

Additional info:

  A patch for this is being worked upon in libvirt upstream.

  Latest incarnation so far:

    https://www.redhat.com/archives/libvir-list/2011-January/msg00441.html

Comment 4 Cui Chun 2011-02-14 08:06:35 UTC
Verfied it and passed.


Test environment:
libvirt-0.8.7-6.el6
qemu-kvm-0.12.1.2-2.144.el6
kernel-2.6.32-113.el6

Steps:

1. guest is shutdown

# virsh memtune rhel6
error: Unable to get memory parameters
error: internal error cannot find cgroup for domain rhel6

2. start the guest without limitation and recheck "memtue"

# virsh start rhel6
Domain rhel6 started

# virsh memtune rhel6
hard_limit     : unlimited
soft_limit     : unlimited
swap_hard_limit: unlimited

3. set hard_limit and soft_limit
# virsh memtune rhel6 --hard-limit 1048576 --soft-limit 1048000
# virsh memtune rhel6 --hard-limit 1048576 --soft-limit 1048000 --swap-hard-limit 1048576

4. recheck memtune
# virsh memtune rhel6
hard_limit     : 1048576 kB
soft_limit     : 1048000 kB
swap_hard_limit: unlimited

# virsh memtune rhel6
hard_limit     : 1048576 kB
soft_limit     : 1048000 kB
swap_hard_limit: 1048576 kB

Comment 7 errata-xmlrpc 2011-05-19 13:25:29 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