qubes.vm.adminvm fix XXX and add docstrings

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-06-16 14:00:53 +02:00
parent e5906df0c7
commit 0cd667a1f5

View File

@ -1,6 +1,5 @@
#!/usr/bin/python2 -O #!/usr/bin/python2 -O
# vim: fileencoding=utf-8 # vim: fileencoding=utf-8
# #
# The Qubes OS Project, https://www.qubes-os.org/ # The Qubes OS Project, https://www.qubes-os.org/
# #
@ -24,6 +23,8 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# #
''' This module contains the AdminVM implementation '''
import qubes import qubes
import qubes.exc import qubes.exc
import qubes.vm.qubesvm import qubes.vm.qubesvm
@ -41,7 +42,6 @@ class AdminVM(qubes.vm.qubesvm.QubesVM):
default=None, default=None,
doc='There are other ways to set kernel for Dom0.') doc='There are other ways to set kernel for Dom0.')
@property @property
def xid(self): def xid(self):
'''Always ``0``. '''Always ``0``.
@ -51,7 +51,6 @@ class AdminVM(qubes.vm.qubesvm.QubesVM):
''' '''
return 0 return 0
@property @property
def libvirt_domain(self): def libvirt_domain(self):
'''Always :py:obj:`None`. '''Always :py:obj:`None`.
@ -61,13 +60,6 @@ class AdminVM(qubes.vm.qubesvm.QubesVM):
''' '''
return None return None
# XXX probably unneeded, will return None as we don't have netvm
# @property
# def ip(self):
# return "10.137.0.2"
def is_running(self): def is_running(self):
'''Always :py:obj:`True`. '''Always :py:obj:`True`.
@ -76,7 +68,6 @@ class AdminVM(qubes.vm.qubesvm.QubesVM):
''' '''
return True return True
def get_power_state(self): def get_power_state(self):
'''Always ``'Running'``. '''Always ``'Running'``.
@ -85,7 +76,6 @@ class AdminVM(qubes.vm.qubesvm.QubesVM):
''' '''
return 'Running' return 'Running'
def get_mem(self): def get_mem(self):
'''Get current memory usage of Dom0. '''Get current memory usage of Dom0.
@ -101,7 +91,6 @@ class AdminVM(qubes.vm.qubesvm.QubesVM):
return int(line.split(':')[1].strip().split()[0]) return int(line.split(':')[1].strip().split()[0])
raise NotImplementedError() raise NotImplementedError()
def get_mem_static_max(self): def get_mem_static_max(self):
'''Get maximum memory available to Dom0. '''Get maximum memory available to Dom0.
@ -118,7 +107,6 @@ class AdminVM(qubes.vm.qubesvm.QubesVM):
''' '''
return True return True
def start(self, **kwargs): def start(self, **kwargs):
'''Always raises an exception. '''Always raises an exception.
@ -127,15 +115,13 @@ class AdminVM(qubes.vm.qubesvm.QubesVM):
''' # pylint: disable=unused-argument ''' # pylint: disable=unused-argument
raise qubes.exc.QubesVMError(self, 'Cannot start Dom0 fake domain!') raise qubes.exc.QubesVMError(self, 'Cannot start Dom0 fake domain!')
def suspend(self): def suspend(self):
'''Does nothing. '''Does nothing.
.. seealso: .. seealso:
:py:meth:`qubes.vm.qubesvm.QubesVM.suspend` :py:meth:`qubes.vm.qubesvm.QubesVM.suspend`
''' '''
# XXX shouldn't we spew an exception? raise qubes.exc.QubesVMError(self, 'Cannot suspend Dom0 fake domain!')
return
# def __init__(self, **kwargs): # def __init__(self, **kwargs):