diff --git a/ui/details.ui b/ui/details.ui index bc1473ee6..2ed42ef72 100644 --- a/ui/details.ui +++ b/ui/details.ui @@ -4667,114 +4667,121 @@ if you know what you are doing.</small> 0 none - + True False - 3 - 12 + 12 + 3 + 6 + 6 - + True False - 2 - 8 - 4 - - - True - False - label - True - 0 + M_odel: + True + combobox-entry13 + 1 + + + 0 + 0 + + + + + True + False + True + + + + True - - 1 - 2 - 2 - 3 - GTK_FILL - - - - - - True - False - label - True - 0 - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - - True - False - RAM: - 1 - - - 1 - 2 - GTK_FILL - - - - - - True - False - M_odel: - True - combobox-entry13 - 1 - - - GTK_FILL - - - - - - True - False - Heads: - 1 - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - False - True - - - - True - - - - - 1 - 2 - GTK_FILL - GTK_FILL - + + 1 + 0 + + + + + True + False + RAM: + 1 + + + 0 + 1 + + + + + True + False + label + True + 0 + + + 1 + 1 + + + + + True + False + Heads: + 1 + + + 0 + 2 + + + + + True + False + label + True + 0 + + + 1 + 2 + + + + + True + False + 3D acceleration: + 1 + + + 0 + 3 + + + + + True + True + False + True + + + + + + + 1 + 3 + diff --git a/virtManager/details.py b/virtManager/details.py index 5fb11afdc..d6fef9676 100644 --- a/virtManager/details.py +++ b/virtManager/details.py @@ -95,6 +95,7 @@ EDIT_GFX_OPENGL, EDIT_GFX_RENDERNODE, EDIT_VIDEO_MODEL, +EDIT_VIDEO_3D, EDIT_WATCHDOG_MODEL, EDIT_WATCHDOG_ACTION, @@ -107,7 +108,7 @@ EDIT_FS, EDIT_HOSTDEV_ROMBAR, -) = range(1, 48) +) = range(1, 49) # Columns in hw list model @@ -543,8 +544,8 @@ class vmmDetails(vmmGObjectUI): "on_sound_model_combo_changed": lambda *x: self.enable_apply(x, EDIT_SOUND_MODEL), - "on_video_model_combo_changed": lambda *x: self.enable_apply(x, - EDIT_VIDEO_MODEL), + "on_video_model_combo_changed": self.video_model_changed, + "on_video_3d_toggled": self.video_3d_toggled, "on_watchdog_model_combo_changed": lambda *x: self.enable_apply(x, EDIT_WATCHDOG_MODEL), @@ -1740,6 +1741,16 @@ class vmmDetails(vmmGObjectUI): self.widget("cpu-topology-table").set_sensitive(do_enable) self.config_cpu_topology_changed() + def video_model_changed(self, ignore): + model = uiutil.get_list_selection(self.widget("video-model")) + uiutil.set_grid_row_visible( + self.widget("video-3d"), model == "virtio") + self.enable_apply(EDIT_VIDEO_MODEL) + + def video_3d_toggled(self, ignore): + self.widget("video-3d").set_inconsistent(False) + self.enable_apply(EDIT_VIDEO_3D) + # Boot device / Autostart def config_bootdev_selected(self, ignore=None): boot_row = self.get_boot_selection() @@ -2202,6 +2213,9 @@ class vmmDetails(vmmGObjectUI): if model: kwargs["model"] = model + if self.edited(EDIT_VIDEO_3D): + kwargs["accel3d"] = self.widget("video-3d").get_active() + return vmmAddHardware.change_config_helper(self.vm.define_video, kwargs, self.vm, self.err, devobj=devobj) @@ -2968,6 +2982,11 @@ class vmmDetails(vmmGObjectUI): uiutil.set_list_selection(self.widget("video-model"), model) + if vid.accel3d is None: + self.widget("video-3d").set_inconsistent(True) + else: + self.widget("video-3d").set_active(vid.accel3d) + def refresh_watchdog_page(self): watch = self.get_hw_selection(HW_LIST_COL_DEVICE) if not watch: diff --git a/virtManager/domain.py b/virtManager/domain.py index 585808610..5b412b9ba 100644 --- a/virtManager/domain.py +++ b/virtManager/domain.py @@ -876,7 +876,7 @@ class vmmDomain(vmmLibvirtObject): else: self._redefine_xmlobj(xmlobj) - def define_video(self, devobj, do_hotplug, model=_SENTINEL): + def define_video(self, devobj, do_hotplug, model=_SENTINEL, accel3d=_SENTINEL): xmlobj = self._make_xmlobj_to_define() editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug) if not editdev: @@ -893,6 +893,10 @@ class vmmDomain(vmmLibvirtObject): editdev.heads = None editdev.ram = None editdev.vgamem = None + editdev.accel3d = None + + if accel3d != _SENTINEL: + editdev.accel3d = accel3d if do_hotplug: self.hotplug(device=editdev)