
On 05.08.2016 23:38, Jim Fehlig wrote:
<snip/> With vendor = 0x0, &host_model->vendor->cpuid evaluates to 8, which is not a nice value to pass to virCPUx86DataAddCPUID(). Check for a non-null host_model->vendor before calling virCPUx86DataAddCPUID().
Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/cpu/cpu_x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index d9646eb..09eaaa2 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1576,7 +1576,7 @@ x86Compute(virCPUDefPtr host, if (!(guest_model = x86ModelCopy(host_model))) goto error;
- if (cpu->vendor && + if (cpu->vendor && host_model->vendor && virCPUx86DataAddCPUID(&guest_model->data, &host_model->vendor->cpuid) < 0) goto error;
Looks reasonable to me. If there's no host vendor, we shouldn't add the CPU to our database. ACK if you write some sensible commit message to your patch. Michal