Re: [PATCH] qemu: Parse current balloon value returned by query_balloon.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/6/3 Osier Yang <jyang@xxxxxxxxxx>:
> 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 ++++++++++++
> Âtools/virsh.c        Â|  Â2 ++
> Â4 files changed, 19 insertions(+), 1 deletions(-)
>
> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
> index 8058229..864852b 100644
> --- a/include/libvirt/libvirt.h.in
> +++ b/include/libvirt/libvirt.h.in
> @@ -456,11 +456,13 @@ typedef enum {
> Â Â Â*/
> Â Â VIR_DOMAIN_MEMORY_STAT_AVAILABLE Â Â Â = 5,
>
> + Â Â/* Current balloon value (in KB). */
> + Â ÂVIR_DOMAIN_MEMORY_STAT_ACTUAL Â Â Â Â Â= 6,

Is this the memory size occupied by the balloon? Then I suggest we
call this VIR_DOMAIN_MEMORY_STAT_BALLOON instead or
VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON if you want to keep the 'actual'
in there.

Matthias

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]