addhardware: panic: Fill in model combo with advertised values by libvirt

The commit c5a46646 asks libvirt to fill in a default panic model for us.
Now libvirt domcaps can advertise panic models, Let's fill in the panic
model combo with the advertised values.

Signed-off-by: Lin Ma <lma@suse.de>
This commit is contained in:
Lin Ma 2024-12-03 18:46:28 +08:00 committed by Pavel Hrdina
parent f9ceec2b14
commit f92c25749b

View File

@ -860,8 +860,13 @@ class vmmAddHardware(vmmGObjectUI):
def _build_panic_model_combo(self):
guest = self.vm.get_xmlobj()
values = [[None, _("Hypervisor default")]]
for m in guest.lookup_domcaps().supported_panic_models():
values.append([m, m])
uiutil.build_simple_combo(self.widget("panic-model"), values)
uiutil.set_list_selection(self.widget("panic-model"), None)
def _build_controller_type_combo(self):