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