0a7476
From 1172018ff6df4618a02fd05a46d33dbdb06131bf Mon Sep 17 00:00:00 2001
0a7476
Message-Id: <1172018ff6df4618a02fd05a46d33dbdb06131bf@dist-git>
0a7476
From: Andrea Bolognani <abologna@redhat.com>
0a7476
Date: Fri, 5 Apr 2019 10:57:41 +0200
0a7476
Subject: [PATCH] qemu: Avoid probing non-native binaries all the time
0a7476
0a7476
A side effect of recent changes is that we would always try
0a7476
to regenerate the capabilities cache for non-native QEMU
0a7476
binaries based on /dev/kvm availability, which is of course
0a7476
complete nonsense. Make sure that doesn't happen.
0a7476
0a7476
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
0a7476
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
0a7476
(cherry picked from commit 55e5eb94788be06dd366de4987523bbc731672db)
0a7476
0a7476
https://bugzilla.redhat.com/show_bug.cgi?id=1628469
0a7476
0a7476
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
0a7476
Message-Id: <20190405085744.8179-5-abologna@redhat.com>
0a7476
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
0a7476
---
0a7476
 src/qemu/qemu_capabilities.c | 8 ++++++++
0a7476
 1 file changed, 8 insertions(+)
0a7476
0a7476
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
0a7476
index c31c991a6f..ca044564e5 100644
0a7476
--- a/src/qemu/qemu_capabilities.c
0a7476
+++ b/src/qemu/qemu_capabilities.c
0a7476
@@ -3906,6 +3906,14 @@ virQEMUCapsIsValid(void *data,
0a7476
         return false;
0a7476
     }
0a7476
 
0a7476
+    if (!virQEMUCapsGuestIsNative(priv->hostArch, qemuCaps->arch)) {
0a7476
+        VIR_DEBUG("Guest arch (%s) is not native to host arch (%s), "
0a7476
+                  "skipping KVM-related checks",
0a7476
+                  virArchToString(qemuCaps->arch),
0a7476
+                  virArchToString(priv->hostArch));
0a7476
+        return true;
0a7476
+    }
0a7476
+
0a7476
     kvmUsable = virFileAccessibleAs("/dev/kvm", R_OK | W_OK,
0a7476
                                     priv->runUid, priv->runGid) == 0;
0a7476
 
0a7476
-- 
0a7476
2.21.0
0a7476