mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +00:00
cpu_x86: Require <cpuid> within <feature> in CPU map
A feature with no cpuid element is invalid and it should not be silently treated as a feature with all CPUID bits set to zero. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
be46f61326
commit
dbc04114f3
@ -924,6 +924,13 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
|
|||||||
if (n < 0)
|
if (n < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (n == 0) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Missing cpuid for feature %s"),
|
||||||
|
feature->name);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
ctxt->node = nodes[i];
|
ctxt->node = nodes[i];
|
||||||
if (x86ParseCPUID(ctxt, &cpuid) < 0) {
|
if (x86ParseCPUID(ctxt, &cpuid) < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user