Dynamic mem balancing - pci devs warnings.

This commit is contained in:
Agnieszka Kostrzewa 2012-03-19 21:07:27 +01:00
parent 68560f9151
commit de8028b268
2 changed files with 62 additions and 12 deletions

View File

@ -358,11 +358,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
self.vcpus.setMaximum(QubesHost().no_cpus)
self.vcpus.setValue(int(self.vm.vcpus))
if len(self.vm.pcidevs) > 0:
self.include_in_balancing.setEnabled(False)
else:
self.include_in_balancing.setChecked('meminfo-writer' in self.vm.services and self.vm.services['meminfo-writer']==True)
self.tabWidget.setTabEnabled(self.tabs_indices["devices"], not self.include_in_balancing.isChecked())
self.include_in_balancing.setChecked('meminfo-writer' in self.vm.services and self.vm.services['meminfo-writer']==True)
#kernel
if self.vm.template is not None:
@ -393,7 +389,6 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
else:
self.kernel_opts.setText(self.vm.kernelopts)
#paths
self.dir_path.setText(self.vm.dir_path)
@ -463,6 +458,13 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
else:
self.dev_list.available_list.addItem( DevListWidgetItem(d[0], d[1]))
if self.dev_list.selected_list.count() > 0 and self.include_in_balancing.isChecked():
self.dmm_warning_adv.show()
self.dmm_warning_dev.show()
else:
self.dmm_warning_adv.hide()
self.dmm_warning_dev.hide()
def __apply_devices_tab__(self):
sth_changed = False
@ -487,10 +489,21 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
self.anything_changed = True
def include_in_balancing_state_changed(self, state):
self.tabWidget.setTabEnabled(self.tabs_indices["devices"], not state == QtCore.Qt.Checked)
if self.dev_list.selected_list.count() > 0:
if state == QtCore.Qt.Checked:
self.dmm_warning_adv.show()
self.dmm_warning_dev.show()
else:
self.dmm_warning_adv.hide()
self.dmm_warning_dev.hide()
def devices_selection_changed(self):
self.include_in_balancing.setEnabled(self.dev_list.selected_list.count() == 0)
if self.include_in_balancing.isChecked():
if self.dev_list.selected_list.count() > 0 :
self.dmm_warning_adv.show()
self.dmm_warning_dev.show()
else:
self.dmm_warning_adv.hide()
self.dmm_warning_dev.hide()
######## services tab
@ -516,7 +529,6 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
row = self.services_list.currentRow()
if row:
item = self.services_list.takeItem(row)
print item.text()
del self.new_srv_dict[str(item.text())]
def __apply_services_tab__(self):

View File

@ -29,7 +29,7 @@
<locale language="English" country="UnitedStates"/>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="basic_tab">
<property name="locale">
@ -411,6 +411,26 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QLabel" name="dmm_warning_adv">
<property name="font">
<font>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color:rgb(255, 0, 0)</string>
</property>
<property name="text">
<string>Dynamic memory balancing can result in some devices not working!</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -731,7 +751,25 @@
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<layout class="QVBoxLayout" name="devices_layout"/>
<layout class="QVBoxLayout" name="devices_layout">
<item>
<widget class="QLabel" name="dmm_warning_dev">
<property name="font">
<font>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string>You've enabled dynamic memory balancing, some devices might not work!</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>