27 lines
1.1 KiB
Diff
27 lines
1.1 KiB
Diff
|
Subject: domain: Fix memory stats for shutoff VM (bz 1215453)
|
||
|
From: Cole Robinson crobinso@redhat.com Mon May 4 15:50:01 2015 -0400
|
||
|
Date: Mon May 4 15:50:01 2015 -0400:
|
||
|
Git: 848123e6c8850bafad28767a165bbbf8dc746a09
|
||
|
|
||
|
memory doesn't have a separate input/output stats, so we shouldn't use
|
||
|
the in_out_vector_helper. This resulted in shutoff VMs appearing to still
|
||
|
use memory in the manager window.
|
||
|
|
||
|
diff --git a/virtManager/domain.py b/virtManager/domain.py
|
||
|
index cdb8cd5..e96b80f 100644
|
||
|
--- a/virtManager/domain.py
|
||
|
+++ b/virtManager/domain.py
|
||
|
@@ -1699,8 +1699,10 @@ class vmmDomain(vmmLibvirtObject):
|
||
|
cpudata = cpudata[0:limit]
|
||
|
return cpudata
|
||
|
def memory_usage_vector_limit(self, limit):
|
||
|
- return self.in_out_vector_limit(self.stats_memory_vector(),
|
||
|
- limit)
|
||
|
+ data = self.stats_memory_vector()
|
||
|
+ if len(data) > limit:
|
||
|
+ data = data[0:limit]
|
||
|
+ return data
|
||
|
def network_traffic_vector_limit(self, limit, ceil=None):
|
||
|
return self.in_out_vector_limit(self.network_traffic_vector(ceil),
|
||
|
limit)
|