[libvirt] [PATCH v2 RESEND] qemu: Parse current balloon value returned by query_balloon

Eric Blake eblake at redhat.com
Tue Jun 14 03:40:22 UTC 2011


On 06/13/2011 09:54 PM, Osier Yang wrote:
> 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".
> ---
>  include/libvirt/libvirt.h.in |    4 +++-
>  src/libvirt.c                |    2 ++
>  src/qemu/qemu_monitor_json.c |   12 ++++++++++++
>  src/qemu/qemu_monitor_text.c |    4 +++-
>  tools/virsh.c                |    2 ++
>  5 files changed, 22 insertions(+), 2 deletions(-)

ACK.  This should work whether or not qemu supports "actual", and you
fixed the findings from v1.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110613/c4329604/attachment-0001.sig>


More information about the libvir-list mailing list