cpu_x86: Propagate vendor to guest's virCPUData

When computing CPU data for a given guest CPU we should set CPUID vendor
bits appropriately so that we don't lose the vendor when transforming
CPU data back to XML description.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2016-06-01 10:55:36 +02:00
parent b1f6792cb6
commit fc4ee3e674
2 changed files with 6 additions and 0 deletions

View File

@ -1488,6 +1488,11 @@ x86Compute(virCPUDefPtr host,
if (!(guest_model = x86ModelCopy(host_model)))
goto error;
if (cpu->vendor &&
virCPUx86DataAddCPUID(guest_model->data,
&host_model->vendor->cpuid) < 0)
goto error;
if (cpu->type == VIR_CPU_TYPE_GUEST
&& cpu->match == VIR_CPU_MATCH_EXACT)
x86DataSubtract(guest_model->data, diff->data);

View File

@ -1,6 +1,7 @@
<cpu mode='custom' match='exact'>
<arch>x86_64</arch>
<model fallback='allow'>core2duo</model>
<vendor>Intel</vendor>
<feature policy='require' name='ds'/>
<feature policy='require' name='acpi'/>
<feature policy='require' name='ss'/>