Implement missing get_cputime() in AdminVM

This commit is contained in:
Pawel Marczewski 2020-01-15 16:37:57 +01:00
parent 62735d9696
commit 44dc35e972
No known key found for this signature in database
GPG Key ID: DE42EE9B14F96465

View File

@ -160,6 +160,18 @@ class AdminVM(qubes.vm.BaseVM):
self.log.warning('Failed to get memory limit for dom0: %s', e)
return 4096
def get_cputime(self):
'''Get total CPU time burned by Dom0 since start.
.. seealso:
:py:meth:`qubes.vm.qubesvm.QubesVM.get_cputime`
'''
try:
return self.libvirt_domain.info()[4]
except libvirt.libvirtError as e:
self.log.warning('Failed to get CPU time for dom0: %s', e)
return 0
def verify_files(self):
'''Always :py:obj:`True`