Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions qubes/tools/qmemmand.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,19 @@ def domain_list_changed(self, refresh_only=False):
self.watch_token_dict[i])
self.watch_token_dict.pop(i)
system_state.del_domain(i)

if not refresh_only:
try:
system_state.do_balance()
except: # pylint: disable=bare-except
self.log.exception('do_balance() failed')
except: # pylint: disable=bare-except
self.log.exception('Updating domain list failed')
finally:
if got_lock:
global_lock.release()
self.log.debug('global_lock released')

if not refresh_only:
try:
system_state.do_balance()
except: # pylint: disable=bare-except
self.log.exception('do_balance() failed')


def meminfo_changed(self, domain_id):
self.log.debug('meminfo_changed(domain_id={!r})'.format(domain_id))
untrusted_meminfo_key = self.handle.read(
Expand Down
10 changes: 6 additions & 4 deletions qubes/vm/qubesvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1761,10 +1761,12 @@ def request_memory(self, mem_required=None):
try:
mem_required_with_overhead = mem_required + MEM_OVERHEAD_BASE \
+ self.vcpus * MEM_OVERHEAD_PER_VCPU
if self.use_memory_hotplug:
# extra overhead to account future hotplug memory
# 1 page per 1MB of RAM, see libxl__get_required_paging_memory()
mem_required_with_overhead += self.maxmem * 4096
maxmem = self.maxmem if self.maxmem else self.memory
if self.virt_mode != "pv":
# extra overhead to account (possibly future hotplug) memory
# 2 pages per 1MB of RAM, see
# libxl__get_required_paging_memory()
mem_required_with_overhead += maxmem * 8192
got_memory = qmemman_client.request_memory(
mem_required_with_overhead)

Expand Down