cpu_x86: Make x86cpuidSetBits more general

The function is renamed as virCPUx86DataItemSetBits and it works on
virCPUx86DataItem now.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jiri Denemark 2019-03-15 18:52:47 +01:00
parent 559ccd7815
commit 9c6f00fc33

View File

@ -216,16 +216,16 @@ x86cpuidMatchMasked(const virCPUx86CPUID *cpuid,
static void static void
x86cpuidSetBits(virCPUx86CPUID *cpuid, virCPUx86DataItemSetBits(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;
} }
@ -393,7 +393,7 @@ virCPUx86DataAddItem(virCPUx86Data *data,
virCPUx86DataItemPtr existing; virCPUx86DataItemPtr existing;
if ((existing = virCPUx86DataGet(data, item))) { if ((existing = virCPUx86DataGet(data, item))) {
x86cpuidSetBits(&existing->cpuid, &item->cpuid); virCPUx86DataItemSetBits(existing, item);
} else { } else {
if (VIR_APPEND_ELEMENT_COPY(data->items, data->len, if (VIR_APPEND_ELEMENT_COPY(data->items, data->len,
*((virCPUx86DataItemPtr)item)) < 0) *((virCPUx86DataItemPtr)item)) < 0)