virt-manager/virtinst/devices/panic.py
Cole Robinson c5a4664676 addhardware: panic: default to asking libvirt for default model
Drop our hardcoded model lists, and just ask libvirt to fill in
a model for us. Add an entry to the combo box so users can type
in a non-default value if they want one.

Long term libvirt should be providing all this info to us via
domcapabilities

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-11-12 09:55:20 -05:00

29 lines
706 B
Python

#
# Copyright 2013 Fujitsu Limited.
# Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
from .device import Device
from ..xmlbuilder import XMLProperty
class DevicePanic(Device):
XML_NAME = "panic"
model = XMLProperty("./@model")
set_stub = XMLProperty(".", is_bool=True)
##################
# Default config #
##################
def set_defaults(self, guest):
if not self.address.type and self.address.iobase:
self.address.type = "isa"
if not self.model:
# This asks libvirt to fill in a default
self.set_stub = True