From nobody Mon Feb 9 09:16:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620076247; cv=none; d=zohomail.com; s=zohoarc; b=LddO9tDwAaiiMnTyQ1Db37KI9qylJ3Gp+5f4VZg5BJuJnEjM7vnSULD4kxwOSyXmycmVffvblrSS1TsdZ3E3FWV3hYYKhttoxncO7NLypS1k0u+Wkr+HPf4AcuycJtRZ+Pnb9YDk/c5qop/8jyt2UAPN9n6HVBiNRdZlYsr/Twc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620076247; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=MeNb2Atwfh/sX8kxLzvRexJijoqF1JUDJOimaLT3mRk=; b=eVNONHYusUmnAQfJZ31IG9x0kJQHBeWzpGxwTRx/V9G7E3KD/42gg3ABXOfBn0Fxy+dgFxax1MJgIrwtitvHaEJdC+TtyYOCPLtfa9LbdIwrqG9NoGDhtLzju6I6qHgZtcw2P2loUT8hZ6OYJ1nSCXRhkoxlcorYCHHDLoBFzAY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1620076247294115.38208685361997; Mon, 3 May 2021 14:10:47 -0700 (PDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-360-g-AdGP5JN2q9-MnrWyqkVQ-1; Mon, 03 May 2021 17:10:44 -0400 Received: by mail-wr1-f69.google.com with SMTP id a7-20020adfc4470000b029010d875c66edso4626015wrg.23 for ; Mon, 03 May 2021 14:10:44 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (anancy-651-1-208-144.w109-217.abo.wanadoo.fr. [109.217.237.144]) by smtp.gmail.com with ESMTPSA id q10sm729846wmc.31.2021.05.03.14.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 14:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620076246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MeNb2Atwfh/sX8kxLzvRexJijoqF1JUDJOimaLT3mRk=; b=VFTdd9Jfbiilco3BtLdysJVjZx1cBKi5PE+OeGUV3GDXfwHz59edbkhnxX6id56bJcPo+k jLNk4seteNbnjVUkQRrC0Reh6cYDBBEvIbWk9iPSpGDB7z4BBXfHs+ENgf7WCcpBTjqtmM 7hA9d+N+e2EID3EjG0jQlsAgPmGQJe0= X-MC-Unique: g-AdGP5JN2q9-MnrWyqkVQ-1 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=MeNb2Atwfh/sX8kxLzvRexJijoqF1JUDJOimaLT3mRk=; b=uMuBBLIoHhnn/iahvzSQpcakfhheslPN/uZD+rYgVKR/hSEbutpTxHqST0sM4GxCXr B5qQmR/pevOGr6P8aEPwF2u9ClBdEePzag41ZGu0w4V/3FZjXmdczWpZ6fS5/xHvIld+ 4/kpK3oLdF1ICooIVqmX4CFdmv4NHujl2NUHr5v0JqGMyiDtUCTn9fDRWelIbMgFFszE 20qdfQjsEEGsLATVMmM2yYaZ7FzF//0TYjPCQRJsajkor0+sTutAx2ZY9P3rYxW5EL6y a8h4OajwfKK6Kx447zsMgTOgsZx4D4N3pYhxkMyxiydlKAPyy0Z1O6vQXdS+E6rhQPmL uiHw== X-Gm-Message-State: AOAM530T8zNfVX4En3pPtKeSecrCGsQzATXSavLXQRL2LVLZsNtlo6m5 IQeDbCR5/FpgDLujq99ttnFDBUOZZiFu8Fnvrgt+SRyVihrInzGm+WALLF5u+AYEPBb95KxoQXJ YQzkmy8EFyPqOmA== X-Received: by 2002:a1c:f313:: with SMTP id q19mr23187061wmq.142.1620076243708; Mon, 03 May 2021 14:10:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOHD1J8jmajrMm02z2PmNvoKrNsvyzY8tUAE1Mo70lt9r9leeAZmmXa6X9jqGXZ2uwZqj/pw== X-Received: by 2002:a1c:f313:: with SMTP id q19mr23187054wmq.142.1620076243591; Mon, 03 May 2021 14:10:43 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Thomas Huth , Markus Armbruster , Eric Blake , Paolo Bonzini , qemu-arm@nongnu.org, Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Claudio Fontana , Andrew Jones , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell , Laurent Vivier Subject: [PATCH v6 04/12] qtest/arm-cpu-features: Use generic qtest_has_accel() to check for KVM Date: Mon, 3 May 2021 23:10:12 +0200 Message-Id: <20210503211020.894589-5-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210503211020.894589-1-philmd@redhat.com> References: <20210503211020.894589-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Use the recently added generic qtest_has_accel() method to check if KVM is available. Suggested-by: Claudio Fontana Reviewed-by: Andrew Jones Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/arm-cpu-features.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c index 8252b85bb85..7f4b2521277 100644 --- a/tests/qtest/arm-cpu-features.c +++ b/tests/qtest/arm-cpu-features.c @@ -26,21 +26,6 @@ " 'arguments': { 'type': 'full', " #define QUERY_TAIL "}}" =20 -static bool kvm_enabled(QTestState *qts) -{ - QDict *resp, *qdict; - bool enabled; - - resp =3D qtest_qmp(qts, "{ 'execute': 'query-kvm' }"); - g_assert(qdict_haskey(resp, "return")); - qdict =3D qdict_get_qdict(resp, "return"); - g_assert(qdict_haskey(qdict, "enabled")); - enabled =3D qdict_get_bool(qdict, "enabled"); - qobject_unref(resp); - - return enabled; -} - static QDict *do_query_no_props(QTestState *qts, const char *cpu_type) { return qtest_qmp(qts, QUERY_HEAD "'model': { 'name': %s }" @@ -493,14 +478,6 @@ static void test_query_cpu_model_expansion_kvm(const v= oid *data) =20 qts =3D qtest_init(MACHINE_KVM "-cpu max"); =20 - /* - * These tests target the 'host' CPU type, so KVM must be enabled. - */ - if (!kvm_enabled(qts)) { - qtest_quit(qts); - return; - } - /* Enabling and disabling kvm-no-adjvtime should always work. */ assert_has_feature_disabled(qts, "host", "kvm-no-adjvtime"); assert_set_feature(qts, "host", "kvm-no-adjvtime", true); @@ -624,7 +601,7 @@ int main(int argc, char **argv) * order avoid attempting to run an AArch32 QEMU with KVM on * AArch64 hosts. That won't work and isn't easy to detect. */ - if (g_str_equal(qtest_get_arch(), "aarch64")) { + if (g_str_equal(qtest_get_arch(), "aarch64") && qtest_has_accel("kvm")= ) { qtest_add_data_func("/arm/kvm/query-cpu-model-expansion", NULL, test_query_cpu_model_expansion_kvm); } --=20 2.26.3