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

cpu: Fix vendor for recent CPU models

Recent CPU models were specified using invalid vendor element
<vendor>NAME</vendor>, which was silently ignored due to a bug in the
code which was parsing it.
上级 677b7cf9
......@@ -355,7 +355,7 @@
</model>
<model name='Conroe'>
<vendor>Intel</vendor>
<vendor name='Intel'/>
<feature name='sse2'/>
<feature name='sse'/>
<feature name='fxsr'/>
......@@ -386,7 +386,7 @@
</model>
<model name='Penryn'>
<vendor>Intel</vendor>
<vendor name='Intel'/>
<feature name='sse2'/>
<feature name='sse'/>
<feature name='fxsr'/>
......@@ -419,7 +419,7 @@
</model>
<model name='Nehalem'>
<vendor>Intel</vendor>
<vendor name='Intel'/>
<feature name='sse2'/>
<feature name='sse'/>
<feature name='fxsr'/>
......@@ -454,7 +454,7 @@
</model>
<model name='Opteron_G1'>
<vendor>AMD</vendor>
<vendor name='AMD'/>
<feature name='sse2'/>
<feature name='sse'/>
<feature name='fxsr'/>
......@@ -483,7 +483,7 @@
</model>
<model name='Opteron_G2'>
<vendor>AMD</vendor>
<vendor name='AMD'/>
<feature name='sse2'/>
<feature name='sse'/>
<feature name='fxsr'/>
......@@ -516,7 +516,7 @@
</model>
<model name='Opteron_G3'>
<vendor>AMD</vendor>
<vendor name='AMD'/>
<feature name='sse2'/>
<feature name='sse'/>
<feature name='fxsr'/>
......
......@@ -1015,8 +1015,15 @@ x86ModelLoad(xmlXPathContextPtr ctxt,
sizeof(*model->cpuid) * model->ncpuid);
}
vendor = virXPathString("string(./vendor/@name)", ctxt);
if (vendor) {
if (virXPathBoolean("boolean(./vendor)", ctxt)) {
vendor = virXPathString("string(./vendor/@name)", ctxt);
if (!vendor) {
virCPUReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid vendor element in CPU model %s"),
model->name);
goto ignore;
}
if (!(model->vendor = x86VendorFind(map, vendor))) {
virCPUReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown vendor %s referenced by CPU model %s"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册