Bug 963488 - libvirt: Use qom-get command on newer versions of qemu to make virDomainMemoryStats() usable again
libvirt: Use qom-get command on newer versions of qemu to make virDomainMemor...
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Depends On:
Blocks: 878425
  Show dependency treegraph
Reported: 2013-05-15 17:55 EDT by Tadej Janež
Modified: 2015-03-16 13:58 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-03-16 13:58:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tadej Janež 2013-05-15 17:55:26 EDT
As explained by Eric Blake in en email to the virt-tools mailing-list (https://www.redhat.com/archives/virt-tools-list/2013-May/msg00035.html, I just added some minor modifications to the text):
Versions of qemu since 0.15 or so intentionally crippled the 'info balloon' command to plug a security hole, where qemu waited for the guest to report the stats. Thus, qemu only reported information that could be obtained without guest interaction.

Just recently, qemu switched to an event-based solution, where it periodically asks the guest without blocking, the guest informs qemu when it wants, and where libvirt can query the most recent guest information (if any) without blocking, which works to remove the hole of a non-cooperative guest stopping progress.
Patch to qemu-devel is here: https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg04832.html

Libvirt should use the new QMP querying commands for those properties (on systems with a new enough qemu), in order to get guest memory stat reporting back operational.
Comment 1 Ján Tomko 2015-03-16 13:58:10 EDT
This should be fixed upstream in 1.1.1:
commit ab600621170985b580af438efd1fd049de39b054
Author:     John Ferlan <jferlan@redhat.com>
AuthorDate: 2013-07-11 19:18:48 -0400
Commit:     John Ferlan <jferlan@redhat.com>
CommitDate: 2013-07-16 08:44:52 -0400

    Add capability to fetch balloon stats
    This patch will add the qemuMonitorJSONGetMemoryStats() to execute a
    "guest-stats" on the balloonpath using "get-qom" replacing the former
    mechanism which looked through the "query-ballon" returned data for
    the fields.  The "query-balloon" code only returns 'actual' memory.
    Rather than duplicating the existing code, have the JSON API use the
    GetBalloonInfo API.
    A check in the qemuMonitorGetMemoryStats() will be made to ensure the
    balloon driver path has been set.  Since the underlying JSON code can
    return data not associated with the balloon driver, we don't fail on
    a failure to get the balloonpath.  Of course since we've made the check,
    we can then set the ballooninit flag.  Getting the path here is primarily
    due to the process reconnect path which doesn't attempt to set the
    collection period.

git describe: v1.1.0-202-gab60062 contains: v1.1.1-rc1~123

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