render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c480ed
From d32fbe55ad3ee1bbbfe2adc9ab47034c7a5cb884 Mon Sep 17 00:00:00 2001
c480ed
Message-Id: <d32fbe55ad3ee1bbbfe2adc9ab47034c7a5cb884@dist-git>
c480ed
From: Jiri Denemark <jdenemar@redhat.com>
c480ed
Date: Fri, 21 Jun 2019 09:25:33 +0200
c480ed
Subject: [PATCH] cpu_x86: Make x86cpuidSetBits more general
c480ed
MIME-Version: 1.0
c480ed
Content-Type: text/plain; charset=UTF-8
c480ed
Content-Transfer-Encoding: 8bit
c480ed
c480ed
The function is renamed as virCPUx86DataItemSetBits and it works on
c480ed
virCPUx86DataItem now.
c480ed
c480ed
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
(cherry picked from commit 9c6f00fc3351800dc8b63472e71b398c180161d8)
c480ed
c480ed
https://bugzilla.redhat.com/show_bug.cgi?id=1697627
c480ed
c480ed
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c480ed
Message-Id: <f2e1e24cb2be24ee66911f75384436c5c4513d3e.1561068591.git.jdenemar@redhat.com>
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
---
c480ed
 src/cpu/cpu_x86.c | 14 +++++++-------
c480ed
 1 file changed, 7 insertions(+), 7 deletions(-)
c480ed
c480ed
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
c480ed
index 5a09033d2a..e2951ed1b0 100644
c480ed
--- a/src/cpu/cpu_x86.c
c480ed
+++ b/src/cpu/cpu_x86.c
c480ed
@@ -214,16 +214,16 @@ x86cpuidMatchMasked(const virCPUx86CPUID *cpuid,
c480ed
 
c480ed
 
c480ed
 static void
c480ed
-x86cpuidSetBits(virCPUx86CPUID *cpuid,
c480ed
-                const virCPUx86CPUID *mask)
c480ed
+virCPUx86DataItemSetBits(virCPUx86DataItemPtr item,
c480ed
+                         const virCPUx86DataItem *mask)
c480ed
 {
c480ed
     if (!mask)
c480ed
         return;
c480ed
 
c480ed
-    cpuid->eax |= mask->eax;
c480ed
-    cpuid->ebx |= mask->ebx;
c480ed
-    cpuid->ecx |= mask->ecx;
c480ed
-    cpuid->edx |= mask->edx;
c480ed
+    item->cpuid.eax |= mask->cpuid.eax;
c480ed
+    item->cpuid.ebx |= mask->cpuid.ebx;
c480ed
+    item->cpuid.ecx |= mask->cpuid.ecx;
c480ed
+    item->cpuid.edx |= mask->cpuid.edx;
c480ed
 }
c480ed
 
c480ed
 
c480ed
@@ -391,7 +391,7 @@ virCPUx86DataAddItem(virCPUx86Data *data,
c480ed
     virCPUx86DataItemPtr existing;
c480ed
 
c480ed
     if ((existing = virCPUx86DataGet(data, item))) {
c480ed
-        x86cpuidSetBits(&existing->cpuid, &item->cpuid);
c480ed
+        virCPUx86DataItemSetBits(existing, item);
c480ed
     } else {
c480ed
         if (VIR_APPEND_ELEMENT_COPY(data->items, data->len,
c480ed
                                     *((virCPUx86DataItemPtr)item)) < 0)
c480ed
-- 
c480ed
2.22.0
c480ed