Blob Blame History Raw
From cd16dea68be92cb8675d0fdd329be2cceb49b580 Mon Sep 17 00:00:00 2001
Message-Id: <cd16dea68be92cb8675d0fdd329be2cceb49b580@dist-git>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 13 Sep 2017 17:26:07 +0200
Subject: [PATCH] qemu: Pass virArch * to virQEMUCapsCPUFilterFeatures

The filter only needs to know the CPU architecture. Passing
virQEMUCapsPtr as opaque is a bit overkill.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit b0b5c9c620bbd6ca806ba39a67516a2d48854132)

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_capabilities.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 6f8b1ac735..3be56462d9 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3239,9 +3239,9 @@ static bool
 virQEMUCapsCPUFilterFeatures(const char *name,
                              void *opaque)
 {
-    virQEMUCapsPtr qemuCaps = opaque;
+    virArch *arch = opaque;
 
-    if (!ARCH_IS_X86(qemuCaps->arch))
+    if (!ARCH_IS_X86(*arch))
         return true;
 
     if (STREQ(name, "cmt") ||
@@ -3453,7 +3453,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
         if (!hostCPU ||
             virCPUDefCopyModelFilter(cpu, hostCPU, true,
                                      virQEMUCapsCPUFilterFeatures,
-                                     qemuCaps) < 0)
+                                     &qemuCaps->arch) < 0)
             goto error;
     } else if (type == VIR_DOMAIN_VIRT_KVM &&
                virCPUGetHostIsSupported(qemuCaps->arch)) {
-- 
2.15.0