Red Hat Bugzilla – Bug 963488
libvirt: Use qom-get command on newer versions of qemu to make virDomainMemoryStats() usable again
Last modified: 2015-03-16 13:58:10 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.
This should be fixed upstream in 1.1.1:
Author: John Ferlan <email@example.com>
AuthorDate: 2013-07-11 19:18:48 -0400
Commit: John Ferlan <firstname.lastname@example.org>
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
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
git describe: v1.1.0-202-gab60062 contains: v1.1.1-rc1~123