Bug 679668 - virsh dommemstat returns a empty result
Summary: virsh dommemstat returns a empty result
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-23 07:35 UTC by Alex Jia
Modified: 2011-12-06 10:54 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.9.3-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 10:54:45 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1513 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-12-06 01:23:30 UTC

Description Alex Jia 2011-02-23 07:35:28 UTC
Description of problem:
Because of qemu-kvm temporarily disabled guest-provided-stats-on-info-ballon-monitor feature from 112-now version, in fact, libvirt qemu driver doesn't support qemudDomainMemoryStats API now, but the current source codes display it indeed support it in src/qemu/qemu_driver.c:
......
    qemudDomainBlockStats, /* domainBlockStats */
    qemudDomainInterfaceStats, /* domainInterfaceStats */
    qemudDomainMemoryStats, /* domainMemoryStats */
    qemudDomainBlockPeek, /* domainBlockPeek */
    qemudDomainMemoryPeek, /* domainMemoryPeek */
    qemuDomainGetBlockInfo, /* domainGetBlockInfo */
......

So I can successfully run virsh dommemstat on active domain, however, the result is empty, which will let user very confused.

If qemu-kvm doesn't support the feature on rhel6.1 release, IMHO,libvirt should raise a error information at least, it looks this:

error: Unable to get memory statistics
error: qemu driver currently doesn't support the feature


Version-Release number of selected component (if applicable):
# rpm -q libvirt 
libvirt-0.8.7-7.el6.x86_64

# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.145.el6.x86_64

# uname -r
2.6.32-113.el6.x86_64

How reproducible:
always, if qemu-kvm version is from 0.12.1.2-2.113 to now

Steps to Reproduce:
1. virsh start domainname
2. virsh dommemstat domainname
  
Actual results:
return a empty value

Expected results:
libvirt raises a friendly prompt information

Additional info:
See also bug 572453

Comment 2 RHEL Program Management 2011-04-04 01:56:48 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 4 Osier Yang 2011-06-03 08:01:38 UTC
patch posted to upstream: http://www.redhat.com/archives/libvir-list/2011-June/msg00156.html

Comment 5 Osier Yang 2011-06-14 05:31:07 UTC
commit 41514f7b3e4eaa18a98976c05fab771fec4ded18
Author: Osier Yang <jyang>
Date:   Tue Jun 14 11:21:35 2011 +0800

    qemu: Parse current balloon value returned by query_balloon
    
    Qemu once supported following memory stats which will returned by
    "query_balloon":
    
        stat_put(dict, "actual", actual);
        stat_put(dict, "mem_swapped_in", dev->stats[VIRTIO_BALLOON_S_SWAP_IN]);
        stat_put(dict, "mem_swapped_out", dev->stats[VIRTIO_BALLOON_S_SWAP_OUT]);
        stat_put(dict, "major_page_faults", dev->stats[VIRTIO_BALLOON_S_MAJFLT]);
        stat_put(dict, "minor_page_faults", dev->stats[VIRTIO_BALLOON_S_MINFLT]);
        stat_put(dict, "free_mem", dev->stats[VIRTIO_BALLOON_S_MEMFREE]);
        stat_put(dict, "total_mem", dev->stats[VIRTIO_BALLOON_S_MEMTOT]);
    
    But it later disabled all the stats except "actual" by commit
    07b0403dfc2b2ac179ae5b48105096cc2d03375a.
    
    libvirt doesn't parse "actual", so user will always see a empty result
    with "virsh dommemstat $domain". Even qemu haven't disabled the stats,
    we should support parsing "actual".

Comment 7 yuping zhang 2011-07-06 07:25:17 UTC
Reproduce this issue on libvirt-0.9.2-1.el6.x86_64
#virsh start rhel6
#virsh dommemstat rhel6
Return Nothing

Tested this issue with:

libvirt-0.9.3-1.el6
qemu-kvm-0.12.1.2-2.167.el6
kernel-2.6.32-164.el6

# virsh list --all
 Id Name                 State
----------------------------------
  1 rhel6                running

# virsh dommemstat rhel6
actual 1048300

# virsh dumpxml rhel6
<domain type='kvm' id='1'>
  <name>rhel6</name>
  <uuid>f66ecb57-f669-b21a-61ab-099d28f74361</uuid>
  <memory>1048570</memory>
  <currentMemory>1048300</currentMemory>
  <vcpu>2</vcpu>
 ......................

So change the bug status to VERIFIED

Comment 8 errata-xmlrpc 2011-12-06 10:54:45 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.

http://rhn.redhat.com/errata/RHBA-2011-1513.html


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