]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Avoid probing non-native binaries all the time
authorAndrea Bolognani <abologna@redhat.com>
Mon, 17 Sep 2018 10:23:43 +0000 (12:23 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 17 Sep 2018 12:52:38 +0000 (14:52 +0200)
A side effect of recent changes is that we would always try
to regenerate the capabilities cache for non-native QEMU
binaries based on /dev/kvm availability, which is of course
complete nonsense. Make sure that doesn't happen.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_capabilities.c

index 469f0283f5a7b0e9a250578de914e59a08079ff8..b1825534c9519b2ed4779703dedb7957d2d6774d 100644 (file)
@@ -3932,6 +3932,14 @@ virQEMUCapsIsValid(void *data,
         return false;
     }
 
+    if (!virQEMUCapsGuestIsNative(priv->hostArch, qemuCaps->arch)) {
+        VIR_DEBUG("Guest arch (%s) is not native to host arch (%s), "
+                  "skipping KVM-related checks",
+                  virArchToString(qemuCaps->arch),
+                  virArchToString(priv->hostArch));
+        return true;
+    }
+
     kvmUsable = virFileAccessibleAs("/dev/kvm", R_OK | W_OK,
                                     priv->runUid, priv->runGid) == 0;