From nobody Sun Feb 8 19:12:53 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1640024274513634.8015483761174; Mon, 20 Dec 2021 10:17:54 -0800 (PST) Received: from localhost ([::1]:38924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzNEP-0006Z3-D9 for importer@patchew.org; Mon, 20 Dec 2021 13:17:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzKmk-0006C2-Tf for qemu-devel@nongnu.org; Mon, 20 Dec 2021 10:41:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37171) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzKmg-0008Fr-Sc for qemu-devel@nongnu.org; Mon, 20 Dec 2021 10:41:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-147-MbykiSgiNZSzAxm6Snnl5Q-1; Mon, 20 Dec 2021 03:11:06 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 73B261006AA2 for ; Mon, 20 Dec 2021 08:11:05 +0000 (UTC) Received: from thuth.com (dhcp-192-183.str.redhat.com [10.33.192.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B7785BD0B; Mon, 20 Dec 2021 08:11:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640014856; 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=eGOiI6DWDn2n29JHORgKBF09JJJxcDoMUuEs2RnEKy0=; b=W///LkfBDIG8Y4F+3nr+um7qzAZRlLCrD8p4Xi0l/yUrykMjnUrop9nFcqb1N68SXWidOC QXV7hemsUH8dPh7d0pbxiqG8LjeLD9IN8ikRsl6SQugPq5Nn7ZZO9A+T9/IDKxwBfsMekn skto52Pv8I4nyu1P3bby3Kff/Sd9k4k= X-MC-Unique: MbykiSgiNZSzAxm6Snnl5Q-1 From: Thomas Huth To: qemu-devel@nongnu.org, Laurent Vivier Subject: [PATCH 1/4] tests/qtest: Add a function that checks whether a device is available Date: Mon, 20 Dec 2021 09:10:51 +0100 Message-Id: <20211220081054.151515-2-thuth@redhat.com> In-Reply-To: <20211220081054.151515-1-thuth@redhat.com> References: <20211220081054.151515-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.209, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Cc: Paolo Bonzini , Miroslav Rezanina , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1640024275611100001 Content-Type: text/plain; charset="utf-8" Devices might not always be compiled into the QEMU target binaries. We already have the libqos framework that is good for handling such situations, but some of the qtests are not a real good fit for the libqos framework. Let's add a qtest_has_device() function for such tests instead. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/libqos/libqtest.h | 8 +++++++ tests/qtest/libqtest.c | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h index dff6b31cf0..2df9397519 100644 --- a/tests/qtest/libqos/libqtest.h +++ b/tests/qtest/libqos/libqtest.h @@ -718,6 +718,14 @@ void qtest_cb_for_every_machine(void (*cb)(const char = *machine), */ bool qtest_has_machine(const char *machine); =20 +/** + * qtest_has_device: + * @device: The device to look for + * + * Returns: true if the device is available in the target binary. + */ +bool qtest_has_device(const char *device); + /** * qtest_qmp_device_add_qdict: * @qts: QTestState instance to operate on diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 65ed949685..9e845002a1 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -1418,6 +1418,50 @@ bool qtest_has_machine(const char *machine) return false; } =20 +bool qtest_has_device(const char *device) +{ + static QList *list; + const QListEntry *p; + QObject *qobj; + QString *qstr; + QDict *devinfo; + int idx; + + if (!list) { + QDict *resp; + QDict *args; + QTestState *qts =3D qtest_init("-machine none"); + + args =3D qdict_new(); + qdict_put_bool(args, "abstract", false); + qdict_put_str(args, "implements", "device"); + + resp =3D qtest_qmp(qts, "{'execute': 'qom-list-types', 'arguments'= : %p }", + args); + g_assert(qdict_haskey(resp, "return")); + list =3D qdict_get_qlist(resp, "return"); + qobject_ref(list); + qobject_unref(resp); + + qtest_quit(qts); + } + + for (p =3D qlist_first(list), idx =3D 0; p; p =3D qlist_next(p), idx++= ) { + devinfo =3D qobject_to(QDict, qlist_entry_obj(p)); + g_assert(devinfo); + + qobj =3D qdict_get(devinfo, "name"); + g_assert(qobj); + qstr =3D qobject_to(QString, qobj); + g_assert(qstr); + if (g_str_equal(qstring_get_str(qstr), device)) { + return true; + } + } + + return false; +} + /* * Generic hot-plugging test via the device_add QMP commands. */ --=20 2.27.0 From nobody Sun Feb 8 19:12:53 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1640019893102268.30675741628966; Mon, 20 Dec 2021 09:04:53 -0800 (PST) Received: from localhost ([::1]:42412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzM5j-0001My-Mn for importer@patchew.org; Mon, 20 Dec 2021 12:04:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzKmj-0006Bv-Qo for qemu-devel@nongnu.org; Mon, 20 Dec 2021 10:41:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzKmh-0008Ft-99 for qemu-devel@nongnu.org; Mon, 20 Dec 2021 10:41:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-360-sbDZOE9sOQ22iAE8VS-7lw-1; Mon, 20 Dec 2021 03:11:07 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2FA506408E for ; Mon, 20 Dec 2021 08:11:07 +0000 (UTC) Received: from thuth.com (dhcp-192-183.str.redhat.com [10.33.192.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id 156265BD0B; Mon, 20 Dec 2021 08:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640014856; 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=t32KfCF+wi1IzTphtrfGSqsqGYn4Es56oWVqjcN36ug=; b=A6gHYjQ8sdFF+zN/ur8tIXyLW1cwThi//c9Y6N1UPh7uiTQ0t6b6buDrhi7uuxuPSUl0Gv 008IEmvnkbXJZ7yuEmWjxN8E8tW7GDO6Sia+tfv0X8No0aFFCtdtyRyQoYbNsb6+eGmXBB h7B+lXs8u0Kz44j0dBR9byPL1qOE2bY= X-MC-Unique: sbDZOE9sOQ22iAE8VS-7lw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Laurent Vivier Subject: [PATCH 2/4] tests/qtest: Improve endianness-test to work with missing machines and devices Date: Mon, 20 Dec 2021 09:10:52 +0100 Message-Id: <20211220081054.151515-3-thuth@redhat.com> In-Reply-To: <20211220081054.151515-1-thuth@redhat.com> References: <20211220081054.151515-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.209, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Cc: Paolo Bonzini , Miroslav Rezanina , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1640019895172100001 Content-Type: text/plain; charset="utf-8" The users might have built QEMU with less machines or without the i82378 superio device. Add some checks to the endianess-test so that it is able to deal with such stripped down QEMU versions, too. Signed-off-by: Thomas Huth --- tests/qtest/endianness-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/qtest/endianness-test.c b/tests/qtest/endianness-test.c index 09ecb531f1..9c03b72dc9 100644 --- a/tests/qtest/endianness-test.c +++ b/tests/qtest/endianness-test.c @@ -281,7 +281,10 @@ int main(int argc, char **argv) =20 for (i =3D 0; test_cases[i].arch; i++) { gchar *path; - if (strcmp(test_cases[i].arch, arch) !=3D 0) { + + if (!g_str_equal(test_cases[i].arch, arch) || + !qtest_has_machine(test_cases[i].machine) || + (test_cases[i].superio && !qtest_has_device(test_cases[i].supe= rio))) { continue; } path =3D g_strdup_printf("endianness/%s", --=20 2.27.0 From nobody Sun Feb 8 19:12:53 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164002281886872.26991270751353; Mon, 20 Dec 2021 09:53:38 -0800 (PST) Received: from localhost ([::1]:41936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzMqv-0003Bc-Ls for importer@patchew.org; Mon, 20 Dec 2021 12:53:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzKhn-00032t-IQ for qemu-devel@nongnu.org; Mon, 20 Dec 2021 10:36:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:59946) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzKhl-00067n-QG for qemu-devel@nongnu.org; Mon, 20 Dec 2021 10:36:03 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-672-6QYxUhOHOMiIuiPeJ1TT4A-1; Mon, 20 Dec 2021 03:11:09 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 903F964093 for ; Mon, 20 Dec 2021 08:11:08 +0000 (UTC) Received: from thuth.com (dhcp-192-183.str.redhat.com [10.33.192.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id 771BA5BD0B; Mon, 20 Dec 2021 08:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640014561; 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=g5ZmWBXVIa2SXtxr5syMSK7xNafuHPKY6DumgAl83Ic=; b=eWao+fKDH7w0dCsVmE2qg8CE3+xkg8q6XQ2qPQBLLqvrs2IiAvbNsJvAj7brTj5eAX50Wj LLnbXlrPFF+/cV1NWtPt29MbC6vFkJgjaxvx3ztnGbYm754lR1dLar3vVXRWjrelACZaZl Ls+3HGxw5DNe0EQKZpsF0FIEHmcK/Wk= X-MC-Unique: 6QYxUhOHOMiIuiPeJ1TT4A-1 From: Thomas Huth To: qemu-devel@nongnu.org, Laurent Vivier Subject: [PATCH 3/4] tests/qtest/cdrom-test: Check whether devices are available before using them Date: Mon, 20 Dec 2021 09:10:53 +0100 Message-Id: <20211220081054.151515-4-thuth@redhat.com> In-Reply-To: <20211220081054.151515-1-thuth@redhat.com> References: <20211220081054.151515-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.209, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Cc: Paolo Bonzini , Miroslav Rezanina , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1640022820608100001 Content-Type: text/plain; charset="utf-8" Downstream users might want to disable legacy devices in their binaries, so we should not blindly assume that they are available. Add some proper checks before using them. Signed-off-by: Thomas Huth Acked-by: John Snow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/cdrom-test.c | 60 ++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c index c1fcac5c45..cfca24fa94 100644 --- a/tests/qtest/cdrom-test.c +++ b/tests/qtest/cdrom-test.c @@ -142,21 +142,36 @@ static void add_x86_tests(void) qtest_add_data_func("cdrom/boot/isapc", "-M isapc " "-drive if=3Dide,media=3Dcdrom,file=3D", test_= cdboot); } - qtest_add_data_func("cdrom/boot/am53c974", - "-device am53c974 -device scsi-cd,drive=3Dcd1 " - "-drive if=3Dnone,id=3Dcd1,format=3Draw,file=3D", = test_cdboot); - qtest_add_data_func("cdrom/boot/dc390", - "-device dc390 -device scsi-cd,drive=3Dcd1 " - "-blockdev file,node-name=3Dcd1,filename=3D", test= _cdboot); - qtest_add_data_func("cdrom/boot/lsi53c895a", - "-device lsi53c895a -device scsi-cd,drive=3Dcd1 " - "-blockdev file,node-name=3Dcd1,filename=3D", test= _cdboot); - qtest_add_data_func("cdrom/boot/megasas", "-M q35 " - "-device megasas -device scsi-cd,drive=3Dcd1 " - "-blockdev file,node-name=3Dcd1,filename=3D", test= _cdboot); - qtest_add_data_func("cdrom/boot/megasas-gen2", "-M q35 " - "-device megasas-gen2 -device scsi-cd,drive=3Dcd1 " - "-blockdev file,node-name=3Dcd1,filename=3D", test= _cdboot); + if (qtest_has_device("am53c974")) { + qtest_add_data_func("cdrom/boot/am53c974", + "-device am53c974 -device scsi-cd,drive=3Dcd1 " + "-drive if=3Dnone,id=3Dcd1,format=3Draw,file= =3D", + test_cdboot); + } + if (qtest_has_device("dc390")) { + qtest_add_data_func("cdrom/boot/dc390", + "-device dc390 -device scsi-cd,drive=3Dcd1 " + "-blockdev file,node-name=3Dcd1,filename=3D", + test_cdboot); + } + if (qtest_has_device("lsi53c895a")) { + qtest_add_data_func("cdrom/boot/lsi53c895a", + "-device lsi53c895a -device scsi-cd,drive=3Dcd= 1 " + "-blockdev file,node-name=3Dcd1,filename=3D", + test_cdboot); + } + if (qtest_has_device("megasas")) { + qtest_add_data_func("cdrom/boot/megasas", "-M q35 " + "-device megasas -device scsi-cd,drive=3Dcd1 " + "-blockdev file,node-name=3Dcd1,filename=3D", + test_cdboot); + } + if (qtest_has_device("megasas-gen2")) { + qtest_add_data_func("cdrom/boot/megasas-gen2", "-M q35 " + "-device megasas-gen2 -device scsi-cd,drive=3D= cd1 " + "-blockdev file,node-name=3Dcd1,filename=3D", + test_cdboot); + } } =20 static void add_s390x_tests(void) @@ -171,12 +186,15 @@ static void add_s390x_tests(void) "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd1 " "-device virtio-blk,drive=3Dd2,bootindex=3D1 " "-drive if=3Dnone,id=3Dd2,media=3Dcdrom,file=3D", = test_cdboot); - qtest_add_data_func("cdrom/boot/without-bootindex", - "-device virtio-scsi -device virtio-serial " - "-device x-terminal3270 -device virtio-blk,drive= =3Dd1 " - "-drive driver=3Dnull-co,read-zeroes=3Don,if=3Dnon= e,id=3Dd1 " - "-device virtio-blk,drive=3Dd2 " - "-drive if=3Dnone,id=3Dd2,media=3Dcdrom,file=3D", = test_cdboot); + if (qtest_has_device("x-terminal3270")) { + qtest_add_data_func("cdrom/boot/without-bootindex", + "-device virtio-scsi -device virtio-serial " + "-device x-terminal3270 -device virtio-blk,dri= ve=3Dd1 " + "-drive driver=3Dnull-co,read-zeroes=3Don,if= =3Dnone,id=3Dd1 " + "-device virtio-blk,drive=3Dd2 " + "-drive if=3Dnone,id=3Dd2,media=3Dcdrom,file= =3D", + test_cdboot); + } } =20 int main(int argc, char **argv) --=20 2.27.0 From nobody Sun Feb 8 19:12:53 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1640021958494377.7280585632732; Mon, 20 Dec 2021 09:39:18 -0800 (PST) Received: from localhost ([::1]:33928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzMd3-00037X-Ay for importer@patchew.org; Mon, 20 Dec 2021 12:39:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzKhK-00027o-WC for qemu-devel@nongnu.org; Mon, 20 Dec 2021 10:35:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzKhG-0005jb-EB for qemu-devel@nongnu.org; Mon, 20 Dec 2021 10:35:33 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-22-RzSKkt_LO0GgL2zz1W2hrw-1; Mon, 20 Dec 2021 03:11:10 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id F17041006AA5 for ; Mon, 20 Dec 2021 08:11:09 +0000 (UTC) Received: from thuth.com (dhcp-192-183.str.redhat.com [10.33.192.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7CE75BD07; Mon, 20 Dec 2021 08:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640014518; 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=XoyxSjhfhqybXwOxubKg/oYH1Vg/VqCk099n+pchoBs=; b=DTJ1xohp+5hGl/E7EB2LQAFq2zHUQgAiRveUDUvt1G1tJ3ceK/OTBuBi7I2+H5RTu8lKuc SNNjh/da7S7Rk5kfWCRJp7V9g6IoR7W1m9Nc1GrsMlLdPhleHAn66xmYqED8ETtlaKVeqR 0y0yECqsvYzGdRNsxBfKjN4F2HmAUl0= X-MC-Unique: RzSKkt_LO0GgL2zz1W2hrw-1 From: Thomas Huth To: qemu-devel@nongnu.org, Laurent Vivier Subject: [PATCH 4/4] tests/qtest/boot-order-test: Check whether machines are available Date: Mon, 20 Dec 2021 09:10:54 +0100 Message-Id: <20211220081054.151515-5-thuth@redhat.com> In-Reply-To: <20211220081054.151515-1-thuth@redhat.com> References: <20211220081054.151515-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.209, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Cc: Paolo Bonzini , Miroslav Rezanina , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1640021960341100001 Content-Type: text/plain; charset="utf-8" Machines might not always be compiled into the QEMU binary, so we should skip the test instead of failing if it is not available. Signed-off-by: Thomas Huth --- tests/qtest/boot-order-test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/qtest/boot-order-test.c b/tests/qtest/boot-order-test.c index fac580d6c4..f1f59b1261 100644 --- a/tests/qtest/boot-order-test.c +++ b/tests/qtest/boot-order-test.c @@ -34,6 +34,11 @@ static void test_a_boot_order(const char *machine, uint64_t actual; QTestState *qts; =20 + if (machine && !qtest_has_machine(machine)) { + g_test_skip("Machine is not available"); + return; + } + qts =3D qtest_initf("-nodefaults%s%s %s", machine ? " -M " : "", machine ?: "", test_args); actual =3D read_boot_order(qts); --=20 2.27.0