qvm-ls: fix total VM size reporting
There is no vm.storage object in qubesadmin module.
This commit is contained in:
parent
80f1dd7d13
commit
7db2ed82ea
@ -351,7 +351,7 @@ Column('MEMORY',
|
||||
doc='Memory currently used by VM')
|
||||
|
||||
Column('DISK',
|
||||
attr=(lambda vm: vm.storage.get_disk_utilization() / 1024 / 1024),
|
||||
attr=(lambda vm: vm.get_disk_utilization() // 1024 // 1024),
|
||||
doc='Total disk utilisation.')
|
||||
|
||||
|
||||
|
@ -257,6 +257,10 @@ class QubesVM(qubesadmin.base.PropertyHolder):
|
||||
vm=self.name, vm_name=volname)
|
||||
return self._volumes
|
||||
|
||||
def get_disk_utilization(self):
|
||||
'''Get total disk usage of the VM'''
|
||||
return sum(vol.usage for vol in self.volumes.values())
|
||||
|
||||
def run_service(self, service, **kwargs):
|
||||
'''Run service on this VM
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user