render / rpms / libvirt

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