diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py
index a25e1ba..d9027ba 100644
--- a/qubesmanager/settings.py
+++ b/qubesmanager/settings.py
@@ -747,6 +747,17 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
else:
self.dvm_template_checkbox.setVisible(False)
+ self.provides_network_checkbox.setChecked(
+ getattr(self.vm, 'provides_network', False))
+ if self.provides_network_checkbox.isChecked():
+ domains_using = [vm.name for vm in self.vm.connected_vms]
+ if domains_using:
+ self.provides_network_checkbox.setEnabled(False)
+ self.provides_network_checkbox.setToolTip(
+ "Cannot change this setting while this qube is used as a "
+ "NetVM by the following qubes:\n" +
+ "\n".join(domains_using))
+
def enable_seamless(self):
self.vm.run_service_for_stdio("qubes.SetGuiMode", input=b'SEAMLESS')
@@ -817,6 +828,14 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
except Exception as ex: # pylint: disable=broad-except
msg.append(str(ex))
+ if getattr(self.vm, 'provides_network', False) != \
+ self.provides_network_checkbox.isChecked():
+ try:
+ self.vm.provides_network = \
+ self.provides_network_checkbox.isChecked()
+ except Exception as ex: # pylint: disable=broad-except
+ msg.append(str(ex))
+
return msg
def include_in_balancing_changed(self, state):
diff --git a/ui/settingsdlg.ui b/ui/settingsdlg.ui
index 6217e2b..be1ed9d 100644
--- a/ui/settingsdlg.ui
+++ b/ui/settingsdlg.ui
@@ -29,7 +29,7 @@
- 0
+ 1
@@ -806,7 +806,7 @@ border-width: 1px;
15
- -
+
-
Default DispVM:
@@ -816,17 +816,17 @@ border-width: 1px;
- -
+
-
- -
+
-
Boot qube from CDROM
- -
+
-
-
@@ -852,7 +852,14 @@ The qube must be running to disable seamless mode; this setting is not persisten
- -
+
-
+
+
+ Provides network
+
+
+
+ -