From 41febe8f754d3b6333752f707a3ab6a38c49dc17 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Tue, 7 Aug 2018 16:08:06 +0200 Subject: [PATCH] cmds: ignore cpu feature check on QEMU The cpu_features library doesn't work well enough on QEMU so we skip the test on any QEMU branded CPU. --- src/anbox/cmds/check_features.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/anbox/cmds/check_features.cpp b/src/anbox/cmds/check_features.cpp index e4536e7..ec87f69 100644 --- a/src/anbox/cmds/check_features.cpp +++ b/src/anbox/cmds/check_features.cpp @@ -16,6 +16,7 @@ */ #include "anbox/cmds/check_features.h" +#include "anbox/utils.h" #include "cpu_features_macros.h" #include "cpuinfo_x86.h" @@ -38,9 +39,11 @@ anbox::cmds::CheckFeatures::CheckFeatures() CHECK_BOOL(info.features.sse4_2, "SSE 4.2"); CHECK_BOOL(info.features.ssse3, "SSSE 3"); - if (missing_features.size() > 0) { - char brand_string[49]; - cpu_features::FillX86BrandString(brand_string); + char brand_string[49]; + cpu_features::FillX86BrandString(brand_string); + const auto is_qemu = utils::string_starts_with(brand_string, "QEMU"); + + if (missing_features.size() > 0 && !is_qemu) { std::cerr << "The CPU of your computer (" << brand_string << ") does not support all" << std::endl << "features Anbox requires." << std::endl << "It is missing support for the following features: ";