From patchwork Fri Jun 20 13:07:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 898318 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f54:0:b0:3a4:ee3f:8f15 with SMTP id cm20csp1324437wrb; Fri, 20 Jun 2025 06:14:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXLD6d0YIgwgWmg927+EsArm9wJc097q80xBFNI86teIbYfliaj6F116iTD0wmQAfkjBj4WQA==@linaro.org X-Google-Smtp-Source: AGHT+IEJDFLthDASpGisBiM3B2bWdzCrEZ/s0q+zdm6sR8kRREnvkVCEP/orbbDWtFQJytCh4DIp X-Received: by 2002:a05:622a:1211:b0:4a5:a4e9:1333 with SMTP id d75a77b69052e-4a77a25056fmr44696051cf.49.1750425259306; Fri, 20 Jun 2025 06:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750425259; cv=none; d=google.com; s=arc-20240605; b=i2FOHrjFuN+a4yO5zZ6IanaaqO5gQzBmR/e19y1UVxMEOfG9daFZoGZbLESGjpVvAG 2O7sSbj7jwaB9a4wColNNx+tRYgJbXqr63c0b+dZOe4dwN/fptRXV+/wzo6oBAsFUOJm zPjXRCJOZP9acF0Yl/kMhenpjD99tQrdoEWqTcXBJRj9KAuZk34GeoiSMu/NHZY+hHxO qjB1ZhtP5iLejHdJsW/PCNaxwb7AWEgI4U3pHr7qtoIiB5U32bF59nYwYYku0zk/Tu/M BJwqybuFtA4akh4d4QN/q0rLw0KMd0hGWQDbKhCx7CaBY39+aXu5BdyRD+qGHDlUsh5n 2vpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ML487RZEtX6RDPbX3JUchrWHyom2/STG3MUfjQAASi4=; fh=rvFFfFUeajrBSZUZbNRiqOinI+1sct87Q5T4lCmXKcc=; b=Cs5ndEFHUWFfh0Y/aG9Q9ioRPRI9o8vUwSHV6RIldDrtvOGOiQsKwWHwjqkmXgQjwi std4YAvvzf5/cW4obA+WSKSF5rjEdij6+2F5sb8KErrNJAaTDQ9F96Qf3jeW7+N/ok+E lLRydmjn6qjfDsxvNmtAVOHrSzGt4YsUj1fko3AjTjL2nj8dbvR46mDgBUAV9nckxcbV /qAzznU+dIJfKssPM1faKZsJ1KJ9c8s2OcY/hig7U4KyfkZJT8RYobxiTFOnyKbAglS4 3xM8pKlabJ9NMztQjfE6sZqClcH5h1ni8iMXMdGFMifqoj4P0k4rmByjG/2zZaYnR3sE BNqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IT057k3u; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4a77a0b4b11si17223391cf.413.2025.06.20.06.14.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jun 2025 06:14:19 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=IT057k3u; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uSbVU-0006pJ-3g; Fri, 20 Jun 2025 09:10:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uSbV0-0006Md-Q0 for qemu-devel@nongnu.org; Fri, 20 Jun 2025 09:09:44 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uSbUz-00050y-6s for qemu-devel@nongnu.org; Fri, 20 Jun 2025 09:09:42 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-450cb2ddd46so10893665e9.2 for ; Fri, 20 Jun 2025 06:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750424974; x=1751029774; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ML487RZEtX6RDPbX3JUchrWHyom2/STG3MUfjQAASi4=; b=IT057k3uHPK2jXPABWZBFBSIB+izc1o8hMUcx8/yTkbKDneHtD5b2YVkxeSqDpEmyY Raf5RDBNTiq2k92x/DOt6dRPrVhnAzx0XkuFUR8BtL3ZdXwoYX86RuGgDfXyQ+hIKca3 AX+o5u4M0qJwx0AhXg4Zp0badcrniEavpS7kzUNyqUwhNZmJpZTQ9dMr/4XSZxYD3s/2 Z8ctbfNNFIg6mcPvjc6mQsVbCJhe+pJVjqXFTO3yrO6R9xxVMHudrziF0WjnGEuJ+aAh J8TA+mWtXCVf4jxYcolqHtwR7mPp03Fa9kdb1w7Ob8BLGhb9QUprvfnPDCx1fReQE3op t0iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750424974; x=1751029774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ML487RZEtX6RDPbX3JUchrWHyom2/STG3MUfjQAASi4=; b=iHDUro0XxYtYi4MK1iUuG9+98k8V64qBJPUcjGcGnRBSVkeHdFc/BrS+d5zLtQySN0 XEaI4F3Mmo8153wl/5xPCcl3vu182XQ9Du2+zxHUUhDTV9fHwX+mtWQ3lR5gShFlhPQd 4f3nF9BzS7yyuiWB3f8PEWleGCHMaovWv8K9ScQmyUsdXRS3008zWq9cdJ+K9MQnG9uH DHNUFnWrmbKQYHX3dan4AKb25TkFYB3026P1gwn/2OLHZATiWxt6F4QpZoczimhMU0B/ IikzAcmQ9TC3uvsTYtqmSAIsxbmyzVL7CZl8pivY8ZOWSEiNmXFWpnCTCoHgG53EvQsx 6lvw== X-Gm-Message-State: AOJu0YyUHL3LFrLzlVnjadTE28k0EpXx6p+hjyXAWR5EDLrCbzhZpuYB Nrf3tsxSMmAGICocWh7fOLJwrbSsQtKLVVunjyLhLZvttowCvnCBxrJN6hcO38RTLflFpI0KsUi LP7HxFmE= X-Gm-Gg: ASbGncscjo2UhYBz3XKlca0dk0BFepDe2ACtwadmTkvt/bpv17eC+jhUxK2fMYqXtzw ZozJyaDM7lCw8m8vMpzca4dqXxjmKjUDS5ESAF4cmtBAVQqX2llKrt2S4fy0LHeSJ//E7DcaF7V Thbg6gxFO8FuVv8wpG2p1sVmjRt3UMs9hdlTuq1Hb3/OQgk2/sf47RQFopiIx3EfMoMBpmsOAP6 hzro6TcXjsJBnpjM6rakafFUXyHQMX30rpAmp1GbOkiJ3++dtA1kE+6hJaLOegBdgqlsLo9Jz+7 kSCKteMsq6aZepy/IE1htM2grO/SI93eY0MJLjesfi14fad6UlrpVKkTy+pUoo4dCaL7HectxId afhBx/v6O7/5uz/oqcrA9XsbGoLVb/ioLF9/P X-Received: by 2002:a05:600c:3542:b0:451:e394:8920 with SMTP id 5b1f17b1804b1-453659edd18mr24577215e9.27.1750424974566; Fri, 20 Jun 2025 06:09:34 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45359a09ee6sm38434125e9.1.2025.06.20.06.09.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jun 2025 06:09:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Leif Lindholm , Richard Henderson , Radoslaw Biernacki , Alexander Graf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Phil Dennis-Jordan , =?utf-8?q?Alex_Benn=C3=A9e?= , Bernhard Beschow , Cleber Rosa , Peter Maydell , Cameron Esfahani , kvm@vger.kernel.org, qemu-arm@nongnu.org, Eric Auger , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Roman Bolshakov , John Snow Subject: [PATCH v2 25/26] tests/functional: Add hvf_available() helper Date: Fri, 20 Jun 2025 15:07:08 +0200 Message-ID: <20250620130709.31073-26-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620130709.31073-1-philmd@linaro.org> References: <20250620130709.31073-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- python/qemu/utils/__init__.py | 2 +- python/qemu/utils/accel.py | 8 ++++++++ tests/functional/qemu_test/testcase.py | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/python/qemu/utils/__init__.py b/python/qemu/utils/__init__.py index 017cfdcda75..d2fe5db223c 100644 --- a/python/qemu/utils/__init__.py +++ b/python/qemu/utils/__init__.py @@ -23,7 +23,7 @@ from typing import Optional # pylint: disable=import-error -from .accel import kvm_available, list_accel, tcg_available +from .accel import hvf_available, kvm_available, list_accel, tcg_available __all__ = ( diff --git a/python/qemu/utils/accel.py b/python/qemu/utils/accel.py index 386ff640ca8..376d1e30005 100644 --- a/python/qemu/utils/accel.py +++ b/python/qemu/utils/accel.py @@ -82,3 +82,11 @@ def tcg_available(qemu_bin: str) -> bool: @param qemu_bin (str): path to the QEMU binary """ return 'tcg' in list_accel(qemu_bin) + +def hvf_available(qemu_bin: str) -> bool: + """ + Check if HVF is available. + + @param qemu_bin (str): path to the QEMU binary + """ + return 'hvf' in list_accel(qemu_bin) diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py index 50c401b8c3c..2082c6fce43 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -23,7 +23,7 @@ import uuid from qemu.machine import QEMUMachine -from qemu.utils import kvm_available, tcg_available +from qemu.utils import hvf_available, kvm_available, tcg_available from .archive import archive_extract from .asset import Asset @@ -317,7 +317,9 @@ def require_accelerator(self, accelerator): :type accelerator: str """ checker = {'tcg': tcg_available, - 'kvm': kvm_available}.get(accelerator) + 'kvm': kvm_available, + 'hvf': hvf_available, + }.get(accelerator) if checker is None: self.skipTest("Don't know how to check for the presence " "of accelerator %s" % accelerator)