From nobody Tue Feb 10 16:22:10 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=1674140405; cv=none; d=zohomail.com; s=zohoarc; b=hCG5qCVxr4C97JF/5D1DJpUwST8zBA3CdebFH4M/RjMfJ+inzzwtdhdHlVV+NdrTvJ7Wxi1QP8lkHteeW1O9zIJl6lHXuEeqbu0EPq7AKr7TYsDP76gVqucEYDKtRyYBvtthL94LUICvZWqmNPGjXwvmm3+ziruWeZA3cRsBIUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674140405; 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=isWU99zMSOEnAE1RSfFCfmsXaFaInKvayEoBiTZj20E=; b=himBEEso3qIdzyjC6z39bmIubiDh38PBJ1v28hEOH0flgPZxfMja2fsFyGxeEYm/CL0Vd2zbN64r2OJZFbsVdU+SUKwjxdwbW8PiJiUu3sN2cptS4jB1z1t0mL/3MO3ROdAsgWqyIMe8xuWR1yLbFlJxoDaFIuAH20oosJsJ+Vk= 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 1674140405001362.5605480301688; Thu, 19 Jan 2023 07:00:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIWNz-0006jX-B1; Thu, 19 Jan 2023 09:59:27 -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 1pIWNp-0006UX-Nl for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:19 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWNo-0003Z1-6w for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:17 -0500 Received: by mail-wr1-x42e.google.com with SMTP id r9so2141233wrw.4 for ; Thu, 19 Jan 2023 06:59:15 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l1-20020adfe9c1000000b00289bdda07b7sm33113573wrn.92.2023.01.19.06.59.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:59:14 -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=isWU99zMSOEnAE1RSfFCfmsXaFaInKvayEoBiTZj20E=; b=fosVB18TI+mAnXjLHz/fhtdfKY4YsG0SmPU5QXIdFxotLYfXM3HcPD/fhbFo+9ptHF JIqmgnTMsbrWyppROk0Ff+Ud3binXAj7VVnmfPrFvbNG0RUimTAbkgn7xqA9jFPzFhps +6fRoQcKU5K4nmGU6rvdyS/HatAAeVLmgfjdTrffV8BrbRj2UFOFegGQpuXdumSREyUa aYW98a0SdZ4pzU/FOK1ucAGgegKt6nvhiwJTF7BjSqU7hkoMoiZE7LfPH6qXFCOWhJdp rhWAYGj724QQcw56CzP57Pz5BUIGd1ozWb2G23IkQEDDZJWy9YiIVd2xNZ5MTHC47wL+ 27pw== 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=isWU99zMSOEnAE1RSfFCfmsXaFaInKvayEoBiTZj20E=; b=qNa4kIQ6USjaHeC5akXJJlbSpqWeNQ7VtfdtstLSSMY0yd7kXmOIfMbmBM75h9nmiY P8aUIwvvnICDGaqD7Fdo0B6IxL46lzhZ/n26SP1Tvw5GfFNjqUSX+Z+R8bfPWv2oNshk u3IF5GnR0c8exhquAs8kgX/jNumDJiKsqvhDHSa4dc3wLL3+C9ENy+eFO0eYAfA0ow1W 60EL7dkPKTP56L0JOQVihaWde70dPHDCTc3355KrTdPraryggRZzN08ccD6MvbllRj2u bW29p7UldG2MNkulxFHPcHJKkxrXSKm1ARFbww8erGsDaW6jXN+IfIjN5dK+EikGnQlX pvpQ== X-Gm-Message-State: AFqh2krZkBTx5J4HVJW81FIuJHL+f1/H+nvy8TybwruYGQBW8mLchDjr xjmsnutSIIOxziFMyb68VLuVAJAGULtayRN5 X-Google-Smtp-Source: AMrXdXsZyfMt1/y4wc/Y6kyWeWcByIIAcruhhWKCl+j5eFAdHmFpytSMY79A43/l+pgwU6DLhaMHuA== X-Received: by 2002:a5d:688b:0:b0:2b3:b393:181f with SMTP id h11-20020a5d688b000000b002b3b393181fmr9793185wru.56.1674140355207; Thu, 19 Jan 2023 06:59:15 -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 07/11] tests/qtest/migration-test: Build command line using GString API (1/4) Date: Thu, 19 Jan 2023 15:58:34 +0100 Message-Id: <20230119145838.41835-8-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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1674140405633100001 Part 1/4: Convert memory & machine options. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/migration-test.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 6c3db95113..7aa323a7a7 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -582,6 +582,7 @@ typedef struct { static int test_migrate_start(QTestState **from, QTestState **to, const char *uri, MigrateStart *args) { + g_autoptr(GString) cmd_common =3D NULL; g_autofree gchar *arch_source =3D NULL; g_autofree gchar *arch_target =3D NULL; g_autofree gchar *cmd_target =3D NULL; @@ -601,6 +602,9 @@ static int test_migrate_start(QTestState **from, QTestS= tate **to, } =20 got_stop =3D false; + + cmd_common =3D g_string_new(""); + bootpath =3D g_strdup_printf("%s/bootsect", tmpfs); if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { /* the assembled x86 boot sector should be exactly one sector larg= e */ @@ -644,6 +648,10 @@ static int test_migrate_start(QTestState **from, QTest= State **to, } else { g_assert_not_reached(); } + if (machine_opts) { + g_string_append_printf(cmd_common, " -machine %s ", machine_opts); + } + g_string_append_printf(cmd_common, "-m %s ", memory_size); =20 if (!getenv("QTEST_LOG") && args->hide_stderr) { #ifdef _WIN32 @@ -674,33 +682,27 @@ static int test_migrate_start(QTestState **from, QTes= tState **to, if (!args->only_target) { g_autofree gchar *cmd_source =3D NULL; =20 - cmd_source =3D g_strdup_printf("-accel kvm%s -accel tcg%s%s " + cmd_source =3D g_strdup_printf("-accel kvm%s -accel tcg%s " "-name source,debug-threads=3Don " - "-m %s " "-serial file:%s/src_serial " "%s %s %s %s", args->use_dirty_ring ? ",dirty-ring-size=3D4096" : "", - machine_opts ? " -machine " : "", - machine_opts ? machine_opts : "", - memory_size, tmpfs, + cmd_common->str, tmpfs, arch_source, shmem_opts, args->opts_source ? args->opts_source= : "", ignore_stderr); *from =3D qtest_init(cmd_source); } =20 - cmd_target =3D g_strdup_printf("-accel kvm%s -accel tcg%s%s " + cmd_target =3D g_strdup_printf("-accel kvm%s -accel tcg%s " "-name target,debug-threads=3Don " - "-m %s " "-serial file:%s/dest_serial " "-incoming %s " "%s %s %s %s", args->use_dirty_ring ? ",dirty-ring-size=3D4096" : "", - machine_opts ? " -machine " : "", - machine_opts ? machine_opts : "", - memory_size, tmpfs, uri, + cmd_common->str, tmpfs, uri, arch_target, shmem_opts, args->opts_target ? args->opts_target : "= ", ignore_stderr); --=20 2.38.1