From patchwork Fri Oct 26 14:15:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 989590 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42hR8r4xK8z9sDr for ; Sat, 27 Oct 2018 01:25:00 +1100 (AEDT) Received: from localhost ([::1]:60369 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG32o-0000zB-6b for incoming@patchwork.ozlabs.org; Fri, 26 Oct 2018 10:24:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG2uE-00024p-Su for qemu-devel@nongnu.org; Fri, 26 Oct 2018 10:16:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gG2uE-0006Bz-1d for qemu-devel@nongnu.org; Fri, 26 Oct 2018 10:16:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55102) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gG2uD-0006BA-QA for qemu-devel@nongnu.org; Fri, 26 Oct 2018 10:16:05 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1FAE03B3C1; Fri, 26 Oct 2018 14:16:05 +0000 (UTC) Received: from magic.redhat.com (ovpn-116-212.ams2.redhat.com [10.36.116.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0B0F60BBE; Fri, 26 Oct 2018 14:16:00 +0000 (UTC) From: Fam Zheng To: qemu-devel@nongnu.org Date: Fri, 26 Oct 2018 22:15:27 +0800 Message-Id: <20181026141529.4305-8-famz@redhat.com> In-Reply-To: <20181026141529.4305-1-famz@redhat.com> References: <20181026141529.4305-1-famz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 26 Oct 2018 14:16:05 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 7/9] tests/vm: Let kvm_available() work in cross environments 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20181013004034.6968-7-f4bug@amsat.org> Reviewed-by: Richard Henderson Signed-off-by: Fam Zheng --- scripts/qemu.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/qemu.py b/scripts/qemu.py index 9fc0be4828..bcd24aad82 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -27,6 +27,8 @@ LOG = logging.getLogger(__name__) def kvm_available(target_arch=None): + if target_arch and target_arch != os.uname()[4]: + return False return os.access("/dev/kvm", os.R_OK | os.W_OK)