devices: panic: let libvirt fill in model default

Currently `--panic default` for aarch64 doesn't even request
a `<panic/>` device due to quirky xmlbuilder behavior. Fix that,
but more generally just leave model empty and let libvirt fill it
in for us.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2024-11-12 09:44:37 -05:00
parent afa8231525
commit ebeb80073e
4 changed files with 7 additions and 4 deletions

View File

@ -64,5 +64,6 @@
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
</rng>
<panic model="pvpanic"/>
</devices>
</domain>

View File

@ -941,7 +941,7 @@
</backend>
<rate bytes="1234" period="1000"/>
</rng>
<panic model="isa">
<panic>
<address type="isa" iobase="0x500" irq="5"/>
</panic>
<shmem name="shmem0" role="master">

View File

@ -91,7 +91,7 @@
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
</rng>
<panic model="isa"/>
<panic/>
<vsock model="virtio">
<cid auto="yes"/>
</vsock>
@ -191,7 +191,7 @@
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
</rng>
<panic model="isa"/>
<panic/>
<vsock model="virtio">
<cid auto="yes"/>
</vsock>

View File

@ -18,6 +18,7 @@ class DevicePanic(Device):
MODEL_S390 = "s390"
model = XMLProperty("./@model")
set_stub = XMLProperty(".", is_bool=True)
##################
@ -46,4 +47,5 @@ class DevicePanic(Device):
if not self.address.type and self.address.iobase:
self.address.type = "isa"
if not self.model:
self.model = DevicePanic.get_default_model(guest)
# This asks libvirt to fill in a default
self.set_stub = True