]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Sometimes the default panic model doesn't exist
authorAndrea Bolognani <abologna@redhat.com>
Tue, 27 Aug 2024 14:44:31 +0000 (16:44 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 3 Sep 2024 12:07:47 +0000 (14:07 +0200)
Right now the fallback behavior is to use MODEL_ISA if we
haven't been able to find a better match, but that's not very
useful as we're still going to hit an error later, when
QEMU_CAPS_DEVICE_PANIC is not found at Validate time.

Instead of doing that, allow MODEL_DEFAULT to get all the
way to Validate and report an error upon encountering it.

The reported error changes slightly, but other than that the
set of configurations that are allowed and blocked remains
the same.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_validate.c
tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err
tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err

index 69a2db686e68653f6849de7c45aa1a756d2f3293..9d44500db0158be1570ad21eba6b79635b7aa645 100644 (file)
@@ -4159,7 +4159,10 @@ qemuDomainDefaultPanicModel(const virDomainDef *def)
     if (ARCH_IS_S390(def->os.arch))
         return VIR_DOMAIN_PANIC_MODEL_S390;
 
-    return VIR_DOMAIN_PANIC_MODEL_ISA;
+    if (ARCH_IS_X86(def->os.arch))
+        return VIR_DOMAIN_PANIC_MODEL_ISA;
+
+    return VIR_DOMAIN_PANIC_MODEL_DEFAULT;
 }
 
 
index 3c40f76c12650d83f7a69fac08832c1853a5cc1a..1954daea52549a4d3ad65965ce34cd719b3a3874 100644 (file)
@@ -1048,8 +1048,12 @@ qemuValidateDomainDefPanic(const virDomainDef *def,
             }
             break;
 
-        /* default model value was changed before in post parse */
         case VIR_DOMAIN_PANIC_MODEL_DEFAULT:
+            /* PostParse couldn't figure out a sensible default model */
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("no panic model provided, and no default for the architecture and machine type"));
+            return -1;
+
         case VIR_DOMAIN_PANIC_MODEL_LAST:
             break;
         }
index 8e3f2c194d2f212f53afa6d372a5a23e25dd74d1..139249bbc5468d86e10fcc8faf7dd01626507381 100644 (file)
@@ -1 +1 @@
-unsupported configuration: the QEMU binary does not support the ISA panic device
+unsupported configuration: no panic model provided, and no default for the architecture and machine type
index 8e3f2c194d2f212f53afa6d372a5a23e25dd74d1..139249bbc5468d86e10fcc8faf7dd01626507381 100644 (file)
@@ -1 +1 @@
-unsupported configuration: the QEMU binary does not support the ISA panic device
+unsupported configuration: no panic model provided, and no default for the architecture and machine type