diff --git a/data/org.virt-manager.virt-manager.gschema.xml b/data/org.virt-manager.virt-manager.gschema.xml index 81b2ee46a..d4ed2973c 100644 --- a/data/org.virt-manager.virt-manager.gschema.xml +++ b/data/org.virt-manager.virt-manager.gschema.xml @@ -262,7 +262,7 @@ 'default' CPU setting to use for new VMs - CPU setting to use for new VMs. Limited to VMs matching the host architecture. Possible values: default (virt-manager default), hv-default (qemu's default), host-model-only (just the model, not the additional features), host-model (libvirt's host-model setting). + CPU setting to use for new VMs. Limited to VMs matching the host architecture. Possible values: default (virt-manager default), hv-default (qemu's default), host-model-only (just the model, not the additional features), host-model (libvirt's host-model setting), host-passthrough (libvirt's host-passthrough setting). diff --git a/tests/uitests/test_details.py b/tests/uitests/test_details.py index c084e1eb4..0090697d6 100644 --- a/tests/uitests/test_details.py +++ b/tests/uitests/test_details.py @@ -219,6 +219,9 @@ def testDetailsEditDomain1(app): tab.find("Hypervisor Default", "menu item").click() appl.click() lib.utils.check(lambda: not appl.sensitive) + tab.find("cpu-model").find(None, "text").text = "foobar" + appl.click() + lib.utils.check(lambda: not appl.sensitive) tab.find("cpu-model").find(None, "text").text = "host-passthrough" appl.click() lib.utils.check(lambda: not appl.sensitive) diff --git a/tests/uitests/test_prefs.py b/tests/uitests/test_prefs.py index cf35d4f19..25c9bdafe 100644 --- a/tests/uitests/test_prefs.py +++ b/tests/uitests/test_prefs.py @@ -40,7 +40,7 @@ def testPrefsAll(app): win.find("New VM", "page tab").click() tab = newvmtab tab.check_onscreen() - tab.combo_select("CPU default:", "Copy host") + tab.combo_select("CPU default:", "host-passthrough") tab.combo_select("Storage format:", "Raw") tab.combo_select("Graphics type", "VNC") diff --git a/virtManager/details/details.py b/virtManager/details/details.py index 263267115..6ca890e21 100644 --- a/virtManager/details/details.py +++ b/virtManager/details/details.py @@ -799,12 +799,16 @@ class vmmDetails(vmmGObjectUI): cpu_model.set_entry_text_column(0) cpu_model.set_row_separator_func(sep_func, None) model.set_sort_column_id(1, Gtk.SortType.ASCENDING) - model.append([_("Application Default"), "1", + model.append([_("Application Default"), "01", virtinst.DomainCpu.SPECIAL_MODE_APP_DEFAULT, False]) - model.append([_("Hypervisor Default"), "2", + model.append([_("Hypervisor Default"), "02", virtinst.DomainCpu.SPECIAL_MODE_HV_DEFAULT, False]) - model.append([_("Clear CPU configuration"), "3", + model.append([_("Clear CPU configuration"), "03", virtinst.DomainCpu.SPECIAL_MODE_CLEAR, False]) + model.append(["host-model", "04", + virtinst.DomainCpu.SPECIAL_MODE_HOST_MODEL, False]) + model.append(["host-passthrough", "05", + virtinst.DomainCpu.SPECIAL_MODE_HOST_PASSTHROUGH, False]) model.append([None, None, None, True]) for name in domcaps.get_cpu_models(): model.append([name, name, name, False]) diff --git a/virtManager/preferences.py b/virtManager/preferences.py index 39bdabc23..a2798b7e1 100644 --- a/virtManager/preferences.py +++ b/virtManager/preferences.py @@ -169,8 +169,8 @@ class vmmPreferences(vmmGObjectUI): [DomainCpu.SPECIAL_MODE_HV_DEFAULT, _("Hypervisor default")], [DomainCpu.SPECIAL_MODE_HOST_MODEL_ONLY, _("Nearest host CPU model")], - [DomainCpu.SPECIAL_MODE_HOST_MODEL, - _("Copy host CPU definition")]]: + [DomainCpu.SPECIAL_MODE_HOST_MODEL, "host-model"], + [DomainCpu.SPECIAL_MODE_HOST_PASSTHROUGH, "host-passthrough"]]: model.append(row) combo.set_model(model) uiutil.init_combo_text_column(combo, 1)