preferences: Unconditionally add usbredir devs for spice

Remove the preference option to disable this. This was added with
the initial usbredir support because I was afraid people would
complain. They did complain, but only about the auto redir behavior
of the spice client. We still have a toggle to disable that behavior

If people don't want usbredir devices, I'm comfortable telling
them to remove them manually, or use virt-install

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-09-19 17:30:08 -04:00
parent 8ce83dbc53
commit 748639702e
6 changed files with 5 additions and 78 deletions

View File

@ -259,12 +259,6 @@
<description>Install selected graphics type for new VM. vnc or spice, system for software configured default</description>
</key>
<key name="add-spice-usbredir" type="s">
<default>'system'</default>
<summary>Add spice usbredir HW for new VMs</summary>
<description>Add spice usbredir HW for new VMs. yes, no, or system for software configured default</description>
</key>
<key name="storage-format" type="s">
<default>'default'</default>
<summary>Use selected format for new VM storage</summary>

View File

@ -43,7 +43,6 @@ def testPrefsAll(app):
tab.find("Add sound device", "check box").click()
tab.combo_select("CPU default:", "Copy host")
tab.combo_select("Storage format:", "Raw")
tab.combo_select("prefs-add-spice-usbredir", "No")
tab.combo_select("Graphics type", "VNC")
win.find("Console", "page tab").click()

View File

@ -127,6 +127,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">start</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_prefs_xmleditor_toggled" swapped="no"/>
@ -439,7 +440,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
@ -462,7 +463,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
@ -509,7 +510,7 @@ identical CPUs in order to migrate the VM.</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
@ -520,39 +521,7 @@ identical CPUs in order to migrate the VM.</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label27">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Add Spice _USB
Redirection:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">prefs-add-spice-usbredir</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="prefs-add-spice-usbredir">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<signal name="changed" handler="on_prefs_add_spice_usbredir_changed" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="prefs-add-spice-usbredir-atkobject">
<property name="AtkObject::accessible-name">prefs-add-spice-usbredir</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="top_attach">3</property>
</packing>
</child>
</object>

View File

@ -221,7 +221,6 @@ class vmmConfig(object):
self.default_storage_format_from_config = "qcow2"
self.default_console_resizeguest = 0
self.default_add_spice_usbredir = "yes"
self._objects = []
self.color_insensitive = None
@ -517,16 +516,6 @@ class vmmConfig(object):
def set_graphics_type(self, gtype):
self.conf.set("/new-vm/graphics-type", gtype.lower())
def get_add_spice_usbredir(self, raw=False):
ret = self.conf.get("/new-vm/add-spice-usbredir")
if ret not in ["system", "yes", "no"]:
ret = "system" # pragma: no cover
if ret == "system" and not raw:
return self.default_add_spice_usbredir
return ret
def set_add_spice_usbredir(self, val):
self.conf.set("/new-vm/add-spice-usbredir", val)
def get_default_storage_format(self, raw=False):
ret = self.conf.get("/new-vm/storage-format")
if ret not in ["default", "raw", "qcow2"]:

View File

@ -94,7 +94,6 @@ class _GuestData:
self.default_graphics_type = None
self.skip_default_sound = None
self.skip_default_usbredir = None
self.x86_cpu_default = None
self.disk = None
@ -1426,8 +1425,6 @@ class vmmCreateVM(vmmGObjectUI):
gdata.default_graphics_type = self.config.get_graphics_type()
gdata.skip_default_sound = not self.config.get_new_vm_sound()
gdata.skip_default_usbredir = (
self.config.get_add_spice_usbredir() == "no")
gdata.x86_cpu_default = self.config.get_default_cpu_setting()
return gdata

View File

@ -45,7 +45,6 @@ class vmmPreferences(vmmGObjectUI):
self.refresh_console_autoconnect()
self.refresh_new_vm_sound()
self.refresh_graphics_type()
self.refresh_add_spice_usbredir()
self.refresh_storage_format()
self.refresh_cpu_default()
self.refresh_cpu_poll()
@ -74,7 +73,6 @@ class vmmPreferences(vmmGObjectUI):
"on_prefs_console_autoconnect_toggled": self.change_console_autoconnect,
"on_prefs_new_vm_sound_toggled": self.change_new_vm_sound,
"on_prefs_graphics_type_changed": self.change_graphics_type,
"on_prefs_add_spice_usbredir_changed": self.change_add_spice_usbredir,
"on_prefs_storage_format_changed": self.change_storage_format,
"on_prefs_cpu_default_changed": self.change_cpu_default,
"on_prefs_stats_enable_cpu_toggled": self.change_cpu_poll,
@ -154,16 +152,6 @@ class vmmPreferences(vmmGObjectUI):
combo.set_model(model)
uiutil.init_combo_text_column(combo, 1)
combo = self.widget("prefs-add-spice-usbredir")
# [gsettings value, string]
model = Gtk.ListStore(str, str)
for row in [["system", _("System default (%s)") %
self.config.default_add_spice_usbredir],
["yes", _("Yes")], ["no", _("No")]]:
model.append(row)
combo.set_model(model)
uiutil.init_combo_text_column(combo, 1)
combo = self.widget("prefs-storage-format")
# [gsettings value, string]
model = Gtk.ListStore(str, str)
@ -243,10 +231,6 @@ class vmmPreferences(vmmGObjectUI):
combo = self.widget("prefs-graphics-type")
gtype = self.config.get_graphics_type(raw=True)
uiutil.set_list_selection(combo, gtype)
def refresh_add_spice_usbredir(self):
combo = self.widget("prefs-add-spice-usbredir")
val = self.config.get_add_spice_usbredir(raw=True)
uiutil.set_list_selection(combo, val)
def refresh_storage_format(self):
combo = self.widget("prefs-storage-format")
val = self.config.get_default_storage_format(raw=True)
@ -391,11 +375,6 @@ class vmmPreferences(vmmGObjectUI):
def change_graphics_type(self, src):
val = uiutil.get_list_selection(src)
self.config.set_graphics_type(val)
uiutil.set_grid_row_visible(
self.widget("prefs-add-spice-usbredir"),
self.config.get_graphics_type() == "spice")
def change_add_spice_usbredir(self, src):
self.config.set_add_spice_usbredir(uiutil.get_list_selection(src))
def change_storage_format(self, src):
typ = uiutil.get_list_selection(src) or "default"
self.config.set_storage_format(typ.lower())