qemu: Use pvpanic by default on aarch64

pvpanic-pci is the only reasonable implementation of a panic
device for aarch64/virt guests. Right now we're asking users to
provide the model name manually, but we can be more helpful and
fill it in automatically instead.

With this change, the aarch64-panic-no-model test no longer
fails and so it's no longer useful to us. Instead, we can amend
the aarch64-virt-default-models test case to include panic
coverage, something that until now wasn't possible.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2024-08-27 16:19:53 +02:00
parent 6d92185a49
commit ad92468924
9 changed files with 12 additions and 16 deletions

View File

@ -4162,6 +4162,9 @@ qemuDomainDefaultPanicModel(const virDomainDef *def)
if (ARCH_IS_X86(def->os.arch))
return VIR_DOMAIN_PANIC_MODEL_ISA;
if (qemuDomainIsARMVirt(def))
return VIR_DOMAIN_PANIC_MODEL_PVPANIC;
return VIR_DOMAIN_PANIC_MODEL_DEFAULT;
}

View File

@ -1 +0,0 @@
unsupported configuration: no panic model provided, and no default for the architecture and machine type

View File

@ -1,13 +0,0 @@
<domain type='qemu'>
<name>guest</name>
<uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
<memory>4194304</memory>
<vcpu>4</vcpu>
<os>
<type arch='aarch64' machine='virt'>hvm</type>
</os>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
<panic/>
</devices>
</domain>

View File

@ -44,4 +44,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-audiodev '{"id":"audio1","driver":"none"}' \
-device '{"driver":"virtio-gpu-pci","id":"video0","max_outputs":1,"bus":"pci.5","addr":"0x0"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-device '{"driver":"pvpanic-pci","bus":"pcie.0","addr":"0x2"}' \
-msg timestamp=on

View File

@ -78,5 +78,8 @@
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</video>
<memballoon model='none'/>
<panic model='pvpanic'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</panic>
</devices>
</domain>

View File

@ -44,4 +44,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-audiodev '{"id":"audio1","driver":"none"}' \
-device '{"driver":"virtio-gpu-pci","id":"video0","max_outputs":1,"bus":"pci.5","addr":"0x0"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-device '{"driver":"pvpanic-pci","bus":"pcie.0","addr":"0x2"}' \
-msg timestamp=on

View File

@ -78,5 +78,8 @@
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</video>
<memballoon model='none'/>
<panic model='pvpanic'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</panic>
</devices>
</domain>

View File

@ -19,6 +19,6 @@
</tpm>
<video/>
<memballoon model='none'/>
<!-- No default model for <panic/> on aarch64 -->
<panic/>
</devices>
</domain>

View File

@ -2648,7 +2648,6 @@ mymain(void)
DO_TEST_CAPS_LATEST("panic");
DO_TEST_CAPS_LATEST("panic-double");
DO_TEST_CAPS_LATEST("panic-no-address");
DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("aarch64-panic-no-model", "aarch64");
DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("riscv64-panic-no-model", "riscv64");
DO_TEST_CAPS_LATEST("pvpanic-pci-x86_64");