diff options
author | Cole Robinson <crobinso@redhat.com> | 2013-07-07 09:42:21 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2013-07-07 09:42:21 -0400 |
commit | 149e19da64f4051317198ce19e029e1ae7c42153 (patch) | |
tree | 8a767291f139b8c4b188be68c37c50fe50a2d593 /virtManager/connection.py | |
parent | b044dd94c7965dc9901e9a2ba00d960d3a891d28 (diff) | |
download | virt-manager-149e19da64f4051317198ce19e029e1ae7c42153.tar.gz |
connection: Pass nostatsupdate through to VM tick
When kicking off a priority tick, we want to update domain status but not
update stats listing.
Diffstat (limited to 'virtManager/connection.py')
-rw-r--r-- | virtManager/connection.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/virtManager/connection.py b/virtManager/connection.py index 40930e20..b5785c00 100644 --- a/virtManager/connection.py +++ b/virtManager/connection.py @@ -1141,7 +1141,7 @@ class vmmConnection(vmmGObject): def schedule_priority_tick(self, obj=None): self.emit("priority-tick", obj or self) - def tick(self, noStatsUpdate=False): + def tick(self, stats_update): """ main update function: polls for new objects, updates stats, ...""" if self.state != self.STATE_ACTIVE: return @@ -1229,14 +1229,21 @@ class vmmConnection(vmmGObject): ticklist = [] def add_to_ticklist(l, args=()): - ticklist.extend([(o, args) for o in l.values()]) + ticklist.extend([(o, args) for o in l]) - updateVMs = noStatsUpdate and newVMs or vms - add_to_ticklist(updateVMs) - add_to_ticklist(noStatsUpdate and newNets or nets) - add_to_ticklist(noStatsUpdate and newPools or pools) - add_to_ticklist(noStatsUpdate and newInterfaces or interfaces) - add_to_ticklist(self.mediadevs) + updateVMs = newVMs + if stats_update: + updateVMs = vms + + for key in vms: + if key in updateVMs: + add_to_ticklist([vms[key]], (True,)) + else: + add_to_ticklist([vms[key]], (stats_update,)) + add_to_ticklist(nets.values()) + add_to_ticklist(pools.values()) + add_to_ticklist(interfaces.values()) + add_to_ticklist(self.mediadevs.values()) for obj, args in ticklist: try: @@ -1252,7 +1259,7 @@ class vmmConnection(vmmGObject): "connection doesn't seem to have dropped. " "Ignoring.") - if not noStatsUpdate: + if stats_update: self._recalculate_stats(updateVMs.values()) self.idle_emit("resources-sampled") |