You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sh...@apache.org on 2022/08/12 11:44:13 UTC

[cloudstack] branch 4.17 updated: kvm: update host memory stats (#6622)

This is an automated email from the ASF dual-hosted git repository.

shwstppr pushed a commit to branch 4.17
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.17 by this push:
     new 696b93f421 kvm: update host memory stats (#6622)
696b93f421 is described below

commit 696b93f421a9b1af3dbf68e8c29718927541759e
Author: Ruben Bosch <86...@users.noreply.github.com>
AuthorDate: Fri Aug 12 13:44:04 2022 +0200

    kvm: update host memory stats (#6622)
    
    Fixes #6621
    
    Each time getMemStat() is called, a static value is returned. This value
    should instead be refreshed to return the actual memory used.
    
    Co-authored-by: Ruben Bosch <ru...@cldin.eu>
---
 .../java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index a3a5290671..181b051664 100644
--- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -536,6 +536,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
     }
 
     public MemStat getMemStat() {
+        _memStat.refresh();
         return _memStat;
     }