[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 27/29] spapr: fix check of cpu alias name in spapr_get_
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 27/29] spapr: fix check of cpu alias name in spapr_get_cpu_core_type() |
Date: |
Thu, 6 Oct 2016 23:03:13 +1100 |
From: Greg Kurz <address@hidden>
If the user passes an alias name and a property to -cpu, QEMU fails to
find the CPU definition and exits.
$ qemu-system-ppc64 -cpu POWER8E,compat=power7
qemu-system-ppc64: Unable to find sPAPR CPU Core definition
This happens because spapr_get_cpu_core_type() passes the full string from
the command line (i.e. "POWER8E,compat=power7") to ppc_cpu_lookup_alias(),
instead of the alias name piece only (i.e. "POWER8E").
The fix is to pass model_pieces[0] to ppc_cpu_lookup_alias().
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Bharata B Rao <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_cpu_core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 6f0533c..35d1873 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -92,20 +92,20 @@ char *spapr_get_cpu_core_type(const char *model)
gchar **model_pieces = g_strsplit(model, ",", 2);
core_type = g_strdup_printf("%s-%s", model_pieces[0], TYPE_SPAPR_CPU_CORE);
- g_strfreev(model_pieces);
/* Check whether it exists or whether we have to look up an alias name */
if (!object_class_by_name(core_type)) {
const char *realmodel;
g_free(core_type);
- realmodel = ppc_cpu_lookup_alias(model);
+ core_type = NULL;
+ realmodel = ppc_cpu_lookup_alias(model_pieces[0]);
if (realmodel) {
- return spapr_get_cpu_core_type(realmodel);
+ core_type = spapr_get_cpu_core_type(realmodel);
}
- return NULL;
}
+ g_strfreev(model_pieces);
return core_type;
}
--
2.7.4
- [Qemu-ppc] [PULL 05/29] hw/ppc/spapr: Fix the selection of the processor features, (continued)
- [Qemu-ppc] [PULL 05/29] hw/ppc/spapr: Fix the selection of the processor features, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 01/29] spapr_vscsi: fix build error introduced by f19661c8, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 11/29] target-ppc: add lxvh8x instruction, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 21/29] target-ppc/kvm: Enable transactional memory on POWER8 with KVM-HV, too, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 19/29] MAINTAINERS: Add two more ppc related files, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 25/29] libqos: use generic qtest_shutdown(), David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 18/29] target-ppc: Implement mtvsrws instruction, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 28/29] tests/pxe: Use -nodefaults to speed up ppc64/ipv6 pxe test, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 22/29] target-ppc: fix vmx instruction type/type2, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 06/29] ppc: Check the availability of transactional memory, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 27/29] spapr: fix check of cpu alias name in spapr_get_cpu_core_type(),
David Gibson <=
- [Qemu-ppc] [PULL 29/29] hw/ppc/spapr: Use POWER8 by default for the pseries-2.8 machine, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 12/29] target-ppc: add stxvh8x instruction, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 23/29] libqos: add PPC64 PCI support, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 09/29] target-ppc: improve lxvw4x implementation, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 17/29] target-ppc: add vclzlsbb/vctzlsbb instructions, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 26/29] tests: enable ohci/uhci/xhci tests on PPC64, David Gibson, 2016/10/06
- [Qemu-ppc] [PULL 24/29] libqos: add PCI management in qtest_vboot()/qtest_shutdown(), David Gibson, 2016/10/06
- Re: [Qemu-ppc] [PULL 00/29] ppc-for-2.8 queue 20161006, Peter Maydell, 2016/10/06