mirror of https://gitee.com/openkylin/libvirt.git
cpu_x86: Make x86cpuidAndBits more general
The function now works on virCPUx86DataItem and it's renamed as virCPUx86DataItemAndBits. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
4e3cab2d00
commit
da1efddfa6
|
@ -244,16 +244,16 @@ virCPUx86DataItemClearBits(virCPUx86DataItemPtr item,
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
x86cpuidAndBits(virCPUx86CPUID *cpuid,
|
virCPUx86DataItemAndBits(virCPUx86DataItemPtr item,
|
||||||
const virCPUx86CPUID *mask)
|
const virCPUx86DataItem *mask)
|
||||||
{
|
{
|
||||||
if (!mask)
|
if (!mask)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cpuid->eax &= mask->eax;
|
item->cpuid.eax &= mask->cpuid.eax;
|
||||||
cpuid->ebx &= mask->ebx;
|
item->cpuid.ebx &= mask->cpuid.ebx;
|
||||||
cpuid->ecx &= mask->ecx;
|
item->cpuid.ecx &= mask->cpuid.ecx;
|
||||||
cpuid->edx &= mask->edx;
|
item->cpuid.edx &= mask->cpuid.edx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ x86DataIntersect(virCPUx86Data *data1,
|
||||||
while ((item1 = virCPUx86DataNext(&iter))) {
|
while ((item1 = virCPUx86DataNext(&iter))) {
|
||||||
item2 = virCPUx86DataGet(data2, item1);
|
item2 = virCPUx86DataGet(data2, item1);
|
||||||
if (item2)
|
if (item2)
|
||||||
x86cpuidAndBits(&item1->cpuid, &item2->cpuid);
|
virCPUx86DataItemAndBits(item1, item2);
|
||||||
else
|
else
|
||||||
virCPUx86DataItemClearBits(item1, item1);
|
virCPUx86DataItemClearBits(item1, item1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue