hvm: reserve memory for stubdom
Previously it was allocated from 50MB memory margin left by qmemman. Which wasn't reliable enough.
This commit is contained in:
parent
7b8e6283d5
commit
355ed640b2
@ -1662,7 +1662,9 @@ class QubesVm(object):
|
|||||||
if (retcode != 0) :
|
if (retcode != 0) :
|
||||||
raise OSError ("Cannot execute qrexec-daemon!")
|
raise OSError ("Cannot execute qrexec-daemon!")
|
||||||
|
|
||||||
def start(self, debug_console = False, verbose = False, preparing_dvm = False, start_guid = True, notify_function = None):
|
def start(self, debug_console = False, verbose = False,
|
||||||
|
preparing_dvm = False, start_guid = True, notify_function = None,
|
||||||
|
mem_required = None):
|
||||||
if dry_run:
|
if dry_run:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -1686,7 +1688,8 @@ class QubesVm(object):
|
|||||||
# refresh config file
|
# refresh config file
|
||||||
self.create_config_file()
|
self.create_config_file()
|
||||||
|
|
||||||
mem_required = int(self.memory) * 1024 * 1024
|
if mem_required is None:
|
||||||
|
mem_required = int(self.memory) * 1024 * 1024
|
||||||
qmemman_client = QMemmanClient()
|
qmemman_client = QMemmanClient()
|
||||||
try:
|
try:
|
||||||
got_memory = qmemman_client.request_memory(mem_required)
|
got_memory = qmemman_client.request_memory(mem_required)
|
||||||
|
@ -421,6 +421,9 @@ class QubesHVm(QubesVm):
|
|||||||
if self.template and self.template.is_running():
|
if self.template and self.template.is_running():
|
||||||
raise QubesException("Cannot start the HVM while its template is running")
|
raise QubesException("Cannot start the HVM while its template is running")
|
||||||
try:
|
try:
|
||||||
|
if 'mem_required' not in kwargs:
|
||||||
|
# Reserve 32MB for stubdomain
|
||||||
|
kwargs['mem_required'] = (self.memory + 32) * 1024 * 1024
|
||||||
return super(QubesHVm, self).start(*args, **kwargs)
|
return super(QubesHVm, self).start(*args, **kwargs)
|
||||||
except QubesException as e:
|
except QubesException as e:
|
||||||
if xc.physinfo()['virt_caps'].count('hvm') == 0:
|
if xc.physinfo()['virt_caps'].count('hvm') == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user