diff --git a/app.py b/app.py index 5f1afcd..7683ef0 100644 --- a/app.py +++ b/app.py @@ -216,13 +216,12 @@ def get_vm_live_stats(): balloon_unused = s.get("balloon_unused", 0) balloon_rss = s.get("balloon_rss", 0) - if balloon_avail > 0: + if balloon_avail > 0 and balloon_unused >= 0: mem_total = balloon_avail // 1024 # KiB to MB mem_used = (balloon_avail - balloon_unused) // 1024 - elif balloon_rss > 0: - mem_total = 0 - mem_used = balloon_rss // 1024 else: + # No guest-side stats (e.g. Windows without full guest agent). + # Mark as unavailable — frontend will show allocated RAM only. mem_total = 0 mem_used = 0