]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Use pvpanic by default on aarch64
authorAndrea Bolognani <abologna@redhat.com>
Tue, 27 Aug 2024 14:19:53 +0000 (16:19 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 3 Sep 2024 12:08:34 +0000 (14:08 +0200)
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>
src/qemu/qemu_domain.c
tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err [deleted file]
tests/qemuxmlconfdata/aarch64-panic-no-model.xml [deleted file]
tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.args
tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.xml
tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.args
tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml
tests/qemuxmlconfdata/aarch64-virt-default-models.xml
tests/qemuxmlconftest.c

index 9d44500db0158be1570ad21eba6b79635b7aa645..ed305d9427f5cce1eb26e8bef6312b204e773057 100644 (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;
 }
 
diff --git a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err b/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err
deleted file mode 100644 (file)
index 139249b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unsupported configuration: no panic model provided, and no default for the architecture and machine type
diff --git a/tests/qemuxmlconfdata/aarch64-panic-no-model.xml b/tests/qemuxmlconfdata/aarch64-panic-no-model.xml
deleted file mode 100644 (file)
index 5207e48..0000000
+++ /dev/null
@@ -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>
index a503f45d0c231a271e672d1d26b766463f5f7277..96fb251d808492c6302e5e3964d326d0c7dd1c7b 100644 (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
index bbe1dd931dd1f0d4dc5e37bcfe17be3758747056..f27e7e15229bbf0b86d662fffbb60c225ddbde11 100644 (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>
index a503f45d0c231a271e672d1d26b766463f5f7277..96fb251d808492c6302e5e3964d326d0c7dd1c7b 100644 (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
index bbe1dd931dd1f0d4dc5e37bcfe17be3758747056..f27e7e15229bbf0b86d662fffbb60c225ddbde11 100644 (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>
index d9ad495e7560e98f7d9ce0bffb6f74dd1d20db3a..a8029d888df9d3e1d605898de50e4ee0ed2c4a76 100644 (file)
@@ -19,6 +19,6 @@
     </tpm>
     <video/>
     <memballoon model='none'/>
-    <!-- No default model for <panic/> on aarch64 -->
+    <panic/>
   </devices>
 </domain>
index e97d0e7bdc0f6cabe7354559c01ae79d279020d6..5497fb2ba1932a2f8d8638ad964e5958889eacca 100644 (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");