global_settings: Use MiB, not M as the unit

Prior to this commit, clicking on the "OK" button in the global settings
window would cause the dom0 memory boost and minimum VM memory fields to
be saved incorrectly, due to the fact that the code calculates the
values to be saved using the "MiB" as the units (i.e., factors of
1024), whereas the code would save the corresponding string into the
qmemman configuration file with the "M" suffix (indicating factors of
1000 instead of 1024).

Due to this bug, the aforementioned fields' values would be scaled down
every time the user clicked on the "OK" button in the global settings
window. For example, if the user entered 400 and hit 'OK', opening the
global settings window again would show the value 381.
This commit is contained in:
M. Vefa Bicakci 2019-01-16 21:10:26 -05:00
parent 3e01fd202e
commit 7df475e0aa
No known key found for this signature in database
GPG Key ID: 1DF87CE3B3A5DFAF

View File

@ -182,8 +182,8 @@ class GlobalSettingsWindow(ui_globalsettingsdlg.Ui_GlobalSettings,
if current_min_vm_mem*1024*1024 != self.vm_min_mem_val \
or current_dom0_mem_boost*1024*1024 != self.dom0_mem_boost_val:
current_min_vm_mem = str(current_min_vm_mem)+'M'
current_dom0_mem_boost = str(current_dom0_mem_boost)+'M'
current_min_vm_mem = str(current_min_vm_mem)+'MiB'
current_dom0_mem_boost = str(current_dom0_mem_boost)+'MiB'
if not self.qmemman_config.has_section('global'):
#add the whole section