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:
Marek Marczykowski 2013-05-10 05:39:46 +02:00 committed by Marek Marczykowski-Górecki
parent 550d8cac68
commit 201cd509e1
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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