mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: expand domain memory statistics with 'usable'
'memtotal' in virtio drivers and qemu corresponds to 'available' in libvirt. Because of that, 'stat-available-memory' is renamed into 'usable'. Balloon statistics are not reported in hrf, so no modifications are made in qemu_monitor_text.c. Signed-off-by: Derbyshev Dmitry <dderbyshev@virtuozzo.com>
This commit is contained in:
parent
1aa5e66cf3
commit
65bf044686
@ -603,11 +603,17 @@ typedef enum {
|
|||||||
* is in kB */
|
* is in kB */
|
||||||
VIR_DOMAIN_MEMORY_STAT_RSS = 7,
|
VIR_DOMAIN_MEMORY_STAT_RSS = 7,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* How big the balloon can be inflated without pushing the guest system
|
||||||
|
* to swap, corresponds to 'Available' in /proc/meminfo
|
||||||
|
*/
|
||||||
|
VIR_DOMAIN_MEMORY_STAT_USABLE = 8,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The number of statistics supported by this version of the interface.
|
* The number of statistics supported by this version of the interface.
|
||||||
* To add new statistics, add them to the enum and increase this value.
|
* To add new statistics, add them to the enum and increase this value.
|
||||||
*/
|
*/
|
||||||
VIR_DOMAIN_MEMORY_STAT_NR = 8,
|
VIR_DOMAIN_MEMORY_STAT_NR = 9,
|
||||||
|
|
||||||
# ifdef VIR_ENUM_SENTINELS
|
# ifdef VIR_ENUM_SENTINELS
|
||||||
VIR_DOMAIN_MEMORY_STAT_LAST = VIR_DOMAIN_MEMORY_STAT_NR
|
VIR_DOMAIN_MEMORY_STAT_LAST = VIR_DOMAIN_MEMORY_STAT_NR
|
||||||
|
@ -5986,6 +5986,9 @@ virDomainGetInterfaceParameters(virDomainPtr domain,
|
|||||||
* The amount of memory which is not being used for any purpose (in kb).
|
* The amount of memory which is not being used for any purpose (in kb).
|
||||||
* VIR_DOMAIN_MEMORY_STAT_AVAILABLE:
|
* VIR_DOMAIN_MEMORY_STAT_AVAILABLE:
|
||||||
* The total amount of memory available to the domain's OS (in kb).
|
* The total amount of memory available to the domain's OS (in kb).
|
||||||
|
* VIR_DOMAIN_MEMORY_STAT_USABLE:
|
||||||
|
* How big the balloon can be inflated without pushing the guest system
|
||||||
|
* to swap, corresponds to 'Available' in /proc/meminfo
|
||||||
* VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON:
|
* VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON:
|
||||||
* Current balloon value (in kb).
|
* Current balloon value (in kb).
|
||||||
*
|
*
|
||||||
|
@ -1719,6 +1719,8 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
|
|||||||
VIR_DOMAIN_MEMORY_STAT_UNUSED, 1024);
|
VIR_DOMAIN_MEMORY_STAT_UNUSED, 1024);
|
||||||
GET_BALLOON_STATS("stat-total-memory",
|
GET_BALLOON_STATS("stat-total-memory",
|
||||||
VIR_DOMAIN_MEMORY_STAT_AVAILABLE, 1024);
|
VIR_DOMAIN_MEMORY_STAT_AVAILABLE, 1024);
|
||||||
|
GET_BALLOON_STATS("stat-available-memory",
|
||||||
|
VIR_DOMAIN_MEMORY_STAT_USABLE, 1024);
|
||||||
ret = got;
|
ret = got;
|
||||||
cleanup:
|
cleanup:
|
||||||
virJSONValueFree(cmd);
|
virJSONValueFree(cmd);
|
||||||
|
@ -369,6 +369,8 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd)
|
|||||||
vshPrint(ctl, "unused %llu\n", stats[i].val);
|
vshPrint(ctl, "unused %llu\n", stats[i].val);
|
||||||
if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_AVAILABLE)
|
if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_AVAILABLE)
|
||||||
vshPrint(ctl, "available %llu\n", stats[i].val);
|
vshPrint(ctl, "available %llu\n", stats[i].val);
|
||||||
|
if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_USABLE)
|
||||||
|
vshPrint(ctl, "usable %llu\n", stats[i].val);
|
||||||
if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON)
|
if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON)
|
||||||
vshPrint(ctl, "actual %llu\n", stats[i].val);
|
vshPrint(ctl, "actual %llu\n", stats[i].val);
|
||||||
if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_RSS)
|
if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_RSS)
|
||||||
|
Loading…
Reference in New Issue
Block a user