From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D06D2C64EC4 for ; Fri, 10 Mar 2023 15:18:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paeVU-0004kM-Kh; Fri, 10 Mar 2023 10:18:08 -0500 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 1paeVR-0004jb-J4 for qemu-devel@nongnu.org; Fri, 10 Mar 2023 10:18:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paeVO-00022a-Rl for qemu-devel@nongnu.org; Fri, 10 Mar 2023 10:18:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678461481; 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=r4duduEoAxMdu33kZxVuJL774cJlzxpw+p9v3Ihfwfc=; b=N6UHhw3H6M23B/++bwshaNvcJ5EGj+HDtAwCCofmbPx/WyVI8ICJ3hKAndT906X9OWjGQV NQDpQRr78ORwi2vxz3R+CwQL+3CVYwFPAPcj/CPqj38YADxX0tmiqxpad8j8ICxEZrCRiR eBDPbEslGZ0zQEe1nikgwrpHRui8VKI= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-270-ECCj4ZRVOi66xPEa_ja9Ng-1; Fri, 10 Mar 2023 10:18:00 -0500 X-MC-Unique: ECCj4ZRVOi66xPEa_ja9Ng-1 Received: by mail-wm1-f70.google.com with SMTP id p22-20020a7bcc96000000b003e2036a1516so3991049wma.7 for ; Fri, 10 Mar 2023 07:17:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678461478; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r4duduEoAxMdu33kZxVuJL774cJlzxpw+p9v3Ihfwfc=; b=EpYEZhOzPmX8lPCbgJ4o8JylDZ3ql6Sm7VVu1I+uLoLL72Sa6LwUSLa1eNbBGf3d+b KnTFYkID2aM/ohXxJTM0Qa5/RktIjqKIOx4Qwxmd5TwOnP0V+YY+v0jiTkG6d7u5zlt/ 5IvdC8WEz9h/OEMThbuFP5ZjI9a5UdINTNzIiA4Wk3YQCS4R9DJFXGmMswyHrVe+7X2l XLK7D7JmXmDgZwsyTXJemI51iphcJDBovzGMyFzSNOXFKoXBPw0/t3iv0Y6/uquQZk9k HA3LA0mcnnRF4FLRoFmq0nzU2iczJycYviwbj0m4I9dWk6n0i4qgCfpLollVd4edkNs9 F0Tg== X-Gm-Message-State: AO0yUKWgNgHt4Bp0obG0Ufg/fKtOaZhM8FxdMwkxrGCjo+Iav6EgY+xB cC40DECmDpJ6D9oMAOok87zgdXpp1AxF+625+gDzxHY3DZui8ipwiNxvdEV2fXCVAMi0LzYBtlE PSr4h5Z6cBJ/jlK8= X-Received: by 2002:adf:f812:0:b0:2c7:17a2:b70 with SMTP id s18-20020adff812000000b002c717a20b70mr16624224wrp.69.1678461477900; Fri, 10 Mar 2023 07:17:57 -0800 (PST) X-Google-Smtp-Source: AK7set9UJJ7ds+ZJp28Sl2ReekYrLjVsl77L+TCKhz6gxc7zY8dfKOcxBfRMcls/O7oBUQdG6fmAWg== X-Received: by 2002:adf:f812:0:b0:2c7:17a2:b70 with SMTP id s18-20020adff812000000b002c717a20b70mr16624198wrp.69.1678461477607; Fri, 10 Mar 2023 07:17:57 -0800 (PST) Received: from [192.168.2.110] (p549d1c92.dip0.t-ipconnect.de. [84.157.28.146]) by smtp.gmail.com with ESMTPSA id r12-20020a5d494c000000b002c59e001631sm41201wrs.77.2023.03.10.07.17.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Mar 2023 07:17:57 -0800 (PST) Message-ID: <0a2fcaf6-169e-a947-c03f-3aadba10da73@redhat.com> Date: Fri, 10 Mar 2023 16:17:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v8 08/11] tests/qtest: Fix tests when no KVM or TCG are present Content-Language: en-US To: Fabiano Rosas , "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Richard Henderson , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Paolo Bonzini , Claudio Fontana , Eduardo Habkost , Alexander Graf , Cornelia Huck , Juan Quintela , Igor Mammedov , Ani Sinha , Laurent Vivier , "Dr. David Alan Gilbert" References: <20230309201434.10831-1-farosas@suse.de> <20230309201434.10831-9-farosas@suse.de> <20230310050550-mutt-send-email-mst@kernel.org> <87h6useoxy.fsf@suse.de> From: Thomas Huth In-Reply-To: <87h6useoxy.fsf@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On 10/03/2023 14.06, Fabiano Rosas wrote: > "Michael S. Tsirkin" writes: > >> On Thu, Mar 09, 2023 at 05:14:31PM -0300, Fabiano Rosas wrote: >>> It is possible to have a build with both TCG and KVM disabled due to >>> Xen requiring the i386 and x86_64 binaries to be present in an aarch64 >>> host. >>> >>> If we build with --disable-tcg on the aarch64 host, we will end-up >>> with a QEMU binary (x86) that does not support TCG nor KVM. >>> >>> Fix tests that crash or hang in the above scenario. Do not include any >>> test cases if TCG and KVM are missing. >>> >>> Make sure that calls to qtest_has_accel are placed after g_test_init >>> in similar fashion to commit ae4b01b349 ("tests: Ensure TAP version is >>> printed before other messages") to avoid TAP parsing errors. >>> >>> Signed-off-by: Fabiano Rosas >>> Reviewed-by: Juan Quintela >> >> I don't like it that we are hard-coding the list of accelerators >> like this. Make a wrapper? >> > > Are you thinking of some sort of "has_any_accel" wrapper? I think in the long run, we want something like what I described here: https://lore.kernel.org/qemu-devel/ee0cad00-a6f3-f0c1-adf0-ba32329354f3@redhat.com/ >>> @@ -2120,6 +2119,13 @@ int main(int argc, char *argv[]) >>> >>> g_test_init(&argc, &argv, NULL); >>> >>> + has_kvm = qtest_has_accel("kvm"); >>> + has_tcg = qtest_has_accel("tcg"); >>> + >> >> why are you moving these? init at declaration time is >> generally cleaner. >> > > Thomas had asked me to put calls to qtest_has_accel after g_test_init. I > just brought the existing one along for consistency. From the commit > message: > > "Make sure that calls to qtest_has_accel are placed after g_test_init > in similar fashion to commit ae4b01b349 ("tests: Ensure TAP version is > printed before other messages") to avoid TAP parsing errors." Right, otherwise this might cause problems with the latest version of glib (in Fedora, I think). Thomas