From 454b678284352916ad933b9c2407cc4505f94fff Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sat, 11 Jun 2011 20:44:26 +0200 Subject: [PATCH] dom0: cpu load calculation when VM rebooted fix --- dom0/qvm-core/qubes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index e49928d1..8f333b4d 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -136,6 +136,9 @@ class QubesHost(object): current[vm['domid']]['cpu_usage'] = \ float(current[vm['domid']]['cpu_time'] - previous[vm['domid']]['cpu_time']) \ / long(1000**3) / (current_time-previous_time) * 100 + if current[vm['domid']]['cpu_usage'] < 0: + # VM has been rebooted + current[vm['domid']]['cpu_usage'] = 0 else: current[vm['domid']]['cpu_usage'] = 0