settings: save qubes.xml after saving firewall rules

Saving (and also applying) firewall rules may modify VM's "services",
which are stored in qubes.xml. This is the case for "Allow connection to
Updates Proxy" - which also enables/disables 'yum-proxy-setup' service.
Without this commit, such change was ignored.

Fixes QubesOS/qubes-issues#2770
This commit is contained in:
Marek Marczykowski-Górecki 2017-04-24 01:59:00 +02:00
parent 46b892edb1
commit 23fc7df23c
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -159,10 +159,6 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
except Exception as ex: except Exception as ex:
ret.append(self.tr('Error while saving changes: ') + str(ex)) ret.append(self.tr('Error while saving changes: ') + str(ex))
if self.anything_changed == True:
self.qvm_collection.save()
self.qvm_collection.unlock_db()
try: try:
if self.tabWidget.isTabEnabled(self.tabs_indices["firewall"]): if self.tabWidget.isTabEnabled(self.tabs_indices["firewall"]):
self.fw_model.apply_rules(self.policyAllowRadioButton.isChecked(), self.fw_model.apply_rules(self.policyAllowRadioButton.isChecked(),
@ -171,6 +167,9 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
self.yumproxyCheckBox.isChecked(), self.yumproxyCheckBox.isChecked(),
self.tempFullAccess.isChecked(), self.tempFullAccess.isChecked(),
self.tempFullAccessTime.value()) self.tempFullAccessTime.value())
if self.fw_model.fw_changed:
# might modified vm.services
self.anything_changed = True
except Exception as ex: except Exception as ex:
ret += [self.tr("Firewall tab:"), str(ex)] ret += [self.tr("Firewall tab:"), str(ex)]
@ -180,6 +179,10 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
except Exception as ex: except Exception as ex:
ret += [self.tr("Applications tab:"), str(ex)] ret += [self.tr("Applications tab:"), str(ex)]
if self.anything_changed == True:
self.qvm_collection.save()
self.qvm_collection.unlock_db()
if len(ret) > 0 : if len(ret) > 0 :
thread_monitor.set_error_msg('\n'.join(ret)) thread_monitor.set_error_msg('\n'.join(ret))