From patchwork Thu Feb 7 18:37:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 157776 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1035305jaa; Thu, 7 Feb 2019 11:04:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IavCE0/VH9fFbS7KnHQw9cauJVLddscgovpyAijh9FIvN57MWgInVyGJKFPdNaAd7/99h1A X-Received: by 2002:a25:9c42:: with SMTP id x2mr13803711ybo.199.1549566277627; Thu, 07 Feb 2019 11:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549566277; cv=none; d=google.com; s=arc-20160816; b=baLg0XJZ1+4doOpLp5zoc2Nj8OYvU9NZe3ApR3GZHTbhOz/kEDOTknNyILIFfr/BjU bRpwvwZOxZO6Js3Ho+belmake/DkDsByFDM5XfX+A06/Ak9q5upCEUgH4UdvSxgbsnhn fxAeQ4TQl2c8Biq3+3usl8ROmRByHGXLXXmgY2aJIkoZ39P9s6WuwXaFh2PGIRfIXD9e S5d3j040CSFGWaWyEbiMA2JeNN82HYh/FB2i6aqMD8yos6ugEj+0yJCOEbiDlvjv40pW HpGHUfwwjBr1iVDCEJ2tit9QueUKyMdKA6WKj9rHgNVrQqN+nRt0XlMBnN3ExCRnTzj6 aAEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=twEAfdMN/6FjqGGiydr3gUMZzTupENw0qNrtRFI8B3w=; b=pQ5kwN7wnvzuQKSvoBt48jXysHasTaTSGY6bPSVuIrlrZcgBqasbZBJg7XRssgqyYw D4EUF9kAFi/SXwcoXQN+STj76dPyhhbGNYEc0YYy3FClpovbsFGVV087TOlKGy8fXtH0 sP4iK0baVuh4sJnvhjk6WUNcBVo4J+FeUf1W2qbZmb8qT/7YhYG76X/exnOg1CeiozWQ 5ALVEWs9oCsZgy3ypPPAxjynQR/yYUxA+v9cHQn3lK00GoWohb+2Q4Km3haNR6aQ3bJf epK9u9LABt3nlVWsSswX6/XP91M207CxWRVbjDw9/DVyxgibx+p/JIsdgP/XxNKfFirv WhAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dV+fTvdA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b21si6146852yba.451.2019.02.07.11.04.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Feb 2019 11:04:37 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dV+fTvdA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:45494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1groyT-0004d5-3n for patch@linaro.org; Thu, 07 Feb 2019 14:04:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1groYy-0000WP-7Z for qemu-devel@nongnu.org; Thu, 07 Feb 2019 13:38:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1groYt-0007nC-Sx for qemu-devel@nongnu.org; Thu, 07 Feb 2019 13:38:13 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:55748) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1groYr-0007Yf-Rz for qemu-devel@nongnu.org; Thu, 07 Feb 2019 13:38:11 -0500 Received: by mail-wm1-x344.google.com with SMTP id r17so917409wmh.5 for ; Thu, 07 Feb 2019 10:38:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=twEAfdMN/6FjqGGiydr3gUMZzTupENw0qNrtRFI8B3w=; b=dV+fTvdAHXLT+WgMOu4QFBFGF+lghAOVxgnknPgKb96Y09+opDxH+69dseI/I8ztbM aXCulkIh1krTnOeDaMtg1SDmXmI1kmiitA8QJ+8hk8YjYCHNppAB76FFa64MBRu5D2WB DWeMbXN3nZdD6RuEIW+G97vhVBEKbloEdzuUfxxt5U7Ihf+offeYNbRL4EOpXm3cpeMa mEQR4DtYfnKlGx56r0KoQ9Z7BbawUtlluaDnn6d3XbcnkYIC+XxF1D6DUvwdkMQRuEYB YorG6m21kh1ior4s/5wI/lbN7CoT8xYV8w9IrdQq33JRBjDlY7TT7yrE5QoeXzkNDeZe uuAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=twEAfdMN/6FjqGGiydr3gUMZzTupENw0qNrtRFI8B3w=; b=eJ+t7Q3MBTMpR+CxHGmdX6FqKTE5NmUsG5i+VaaNgI1FLms76sxCWPhfoEGp5F24JX Qne0yfXL7essFp45G5NMTPrmX3+BZGEtufbZM6TTPB1rnM3+CSRz4Dou5rK6Hxr1gkuu gW/0+uQHQ6JdFXNgXT18KgO4ZoEz6pbuP4Yzc/Yum7sRvhPCl6ZzBvj9PuFQZ1AS52Tk mYYlQ8ZyOVXYvTpFSb/UN2kdzPj8dbKje4a9NGS8DjwSTqNZ8K3hQ1d03iwY4GK9ccJM 7LLafFbZviWK3l5mwQqjIJ5KCbHqtem022Hva8kWL3+VaeFHZmtTDrTDOUAiDTfs5riL rBNg== X-Gm-Message-State: AHQUAuYvPGZyB4wBIZuUxBCZ4mIk3M/D7/aXyO9LofRDTGK2ILZecXjR DAWDFed5cM8oTw6TL79Hl+fz9g== X-Received: by 2002:a7b:c0c5:: with SMTP id s5mr8142082wmh.56.1549564680034; Thu, 07 Feb 2019 10:38:00 -0800 (PST) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id f10sm27930wmb.35.2019.02.07.10.37.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 10:37:55 -0800 (PST) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5FC811FF90; Thu, 7 Feb 2019 18:37:45 +0000 (UTC) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 7 Feb 2019 18:37:44 +0000 Message-Id: <20190207183744.5054-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190207183744.5054-1-alex.bennee@linaro.org> References: <20190207183744.5054-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v2 16/16] scripts/qemu.py: allow arches use KVM for their 32bit cousins X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" A lot of architectures can run their 32 bit cousins on KVM so the kvm_available function needs to be a little less restricting when deciding if KVM is available. Signed-off-by: Alex Bennée --- scripts/qemu.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/scripts/qemu.py b/scripts/qemu.py index 0a5e02eb56..32b00af5cc 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -25,10 +25,18 @@ import tempfile LOG = logging.getLogger(__name__) +# Mapping host architecture to any additional architectures it can +# support which often includes its 32 bit cousin. +ADDITIONAL_ARCHES = { + "x86_64" : "i386", + "aarch64" : "armhf" +} def kvm_available(target_arch=None): - if target_arch and target_arch != os.uname()[4]: - return False + host_arch = os.uname()[4] + if target_arch and target_arch != host_arch: + if target_arch != ADDITIONAL_ARCHES.get(host_arch): + return False return os.access("/dev/kvm", os.R_OK | os.W_OK)