mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-25 23:21:45 +03:00
RHEL6: Don't allow selecting QXL if VNC graphics are configured
It ain't supported!
This commit is contained in:
parent
1f46603edf
commit
1a6e803a09
@ -2976,6 +2976,11 @@ class vmmDetails(vmmGObjectUI):
|
||||
if not vid:
|
||||
return
|
||||
|
||||
no_default = not self.is_customize_dialog
|
||||
uihelpers.populate_video_combo(self.vm,
|
||||
self.window.get_widget("video-model-combo"),
|
||||
no_default=no_default)
|
||||
|
||||
model = vid.model_type
|
||||
ram = vid.vram
|
||||
heads = vid.heads
|
||||
|
@ -132,7 +132,7 @@ def check_default_pool_active(topwin, conn):
|
||||
#####################################################
|
||||
# Hardware model list building (for details, addhw) #
|
||||
#####################################################
|
||||
def build_video_combo(vm, video_dev, no_default=False):
|
||||
def build_video_combo(vm, video_dev, no_default=None):
|
||||
video_dev_model = gtk.ListStore(str)
|
||||
video_dev.set_model(video_dev_model)
|
||||
text = gtk.CellRendererText()
|
||||
@ -140,11 +140,27 @@ def build_video_combo(vm, video_dev, no_default=False):
|
||||
video_dev.add_attribute(text, 'text', 0)
|
||||
video_dev_model.set_sort_column_id(0, gtk.SORT_ASCENDING)
|
||||
|
||||
populate_video_combo(vm, video_dev, no_default)
|
||||
|
||||
def populate_video_combo(vm, video_dev, no_default=None):
|
||||
video_dev_model = video_dev.get_model()
|
||||
has_spice = any(map(lambda g: g.type == g.TYPE_SPICE,
|
||||
vm.get_graphics_devices()))
|
||||
has_qxl = any(map(lambda v: v.model_type == "qxl",
|
||||
vm.get_video_devices()))
|
||||
|
||||
video_dev_model.clear()
|
||||
tmpdev = virtinst.VirtualVideoDevice(vm.get_connection().vmm)
|
||||
for m in tmpdev.model_types:
|
||||
if not vm.enable_unsupported_rhel_opts():
|
||||
if m == "qxl" and not has_spice and not has_qxl:
|
||||
# Only list QXL video option when VM has SPICE video
|
||||
continue
|
||||
|
||||
if m == tmpdev.MODEL_DEFAULT and no_default:
|
||||
continue
|
||||
video_dev_model.append([m])
|
||||
|
||||
if len(video_dev_model) > 0:
|
||||
video_dev.set_active(0)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user