From c438dadf5a2645b1f7d8d44a083751fffdb3b010 Mon Sep 17 00:00:00 2001 Message-ID: From: Andrea Bolognani Date: Tue, 27 Aug 2024 16:44:31 +0200 Subject: [PATCH] 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 Reviewed-by: Michal Privoznik (cherry picked from commit 6d92185a49f5c4107964d2d46a4aecc788646dd9) Conflicts: * tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err - missing file due to commit f22583c6c4030a9e3bb3 not having been backported https://issues.redhat.com/browse/RHEL-56451 Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 5 ++++- src/qemu/qemu_validate.c | 6 +++++- .../aarch64-panic-no-model.aarch64-latest.err | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f169aca599..84f4d26285 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4148,7 +4148,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; } diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index b392428f48..f3d512acf7 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1025,8 +1025,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; } diff --git a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err b/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err index 8e3f2c194d..139249bbc5 100644 --- a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err +++ b/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err @@ -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 -- 2.46.0