render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Pablo Greco 40546a
From be1b7ab3f5a634de17359376d559d5c312f5623f Mon Sep 17 00:00:00 2001
Pablo Greco 40546a
Message-Id: <be1b7ab3f5a634de17359376d559d5c312f5623f@dist-git>
Pablo Greco 40546a
From: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Date: Fri, 21 Jun 2019 09:25:35 +0200
Pablo Greco 40546a
Subject: [PATCH] cpu_x86: Make x86cpuidAndBits more general
Pablo Greco 40546a
MIME-Version: 1.0
Pablo Greco 40546a
Content-Type: text/plain; charset=UTF-8
Pablo Greco 40546a
Content-Transfer-Encoding: 8bit
Pablo Greco 40546a
Pablo Greco 40546a
The function now works on virCPUx86DataItem and it's renamed as
Pablo Greco 40546a
virCPUx86DataItemAndBits.
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
(cherry picked from commit da1efddfa6606520fb5f16622bc522b231484b54)
Pablo Greco 40546a
Pablo Greco 40546a
https://bugzilla.redhat.com/show_bug.cgi?id=1697627
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Message-Id: <c265f1fcb4ab52f884dd9481a426978efa60b8c8.1561068591.git.jdenemar@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
---
Pablo Greco 40546a
 src/cpu/cpu_x86.c | 14 +++++++-------
Pablo Greco 40546a
 1 file changed, 7 insertions(+), 7 deletions(-)
Pablo Greco 40546a
Pablo Greco 40546a
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
Pablo Greco 40546a
index 5fbf0294bb..54da9a985c 100644
Pablo Greco 40546a
--- a/src/cpu/cpu_x86.c
Pablo Greco 40546a
+++ b/src/cpu/cpu_x86.c
Pablo Greco 40546a
@@ -242,16 +242,16 @@ virCPUx86DataItemClearBits(virCPUx86DataItemPtr item,
Pablo Greco 40546a
 
Pablo Greco 40546a
 
Pablo Greco 40546a
 static void
Pablo Greco 40546a
-x86cpuidAndBits(virCPUx86CPUID *cpuid,
Pablo Greco 40546a
-                const virCPUx86CPUID *mask)
Pablo Greco 40546a
+virCPUx86DataItemAndBits(virCPUx86DataItemPtr item,
Pablo Greco 40546a
+                         const virCPUx86DataItem *mask)
Pablo Greco 40546a
 {
Pablo Greco 40546a
     if (!mask)
Pablo Greco 40546a
         return;
Pablo Greco 40546a
 
Pablo Greco 40546a
-    cpuid->eax &= mask->eax;
Pablo Greco 40546a
-    cpuid->ebx &= mask->ebx;
Pablo Greco 40546a
-    cpuid->ecx &= mask->ecx;
Pablo Greco 40546a
-    cpuid->edx &= mask->edx;
Pablo Greco 40546a
+    item->cpuid.eax &= mask->cpuid.eax;
Pablo Greco 40546a
+    item->cpuid.ebx &= mask->cpuid.ebx;
Pablo Greco 40546a
+    item->cpuid.ecx &= mask->cpuid.ecx;
Pablo Greco 40546a
+    item->cpuid.edx &= mask->cpuid.edx;
Pablo Greco 40546a
 }
Pablo Greco 40546a
 
Pablo Greco 40546a
 
Pablo Greco 40546a
@@ -447,7 +447,7 @@ x86DataIntersect(virCPUx86Data *data1,
Pablo Greco 40546a
     while ((item1 = virCPUx86DataNext(&iter))) {
Pablo Greco 40546a
         item2 = virCPUx86DataGet(data2, item1);
Pablo Greco 40546a
         if (item2)
Pablo Greco 40546a
-            x86cpuidAndBits(&item1->cpuid, &item2->cpuid);
Pablo Greco 40546a
+            virCPUx86DataItemAndBits(item1, item2);
Pablo Greco 40546a
         else
Pablo Greco 40546a
             virCPUx86DataItemClearBits(item1, item1);
Pablo Greco 40546a
     }
Pablo Greco 40546a
-- 
Pablo Greco 40546a
2.22.0
Pablo Greco 40546a