提交 f5055f23 编写于 作者: J Jiri Denemark

cpuCompare: Fix crash on unexpected CPU XML

When comparing a CPU without <model> element, such as

    <cpu>
        <topology sockets='1' cores='1' threads='1'/>
    </cpu>

libvirt would happily crash without warning.
上级 517aba9f
......@@ -90,6 +90,12 @@ cpuCompareXML(virCPUDefPtr host,
if (cpu == NULL)
goto cleanup;
if (!cpu->model) {
virCPUReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("no CPU model specified"));
goto cleanup;
}
ret = cpuCompare(host, cpu);
cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册