mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
virCPUx86DataIsIdentical: Add debug output
Without this it's impossible to debug scenarios when this function returns a mismatch but the formatted data looks identical. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
9223ebbc85
commit
210a195394
@ -3309,14 +3309,20 @@ virCPUx86DataIsIdentical(const virCPUData *a,
|
||||
if (!a || !b)
|
||||
return VIR_CPU_COMPARE_ERROR;
|
||||
|
||||
if (a->arch != b->arch)
|
||||
if (a->arch != b->arch) {
|
||||
VIR_DEBUG("incompatible architecture a:%u b:%u", a->arch, b->arch);
|
||||
return VIR_CPU_COMPARE_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
if (!((adata = &a->data.x86) && (bdata = &b->data.x86)))
|
||||
if (!((adata = &a->data.x86) && (bdata = &b->data.x86))) {
|
||||
VIR_DEBUG("missing x86 data: a:%p b:%p", adata, bdata);
|
||||
return VIR_CPU_COMPARE_ERROR;
|
||||
}
|
||||
|
||||
if (adata->len != bdata->len)
|
||||
if (adata->len != bdata->len) {
|
||||
VIR_DEBUG("unequal length a:%zu b:%zu", adata->len, bdata->len);
|
||||
return VIR_CPU_COMPARE_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
for (i = 0; i < adata->len; ++i) {
|
||||
bool found = false;
|
||||
@ -3330,9 +3336,11 @@ virCPUx86DataIsIdentical(const virCPUData *a,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
if (!found) {
|
||||
VIR_DEBUG("mismatched data");
|
||||
return VIR_CPU_COMPARE_INCOMPATIBLE;
|
||||
}
|
||||
}
|
||||
|
||||
return VIR_CPU_COMPARE_IDENTICAL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user