From 7388d055d4d77d7bb4d603fa0208fcde176f91c1 Mon Sep 17 00:00:00 2001 From: Nitesh Konkar Date: Mon, 18 Sep 2017 22:27:52 +0530 Subject: [PATCH] cpu_ppc64: Error out when model tag missing in virsh cpu-compare xml libvirtd throws unhandled signal 11 on ppc while running virsh cpu-compare with missing model tag in the xml. This patch errors out in such situation. Signed-off-by: Nitesh Konkar Signed-off-by: Jiri Denemark --- src/cpu/cpu_ppc64.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index b58e80a647..5c5fc0fec6 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -247,6 +247,12 @@ ppc64ModelFromCPU(const virCPUDef *cpu, { struct ppc64_model *model; + if (!cpu->model) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("no CPU model specified")); + return NULL; + } + if (!(model = ppc64ModelFind(map, cpu->model))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown CPU model %s"), cpu->model);