]> git.proxmox.com Git - qemu.git/commit
balloon: re-enable balloon stats
authorLuiz Capitulino <lcapitulino@redhat.com>
Sat, 1 Dec 2012 02:14:57 +0000 (00:14 -0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Fri, 25 Jan 2013 12:47:48 +0000 (10:47 -0200)
commit7e6ccd9c159450e79f42d08112ebe263b0466644
treeeb7851f943ac3640cc2eb8630c841eb6ab964b56
parent01ceb97e7b8b00a1d4779543fe4b958df7e16890
balloon: re-enable balloon stats

The statistics are now available through device properties via a
polling mechanism. First a client has to enable polling, then it
can query available stats.

Polling is enabled by setting an update interval (in seconds)
to a property named guest-stats-polling-interval, like this:

{ "execute": "qom-set",
  "arguments": { "path": "/machine/peripheral-anon/device[1]",
                 "property": "guest-stats-polling-interval", "value": 4 } }

Then the available stats can be retrieved by querying the
guest-stats property. The returned object is a dict containing
all available stats. Example:

{ "execute": "qom-get",
  "arguments": { "path": "/machine/peripheral-anon/device[1]",
  "property": "guest-stats" } }

{
    "return": {
        "stats": {
            "stat-swap-out": 0,
            "stat-free-memory": 844943360,
            "stat-minor-faults": 219028,
            "stat-major-faults": 235,
            "stat-total-memory": 1044406272,
            "stat-swap-in": 0
        },
        "last-update": 1358529861
    }
}

Please, check the next commit for full documentation.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
hw/virtio-balloon.c