From patchwork Fri Jan 20 08:23:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 644629 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658407pvb; Fri, 20 Jan 2023 00:25:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXtm191NU1i/DNHqwjTV/G7WW64JkD+1vlYnaU/thRQAdDt9QgSkcY4F4t8c1bZJ/SVPyAwG X-Received: by 2002:ac8:664a:0:b0:3b0:b9a4:b25d with SMTP id j10-20020ac8664a000000b003b0b9a4b25dmr18524676qtp.67.1674203142302; Fri, 20 Jan 2023 00:25:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203142; cv=none; d=google.com; s=arc-20160816; b=LNPFg8UdL6WrdWq1kok6oAx1hXWxxtyiFhWcqavbvfVhCbx7Ln70ZitIdmf5u+LR1L sRoPcmydrOrfLfJgLjsRWxH10vicwWd8HV2GqlyJXp99SHswwCEI0RIHuEucG07mkNJB DJRy8Y/XmYCwh3gWpqD8T0qE7yT/fqUE8KfIpArQN/LXol8u2B82H91J4FpM9/dfxGkN 0mzsV5rWrhehB/RjXmXSdc3u68ck+kintMVDMQpBq/HjXVrXQjNS4w8EBs4QVjF1gIc8 TVjG9sbGz4O1/DuGHFemOO/qhKsYPgCuKCNe20FbpBCVT0DZgueBC68GdWRl+MzLvYIb srbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lFLQeKMXh/hwQNy/OTcwcNWvQl29Jep2/8SFzcZ0GJ0=; b=Ge88/xAaazOZutXd/zWxOQw810m9k3FeuDQ3YjFi0p3qlhePR5goXA2j5nTdAT5rws Wutk3FxjYPKYsYniRYV4hkysF3Zo8GZM6xrdcT3n3zyRNLoexdHQAezRHRtEN8BbfWfH cbBKj6RM1N8S9FAKoOV93SCSR+2W2Hw/iknhVrAqeUQluvrSmBD8wOxPdSaMsHLpwyvH J8J5N57r0VO1vTDLXLzeYM/qmQMpgdHQv+x8mbpzi7KyZZG7JKJ5YErczJPHUox7Q5CN XRNE72BNGYpWHRaLZVe6h33aEw7Aflo35q9IOoVmob+DXWy+Iq3YIXLoNjEmooCKT76d dHrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IF5pz5Ep; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u13-20020a05622a17cd00b003a542aad5a7si10560432qtk.697.2023.01.20.00.25.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:25:42 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IF5pz5Ep; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pImhH-0004tm-Ua; Fri, 20 Jan 2023 03:24: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 1pImhG-0004sL-Sl for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:26 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pImhF-0004er-By for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:26 -0500 Received: by mail-wm1-x333.google.com with SMTP id f19-20020a1c6a13000000b003db0ef4dedcso5272144wmc.4 for ; Fri, 20 Jan 2023 00:24:24 -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=lFLQeKMXh/hwQNy/OTcwcNWvQl29Jep2/8SFzcZ0GJ0=; b=IF5pz5EprsFwFttDnqA4mYpz1vqAulCqFdgm1415c/oQai+BOzDMRJ+lSz+uQSveBj GtzmEx/uiLWnAmp6lWJkD3OIWcKGplUAWSNz7WAs1r0Euw/ZNmRkIePLJybTW1YSvX5k AZhQbrcZ+lAxtUR372TG6VIZ9hwEJPWg0Apml16OxxQ1UDE5m0nZ6yyLR0aM6HOg1Yjw lEuzCwKmXxbPnKoQDE+LmtqJWR4KfOwV7QU9ePwYV71SqUCOLhVUNI8G/XpsgQAbmX9z CWrymwzf60FnSeRQP9q0Eg106RlosCXMD+KUmvsbeWwSaUveM3QwmR8LOIvzSBrSAPb3 eeAg== 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=lFLQeKMXh/hwQNy/OTcwcNWvQl29Jep2/8SFzcZ0GJ0=; b=Wz8Kp/yK7ocbfJutF65Q+aKCz5erKLCDJMs9i3rtJuCpzGn2mMuCcMDtxM3I16T8LD LvYOIZXLmeX2UhPVLSFpK0P52ptvnG1l4UOY8Cp0E9FJ2Akne/cOG69ztJ2Xfq7l9cib 7olD8JMYRPAu0/6aQfjCTDgLBXuah38w0329Upjz2WtQUj5twGjYndPzKpworOOg/Ctr ziC2MDnZ4RNtv7iZdViK3YTLPnYWsS61ue8bSRvmrtMfIRiRWkJ2fliL7k4DB+PP0M2D cvIvBSe1Rl/nI0xLs1bHPXVd3wOIHbADipbh9ogt/bwYpEJ+kjUB8Z2rEnjU9nct4Ash 9qfw== X-Gm-Message-State: AFqh2kpLWH2EZCfSpIsmQlhkoJOUUZun9NVqBp4hGwLEsyyRvDMbvy+W 4Ra6ydTHwcXF1e29YtvFXfmKJEgipdC/s9MX X-Received: by 2002:a05:600c:1d05:b0:3d2:3be4:2d9a with SMTP id l5-20020a05600c1d0500b003d23be42d9amr12725435wms.20.1674203063879; Fri, 20 Jan 2023 00:24:23 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n42-20020a05600c3baa00b003d96efd09b7sm1731671wms.19.2023.01.20.00.24.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:24:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 08/11] tests/qtest/migration-test: Build command line using GString API (2/4) Date: Fri, 20 Jan 2023 09:23:38 +0100 Message-Id: <20230120082341.59913-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Part 2/4: Convert shmem option. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela --- tests/qtest/migration-test.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 9cdef4fa65..670097a956 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -588,7 +588,6 @@ static int test_migrate_start(QTestState **from, QTestState **to, g_autofree gchar *cmd_target = NULL; const gchar *ignore_stderr; g_autofree char *bootpath = NULL; - g_autofree char *shmem_opts = NULL; g_autofree char *shmem_path = NULL; const char *arch = qtest_get_arch(); const char *machine_opts = NULL; @@ -670,13 +669,10 @@ static int test_migrate_start(QTestState **from, QTestState **to, if (args->use_shmem) { shmem_path = g_strdup_printf("/dev/shm/qemu-%d", getpid()); - shmem_opts = g_strdup_printf( + g_string_append_printf(cmd_common, "-object memory-backend-file,id=mem0,size=%s" ",mem-path=%s,share=on -numa node,memdev=mem0", memory_size, shmem_path); - } else { - shmem_path = NULL; - shmem_opts = g_strdup(""); } if (!args->only_target) { @@ -685,12 +681,12 @@ static int test_migrate_start(QTestState **from, QTestState **to, cmd_source = g_strdup_printf("-accel kvm%s -accel tcg %s " "-name source,debug-threads=on " "-serial file:%s/src_serial " - "%s %s %s %s", + "%s %s %s", args->use_dirty_ring ? ",dirty-ring-size=4096" : "", cmd_common->str, tmpfs, - arch_source, shmem_opts, + arch_source, args->opts_source ? args->opts_source : "", ignore_stderr); *from = qtest_init(cmd_source); @@ -700,12 +696,12 @@ static int test_migrate_start(QTestState **from, QTestState **to, "-name target,debug-threads=on " "-serial file:%s/dest_serial " "-incoming %s " - "%s %s %s %s", + "%s %s %s", args->use_dirty_ring ? ",dirty-ring-size=4096" : "", cmd_common->str, tmpfs, uri, - arch_target, shmem_opts, + arch_target, args->opts_target ? args->opts_target : "", ignore_stderr); *to = qtest_init(cmd_target);