Bug 963488 - libvirt: Use qom-get command on newer versions of qemu to make virDomainMemoryStats() usable again
Summary: libvirt: Use qom-get command on newer versions of qemu to make virDomainMemor...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 878425
TreeView+ depends on / blocked
 
Reported: 2013-05-15 21:55 UTC by Tadej Janež
Modified: 2015-03-16 17:58 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-03-16 17:58:10 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 904160 0 unspecified CLOSED libvirt should re-enable memballoon stat reporting 2021-02-22 00:41:40 UTC

Internal Links: 904160

Description Tadej Janež 2013-05-15 21:55:26 UTC
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 17:58:10 UTC
This should be fixed upstream in 1.1.1:
commit ab600621170985b580af438efd1fd049de39b054
Author:     John Ferlan <jferlan>
AuthorDate: 2013-07-11 19:18:48 -0400
Commit:     John Ferlan <jferlan>
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.