Bug 1271107 - The vaule of Used memory in 'virsh dominfo' is 0 when the guest is shut off
The vaule of Used memory in 'virsh dominfo' is 0 when the guest is shut off
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-13 03:55 EDT by lijuan men
Modified: 2016-11-03 14:26 EDT (History)
6 users (show)

See Also:
Fixed In Version: libvirt-1.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:26:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description lijuan men 2015-10-13 03:55:16 EDT
Description of problem:
The vaule of Used memory in 'virsh dominfo' is 0 when the guest is shut off

Version-Release number of selected component (if applicable):
  kernel-3.10.0-322.el7.x86_64
  qemu-kvm-1.5.3-104.el7.x86_64
  libvirt-1.2.17-13.el7.x86_64
  

How reproducible:
100%

Steps to Reproduce:

1. create a  guest named rhel7

2. #virsh destroy rhel7

3. #virsh dumpxml rhel7
    *******
     <memory unit='KiB'>4194300</memory>
     <currentMemory unit='KiB'>1024857</currentMemory>
    *******

4. #virsh dominfo rhel7
    *******
    Max memory:     4194300 KiB
    Used memory:    0 KiB
    *******

Actual results:
the vaule of Used memory in step4 is 0,that is not the same as the value of currentMemory in step 3


Expected results:
the vaule of Used memory in step4 is the same as the value of currentMemory in step 3
Comment 1 Peter Krempa 2015-10-13 04:53:42 EDT
Already fixed upstream:

commit 60acb38abbee1636a9cddf8d296f700d115c8f77
Author: Jim Fehlig <jfehlig@suse.com>
Date:   Mon Aug 10 12:49:55 2015 -0600

    Revert "LXC: show used memory as 0 when domain is not active"
    
    This reverts commit 1ce7c1d20cfd5afb26d2dbc88201085d52415d0e,
    which introduced a significant semantic change to the
    virDomainGetInfo() API. Additionally, the change was only
    made to 2 of the 15 virt drivers.
    
    Conflicts:
        src/qemu/qemu_driver.c
    
    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Comment 3 Luyao Huang 2016-06-01 04:42:39 EDT
Verify this bug with libvirt-1.3.4-1.el7.x86_64:

1. prepare a inactive guest:

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel7.0-rhel                   shut off

2. check guest current memory:

# virsh dumpxml rhel7.0-rhel
<domain type='kvm'>
  <name>rhel7.0-rhel</name>
  <uuid>67c7a123-5415-4136-af62-a2ee098ba6cd</uuid>
  <maxMemory slots='16' unit='KiB'>15243264</maxMemory>
  <memory unit='KiB'>1818624</memory>
  <currentMemory unit='KiB'>1798144</currentMemory>

3. check dominfo output:

# virsh dominfo rhel7.0-rhel
Id:             -
Name:           rhel7.0-rhel
UUID:           67c7a123-5415-4136-af62-a2ee098ba6cd
OS Type:        hvm
State:          shut off
CPU(s):         12
Max memory:     1818624 KiB
Used memory:    1798144 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: selinux
Security DOI:   0
Comment 5 errata-xmlrpc 2016-11-03 14:26:10 EDT
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.