fix qvm-ls display of cpu_time
qhost.measure_cpu_usage expects the qvm_collection as parameter. Also the number of vcpus of dom0 seems to be 0, leading to a div by 0. A more complete fix would probably involve e.g. a new num_cores property which would contain number of vcpu for vhosts and number of actual cores for dom0. For now this is a partial solution.
This commit is contained in:
parent
04750ddef3
commit
958c292607
@ -224,7 +224,7 @@ class QubesHost(object):
|
||||
cputime = vm.get_cputime()
|
||||
previous[vm.xid] = {}
|
||||
previous[vm.xid]['cpu_time'] = (
|
||||
cputime / vm.vcpus)
|
||||
cputime / max(vm.vcpus, 1))
|
||||
previous[vm.xid]['cpu_usage'] = 0
|
||||
time.sleep(wait_time)
|
||||
|
||||
|
@ -148,7 +148,7 @@ def main():
|
||||
|
||||
if (options.cpu):
|
||||
qhost = QubesHost()
|
||||
(measure_time, cpu_usages) = qhost.measure_cpu_usage()
|
||||
(measure_time, cpu_usages) = qhost.measure_cpu_usage(qvm_collection)
|
||||
fields_to_display += ["cpu"]
|
||||
|
||||
if (options.mem):
|
||||
|
Loading…
Reference in New Issue
Block a user