QubesDom0NetVm: provide get_mem*
As libvirt doesn't keep dom0 domain object, so add special cases to get memory information.
This commit is contained in:
parent
550d8cac68
commit
201cd509e1
@ -24,7 +24,8 @@
|
||||
|
||||
from qubes.qubes import QubesNetVm,register_qubes_vm_class
|
||||
from qubes.qubes import defaults
|
||||
from qubes.qubes import QubesException,dry_run
|
||||
from qubes.qubes import QubesException,dry_run,libvirt_conn
|
||||
import psutil
|
||||
|
||||
class QubesAdminVm(QubesNetVm):
|
||||
|
||||
@ -57,6 +58,15 @@ class QubesAdminVm(QubesNetVm):
|
||||
def get_power_state(self):
|
||||
return "Running"
|
||||
|
||||
def get_mem(self):
|
||||
return psutil.virtual_memory().total/1024
|
||||
|
||||
def get_mem_static_max(self):
|
||||
return libvirt_conn.getInfo()[1]
|
||||
|
||||
def get_disk_usage(self, file_or_dir):
|
||||
return 0
|
||||
|
||||
def get_disk_utilization(self):
|
||||
return 0
|
||||
|
||||
|
@ -50,6 +50,7 @@ Requires(postun): systemd-units
|
||||
Requires: python, xen-runtime, pciutils, python-inotify, python-daemon
|
||||
Requires: qubes-core-dom0-linux >= 2.0.24
|
||||
Requires: python-lxml
|
||||
Requires: python-psutil
|
||||
# TODO: R: qubes-gui-dom0 >= 2.1.11
|
||||
Conflicts: qubes-gui-dom0 < 1.1.13
|
||||
Requires: xen >= 4.1.0-2
|
||||
|
Loading…
Reference in New Issue
Block a user