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 <nitkon12@linux.vnet.ibm.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Nitesh Konkar 2017-09-18 22:27:52 +05:30 committed by Jiri Denemark
parent 0248098d38
commit 7388d055d4

View File

@ -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);