Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:Update
libvirt
10b80165-cpu_x86-Make-x86cpuidMatch-more-genera...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 10b80165-cpu_x86-Make-x86cpuidMatch-more-general.patch of Package libvirt
commit 10b80165dba31f99306f39e348e3a6335feec5ef Author: Jiri Denemark <jdenemar@redhat.com> Date: Fri Mar 15 19:57:59 2019 +0100 cpu_x86: Make x86cpuidMatch more general The function now works on virCPUx86DataItem and it's called virCPUx86DataItemMatch. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Index: libvirt-5.1.0/src/cpu/cpu_x86.c =================================================================== --- libvirt-5.1.0.orig/src/cpu/cpu_x86.c +++ libvirt-5.1.0/src/cpu/cpu_x86.c @@ -37,8 +37,6 @@ VIR_LOG_INIT("cpu.cpu_x86"); #define VENDOR_STRING_LENGTH 12 -static const virCPUx86CPUID cpuidNull = { 0 }; - static const virArch archs[] = { VIR_ARCH_I686, VIR_ARCH_X86_64 }; typedef struct _virCPUx86Vendor virCPUx86Vendor; @@ -194,13 +192,13 @@ struct _virCPUx86DataIterator { static bool -x86cpuidMatch(const virCPUx86CPUID *cpuid1, - const virCPUx86CPUID *cpuid2) +virCPUx86DataItemMatch(const virCPUx86DataItem *item1, + const virCPUx86DataItem *item2) { - return (cpuid1->eax == cpuid2->eax && - cpuid1->ebx == cpuid2->ebx && - cpuid1->ecx == cpuid2->ecx && - cpuid1->edx == cpuid2->edx); + return (item1->cpuid.eax == item2->cpuid.eax && + item1->cpuid.ebx == item2->cpuid.ebx && + item1->cpuid.ecx == item2->cpuid.ecx && + item1->cpuid.edx == item2->cpuid.edx); } @@ -319,6 +317,7 @@ static virCPUx86DataItemPtr virCPUx86DataNext(virCPUx86DataIteratorPtr iterator) { const virCPUx86Data *data = iterator->data; + virCPUx86DataItem zero = { 0 }; if (!data) return NULL; @@ -326,7 +325,7 @@ virCPUx86DataNext(virCPUx86DataIteratorP while (++iterator->pos < data->len) { virCPUx86DataItemPtr item = data->items + iterator->pos; - if (!x86cpuidMatch(&item->cpuid, &cpuidNull)) + if (!virCPUx86DataItemMatch(item, &zero)) return item; } @@ -1135,7 +1134,7 @@ x86ModelCompare(virCPUx86ModelPtr model1 virCPUx86CompareResult match = SUPERSET; if ((item2 = virCPUx86DataGet(&model2->data, item1))) { - if (x86cpuidMatch(&item1->cpuid, &item2->cpuid)) + if (virCPUx86DataItemMatch(item1, item2)) continue; else if (!virCPUx86DataItemMatchMasked(item1, item2)) match = SUBSET; @@ -1151,7 +1150,7 @@ x86ModelCompare(virCPUx86ModelPtr model1 virCPUx86CompareResult match = SUBSET; if ((item1 = virCPUx86DataGet(&model1->data, item2))) { - if (x86cpuidMatch(&item2->cpuid, &item1->cpuid)) + if (virCPUx86DataItemMatch(item2, item1)) continue; else if (!virCPUx86DataItemMatchMasked(item2, item1)) match = SUPERSET;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor