[pve-devel] [PATCH qemu-server 2/3] vmstatus: add hostmem value
Alexandre Derumier
aderumier at odiso.com
Wed Nov 4 02:41:43 CET 2020
---
PVE/QemuServer.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 0c2b1db..64d3635 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2658,6 +2658,11 @@ sub vmstatus {
if ($pstat->{vsize}) {
$d->{mem} = int(($pstat->{rss}/$pstat->{vsize})*$d->{maxmem});
}
+ if (defined(my $hostmemstat = $cgroups->get_memory_stat())) {
+ $d->{hostmem} = $hostmemstat->{mem};
+ } else {
+ $d->{hostmem} = 0;
+ }
my $old = $last_proc_pid_stat->{$pid};
if (!$old) {
--
2.20.1
More information about the pve-devel
mailing list