Skip to content

Commit

Permalink
Fixed incorrect memory checking in VM Settings
Browse files Browse the repository at this point in the history
When a VM is not included in memory balancing, there is no point
(and it can be actively harmful via deception) in showing warnings
about init_mem and maxmem mismatch.

fixes QubesOS/qubes-issues#5306
  • Loading branch information
marmarta committed Apr 6, 2020
1 parent f1ad829 commit b058db4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions qubesmanager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ def __apply_basic_tab__(self):
return msg

def check_mem_changes(self):
if not self.include_in_balancing.isChecked():
# do not interfere with settings if the VM is not included in memory
# balancing
return
if self.max_mem_size.value() < self.init_mem.value():
QtWidgets.QMessageBox.warning(
self,
Expand Down Expand Up @@ -850,6 +854,8 @@ def include_in_balancing_changed(self, state):
self.dmm_warning_adv.hide()
self.dmm_warning_dev.hide()
self.max_mem_size.setEnabled(self.include_in_balancing.isChecked())
if self.include_in_balancing.isChecked():
self.check_mem_changes()

def boot_from_cdrom_button_pressed(self):
self.save_and_apply()
Expand Down

0 comments on commit b058db4

Please sign in to comment.