qemu: Sometimes the default panic model doesn't exist

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>
This commit is contained in:
Andrea Bolognani 2024-08-27 16:44:31 +02:00
parent 9e1970efa5
commit 6d92185a49
4 changed files with 11 additions and 4 deletions

View File

@ -4159,7 +4159,10 @@ qemuDomainDefaultPanicModel(const virDomainDef *def)
if (ARCH_IS_S390(def->os.arch)) if (ARCH_IS_S390(def->os.arch))
return VIR_DOMAIN_PANIC_MODEL_S390; 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;
} }

View File

@ -1048,8 +1048,12 @@ qemuValidateDomainDefPanic(const virDomainDef *def,
} }
break; break;
/* default model value was changed before in post parse */
case VIR_DOMAIN_PANIC_MODEL_DEFAULT: 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: case VIR_DOMAIN_PANIC_MODEL_LAST:
break; break;
} }

View 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

View 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