2014-01-10 03:37:54 -06:00
|
|
|
#
|
|
|
|
# Copyright 2013 Fujitsu Limited.
|
|
|
|
# Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
|
|
|
|
#
|
2018-04-04 08:35:41 -05:00
|
|
|
# This work is licensed under the GNU GPLv2 or later.
|
2018-03-20 14:00:02 -05:00
|
|
|
# See the COPYING file in the top-level directory.
|
2014-01-10 03:37:54 -06:00
|
|
|
|
2018-03-20 11:18:35 -05:00
|
|
|
from .device import Device
|
2018-03-20 11:27:37 -05:00
|
|
|
from ..xmlbuilder import XMLProperty
|
2014-01-10 03:37:54 -06:00
|
|
|
|
|
|
|
|
2018-03-20 11:18:35 -05:00
|
|
|
class DevicePanic(Device):
|
2018-03-21 09:53:34 -05:00
|
|
|
XML_NAME = "panic"
|
2017-09-04 11:40:34 -05:00
|
|
|
|
2019-06-09 14:29:44 -05:00
|
|
|
model = XMLProperty("./@model")
|
2024-11-12 08:44:37 -06:00
|
|
|
set_stub = XMLProperty(".", is_bool=True)
|
2019-06-09 14:29:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
##################
|
|
|
|
# Default config #
|
|
|
|
##################
|
2014-01-10 03:37:54 -06:00
|
|
|
|
2018-09-01 14:58:26 -05:00
|
|
|
def set_defaults(self, guest):
|
2019-05-12 08:18:36 -05:00
|
|
|
if not self.address.type and self.address.iobase:
|
|
|
|
self.address.type = "isa"
|
2018-09-01 14:58:26 -05:00
|
|
|
if not self.model:
|
2024-11-12 08:44:37 -06:00
|
|
|
# This asks libvirt to fill in a default
|
|
|
|
self.set_stub = True
|