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 6BD12CE7AB8 for ; Fri, 6 Sep 2024 08:07:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smU06-0005uA-NV; Fri, 06 Sep 2024 04:07:26 -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 1smU03-0005ku-NP for qemu-riscv@nongnu.org; Fri, 06 Sep 2024 04:07:23 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smU01-0003c1-Pu for qemu-riscv@nongnu.org; Fri, 06 Sep 2024 04:07:23 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-374c6187b6eso1019232f8f.0 for ; Fri, 06 Sep 2024 01:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725610040; x=1726214840; darn=nongnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=U2wVYjS7ZmFCucWKH2cbBK1L4EEhniDtrrrNI3gUKCM=; b=kx7M/T6XllLpqpvmcijUCn29p+e8B1TGqLr5/Fs20ZHLgUViDEnwvPWLCD9tmIAMRG o2b7s35dZElJWvgJ8iUj8zpHPHnh4QGDvUHpRXg4JccNv8XiIDcGVI2JNbIvq1LGu174 kdE9fl0qg9yHgInztXe4zXT6vG2eZrD6optLe6Vp25cYUpyzGjXHt1wdmlr3DvsZUsHN CFGEqh/Uj30TuReiGTjCtEV1EQhDkzbx4V04/lW0dFqEkbkOnu5ykrMr2LljbvmdgXRq afPUn94StiNg7Ld/zNYyyDaWOIHPckkQYMksXynuF8GHFfvk+/ERkDb//l7vHk2EsDB2 Nfvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725610040; x=1726214840; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U2wVYjS7ZmFCucWKH2cbBK1L4EEhniDtrrrNI3gUKCM=; b=QJJzg9nhYeXC9DaKkH9SkPdRLS3FsGcjr5EAV25EAVUNRnqMEZxamgadxgYymYmDGK wU6HtiHDjwvFckagSbGamxyt423iPiU2NeYmFvjytCvF4tWJVDcgunc2yV9UWRxIDgIU k65DhbCZhRZUVW2vjx0GtsppnwEUMI0c1DhmfP8lFh376C47o3LQa/OITBAwSTBPCIJP I7+CTurLttnpLLmjP1v4qotHqAGF4a+R/DF0A2R9lNFTDEOMReU2txeAV/l6LyabxnGE sboM8O0Uga7E02oyxV9+U26mPk/17ZtdvF4z2mVjfSI3XhVKEjV/ZA3lPtkjD1CefqJ7 fbZA== X-Gm-Message-State: AOJu0YwH8l81BEHZLanyCpQTclDoDY2SesH9gfOD7JoHvcT41I3DvzTa BgzZjM2ROIg7EWEej5aiis/enilUFCgFt0fWt+cWwCGBkqh9BYypKhe6vNS1wPM= X-Google-Smtp-Source: AGHT+IFG79A7lTa3NcAr9MqobgUsVzJJRoe1RYWvuybLGv88O7NoXAwM4ydS9VAbatyav127T5ZWWw== X-Received: by 2002:a5d:46ca:0:b0:377:9867:9028 with SMTP id ffacd0b85a97d-3788967aaffmr954106f8f.44.1725610039730; Fri, 06 Sep 2024 01:07:19 -0700 (PDT) Received: from [192.168.1.67] ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42c9bb7a46csm43493215e9.1.2024.09.06.01.07.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Sep 2024 01:07:19 -0700 (PDT) Message-ID: <0ae3ccda-0147-4f6a-8042-956a693ad740@linaro.org> Date: Fri, 6 Sep 2024 10:07:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/8] tests/qtest/boot-order-test: Make the machine name mandatory in this test To: Thomas Huth , qemu-devel@nongnu.org, Paolo Bonzini Cc: qemu-riscv@nongnu.org References: <20240905191434.694440-1-thuth@redhat.com> <20240905191434.694440-4-thuth@redhat.com> <639f1017-4e74-4fdc-89a6-6aeca6c0737c@linaro.org> Content-Language: en-US From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-riscv@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-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Sender: qemu-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org On 6/9/24 10:04, Thomas Huth wrote: > On 06/09/2024 09.59, Philippe Mathieu-Daudé wrote: >> Hi Thomas, >> >> On 5/9/24 21:14, Thomas Huth wrote: >>> Let's make sure that we always pass a machine name to the >>> test_boot_orders() >>> function, so we can check whether the machine is available in the binary >>> and skip the test in case it is not included in the build. >>> >>> Signed-off-by: Thomas Huth >>> --- >>>   tests/qtest/boot-order-test.c | 4 ++-- >>>   1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/tests/qtest/boot-order-test.c >>> b/tests/qtest/boot-order-test.c >>> index 8f2b6ef05a..c67b8cfe16 100644 >>> --- a/tests/qtest/boot-order-test.c >>> +++ b/tests/qtest/boot-order-test.c >>> @@ -31,7 +31,7 @@ static void test_a_boot_order(const char *machine, >>>       uint64_t actual; >>>       QTestState *qts; >>> -    if (machine && !qtest_has_machine(machine)) { >>> +    if (!qtest_has_machine(machine)) { >> >> Should we defer the NULL check to qtest_has_machine_with_env()? >> It uses g_str_equal() which is described as: >> >>    Note that this function is primarily meant as a hash table >>    comparison function. For a general-purpose, NULL-safe string >>    comparison function, see g_strcmp0(). >> >> Better switch to g_strcmp0() in qtest_has_machine_with_env()? > > What would be the intended meaning of the function when it is called > with "NULL" ? Use the default machine? Skip the test? ... I think it is > rather an error to call it with NULL, so it's OK if the test crashes > here since it should never happen? Right. Reviewed-by: Philippe Mathieu-Daudé