[PATCH 3/4] qemu: Sometimes the default panic model doesn't exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 the 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 allow and block remains the same.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c                                      | 5 ++++-
 src/qemu/qemu_validate.c                                    | 6 +++++-
 .../aarch64-panic-no-model.aarch64-latest.err               | 2 +-
 .../riscv64-panic-no-model.riscv64-latest.err               | 2 +-
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e460e48fce..0cc335eb30 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -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;
 }
 
 
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index f74c538efe..43418033f6 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -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;
         }
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
diff --git a/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err b/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err
index 8e3f2c194d..139249bbc5 100644
--- a/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err
+++ b/tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux