render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From e9bc4fcd2c16a80cf564879d154f3083a6766ff9 Mon Sep 17 00:00:00 2001
Message-Id: <e9bc4fcd2c16a80cf564879d154f3083a6766ff9@dist-git>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Fri, 21 Jun 2019 09:25:34 +0200
Subject: [PATCH] cpu_x86: Make x86cpuidClearBits more general
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The parameters changed from virCPUx86CPUID to virCPUx86DataItem and the
function is now called virCPUx86DataItemClearBits.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 4e3cab2d002d5f4cfdf81359467de8ffe4e18682)

https://bugzilla.redhat.com/show_bug.cgi?id=1697627

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Message-Id: <bdc0f6c7da3674ba988c2fd83525a60df9108864.1561068591.git.jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/cpu/cpu_x86.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index e2951ed1b0..5fbf0294bb 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -228,16 +228,16 @@ virCPUx86DataItemSetBits(virCPUx86DataItemPtr item,
 
 
 static void
-x86cpuidClearBits(virCPUx86CPUID *cpuid,
-                  const virCPUx86CPUID *mask)
+virCPUx86DataItemClearBits(virCPUx86DataItemPtr item,
+                           const virCPUx86DataItem *mask)
 {
     if (!mask)
         return;
 
-    cpuid->eax &= ~mask->eax;
-    cpuid->ebx &= ~mask->ebx;
-    cpuid->ecx &= ~mask->ecx;
-    cpuid->edx &= ~mask->edx;
+    item->cpuid.eax &= ~mask->cpuid.eax;
+    item->cpuid.ebx &= ~mask->cpuid.ebx;
+    item->cpuid.ecx &= ~mask->cpuid.ecx;
+    item->cpuid.edx &= ~mask->cpuid.edx;
 }
 
 
@@ -430,8 +430,8 @@ x86DataSubtract(virCPUx86Data *data1,
     virCPUx86DataItemPtr item2;
 
     while ((item1 = virCPUx86DataNext(&iter))) {
-        if ((item2 = virCPUx86DataGet(data2, item1)))
-            x86cpuidClearBits(&item1->cpuid, &item2->cpuid);
+        item2 = virCPUx86DataGet(data2, item1);
+        virCPUx86DataItemClearBits(item1, item2);
     }
 }
 
@@ -449,7 +449,7 @@ x86DataIntersect(virCPUx86Data *data1,
         if (item2)
             x86cpuidAndBits(&item1->cpuid, &item2->cpuid);
         else
-            x86cpuidClearBits(&item1->cpuid, &item1->cpuid);
+            virCPUx86DataItemClearBits(item1, item1);
     }
 }
 
@@ -516,7 +516,7 @@ x86DataToVendor(const virCPUx86Data *data,
         virCPUx86VendorPtr vendor = map->vendors[i];
         if ((item = virCPUx86DataGet(data, &vendor->data)) &&
             x86cpuidMatchMasked(&item->cpuid, &vendor->data.cpuid)) {
-            x86cpuidClearBits(&item->cpuid, &vendor->data.cpuid);
+            virCPUx86DataItemClearBits(item, &vendor->data);
             return vendor;
         }
     }
-- 
2.22.0