[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH RFC 1/4] PPC: TCG: Correct SEGV when smp_threads > 1
From: |
Sam Bobroff |
Subject: |
[Qemu-ppc] [PATCH RFC 1/4] PPC: TCG: Correct SEGV when smp_threads > 1 |
Date: |
Tue, 27 Jun 2017 10:22:26 +1000 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
QEMU currently segfaults on PPC when starting a VM with more than one
thread/core when using TCG. This is not a valid configuration but it
should present an error report rather than crashing.
This seems to have been a latent bug in spapr_cpu_core_realize_child()
recently uncovered by commit 9ed656631d73a7564dfe178ca8c48bf049098aaf.
Correct it by avoiding unparenting when there is no parent.
Signed-off-by: Sam Bobroff <address@hidden>
---
hw/ppc/spapr_cpu_core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 9fb896b407..a504765506 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -157,13 +157,14 @@ static void spapr_cpu_core_realize_child(Object *child,
Error **errp)
object_property_add_const_link(obj, ICP_PROP_CPU, child, &error_abort);
object_property_set_bool(obj, true, "realized", &local_err);
if (local_err) {
- goto error;
+ goto error_unparent;
}
return;
-error:
+error_unparent:
object_unparent(obj);
+error:
error_propagate(errp, local_err);
}
--
2.12.1.382.gc0f9c7058