From nobody Tue Feb 10 16:22:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1674140500; cv=none; d=zohomail.com; s=zohoarc; b=ee1GLv4ZWPpOaVykroGFegBQ15cKaStYq32yFwig1F/K6C43SZ95tqdEyN1aQuOaX20HY9qIYSvCWj2CR6OXQZ0QvdhGGJLz5ep6V1rCBFnoUvpO4OpiOPtdKJlWOCU9m/oc87AIvbWaacKzW8T9PmTs5+JkMafHY8drRJmgF5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674140500; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=es3Dw8MLiqLXATzoVsMpPJx/0iri3aBMV7qIVLaAL/4=; b=aJtGPKgs6gqOyhyhcjug+zrEi3Mhl2BWrosl+VwLnHylIqYXasaNR6D5E3ytfWUhmh8uI7glt3VPw2H+mCWCrrabcSJnvkrrI8cc7dT7JQoDvDB1/ba00wON6lIsWGuYdCVa2Mhwuop7UTNVbBa5vGOkJlE1Xo3cAu2Ae815zrs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674140500230813.2846158572735; Thu, 19 Jan 2023 07:01:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIWNX-0006CE-Aq; Thu, 19 Jan 2023 09:58:59 -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 1pIWNW-0006BK-Kx for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:58:58 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWNV-0003Y7-1x for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:58:58 -0500 Received: by mail-wm1-x32e.google.com with SMTP id iv8-20020a05600c548800b003db04a0a46bso3152905wmb.0 for ; Thu, 19 Jan 2023 06:58:56 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r1-20020a05600c35c100b003db06493ee7sm5425204wmq.47.2023.01.19.06.58.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=es3Dw8MLiqLXATzoVsMpPJx/0iri3aBMV7qIVLaAL/4=; b=s0S64k3YCGevc0R0oTZIH8fIMdDLMa6BHjCYopC0QoEYw3dMbRGT2SJkPn2oxAS29S 5pgEK/hzdaM3N0gsH93FntPpHWRMX82EeqE0lCxAI2SPdHDeNVc58iPG0ZJGtvYelZop 1BEuzraGBDQXNsM7Sw8QBMHAt/Edu+h1OKQ+0opkndkrNh9FEhRhJxq0zG9GZ0i9bJN0 aXrxlghJiCzsjgRBeHAsDkyaGL7kHdiOmxUeVcENUvBEi78eTe4mo2Auw2gRm/0YBuqN M3G8d4NO7r6PG8vZU8QU8TGcGc52y0AlU/Ttjm4Xf92iyeI/wYYMlHcDYNTtlf1aEBRs jFow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=es3Dw8MLiqLXATzoVsMpPJx/0iri3aBMV7qIVLaAL/4=; b=5rtbWy6sVNNRNMjhFiOePv/Tns3D1xjDaVVxA8wTIycC4h3H5Ve+uncRB2D2AY0Dp6 qM0bnX3PGXqg2qOs5uTswMqSqam/fscxDYqlc6FQHZMRvZ6wAxSVV73/qqVxZ5Wb3mft wlDyTeKZY0DBCvwAlJEU2rWkG4PVRAhOGEt81b9HxpKFA6wx3PRipehPN0LA7izCHTIH /7PnVkY9r1GuAqI9g/hbUY1RNzGEXhcpjzjpGOkWZarb6x9LUJQUryhB1n2ZAmD6+WFc MbQyVeWmhZkGZ1dWVf8VOuyePGLEK2oot6jpBTBTQ1cqEbAJUHCK0DTo+vpHMVpMmfmM sj6w== X-Gm-Message-State: AFqh2krmgHqb9T44hi5k+TmrpoXooX63DTqOXoddY5mU/5tju1QANIqW 8ibRWQYp3qq+bkdmS0BfJBKaA/u5V+kufL3I X-Google-Smtp-Source: AMrXdXt/xVdtHaHj611XoLi6fwLUx5kTFQwwrwE2Mdj6MfzU9yOl+cf8V0AqkYuMe2uhzDpt0/IL3Q== X-Received: by 2002:a05:600c:198e:b0:3db:1d7e:c429 with SMTP id t14-20020a05600c198e00b003db1d7ec429mr3422988wmq.40.1674140335259; Thu, 19 Jan 2023 06:58:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Juan Quintela , Laurent Vivier , Paolo Bonzini , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Fabiano Rosas , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 03/11] tests/qtest/boot-serial-test: Build command line using GString API Date: Thu, 19 Jan 2023 15:58:30 +0100 Message-Id: <20230119145838.41835-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230119145838.41835-1-philmd@linaro.org> References: <20230119145838.41835-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1674140502438100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tests/qtest/boot-serial-test.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index 3a854b0174..92890b409d 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -226,14 +226,17 @@ static void test_machine(const void *data) const testdef_t *test =3D data; g_autofree char *serialtmp =3D NULL; g_autofree char *codetmp =3D NULL; - const char *codeparam =3D ""; QTestState *qts; int ser_fd; + g_autoptr(GString) cmd =3D g_string_new(""); =20 ser_fd =3D g_file_open_tmp("qtest-boot-serial-sXXXXXX", &serialtmp, NU= LL); g_assert(ser_fd !=3D -1); close(ser_fd); =20 + g_string_append_printf(cmd, "-M %s ", test->machine); + g_string_append(cmd, "-no-shutdown "); + if (test->kernel || test->bios) { ssize_t wlen; int code_fd; @@ -243,19 +246,23 @@ static void test_machine(const void *data) wlen =3D write(code_fd, test->kernel ? : test->bios, test->codesiz= e); g_assert(wlen =3D=3D test->codesize); close(code_fd); + g_string_append_printf(cmd, "%s %s ", + test->kernel ? "-kernel " : "-bios ", codet= mp); } =20 + g_string_append_printf(cmd, "-chardev file,id=3Dserial0,path=3D%s " + "-serial chardev:serial0 ", serialtmp); + /* * Make sure that this test uses tcg if available: It is used as a * fast-enough smoketest for that. */ - qts =3D qtest_initf("%s %s %s -M %s -no-shutdown " - "-chardev file,id=3Dserial0,path=3D%s " - "-serial chardev:serial0 -accel tcg -accel kvm %s", - codeparam, - test->kernel ? "-kernel " : test->bios ? "-bios " : = "", - codetmp ? : "", test->machine, - serialtmp, test->extra); + g_string_append(cmd, "-accel tcg "); + g_string_append(cmd, "-accel kvm "); + g_string_append(cmd, test->extra); + + qts =3D qtest_init(cmd->str); + if (codetmp) { unlink(codetmp); } --=20 2.38.1