On Wed, Jan 24, 2024 at 20:37:47 +0100, Andrea Bolognani wrote:
qemuDomainDefAddDefaultDevices() contained what is essentialy
an open-coded implementation of the helper. Get rid of it.
It would be beneficial to note here that addPanicDevice is 'true' only
for ARCH_IS_PPC64 and ARCH_IS_S390 thus this change is equivalent.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/qemu/qemu_domain.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8a37cda464..62a847d47f 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4591,12 +4591,11 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver,
if (addPanicDevice) {
size_t j;
+ int defaultPanicModel = qemuDomainDefaultPanicModel(def);
virDomainPanicModel instead of int.
+
for (j = 0; j < def->npanics; j++) {
if (def->panics[j]->model == VIR_DOMAIN_PANIC_MODEL_DEFAULT ||
- (ARCH_IS_PPC64(def->os.arch) &&
- def->panics[j]->model == VIR_DOMAIN_PANIC_MODEL_PSERIES) ||
- (ARCH_IS_S390(def->os.arch) &&
- def->panics[j]->model == VIR_DOMAIN_PANIC_MODEL_S390))
+ def->panics[j]->model == defaultPanicModel)
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>