From patchwork Thu Jan 19 14:58:35 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: 644084 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp256807pvb; Thu, 19 Jan 2023 06:59:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXuiGRLYYHJLoSttnjNwuglwIU+KwrSe4UmL5H7FbHBnmGHjj9FjCAPcRxCVxVraDxG8fjAj X-Received: by 2002:a05:6214:440c:b0:534:98d4:f43a with SMTP id oj12-20020a056214440c00b0053498d4f43amr17615441qvb.35.1674140382583; Thu, 19 Jan 2023 06:59:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140382; cv=none; d=google.com; s=arc-20160816; b=p6hmLfns4yRX+7y/hCLRWpmbTd8UO934lbzpXTB9MuUdbRZ20KMR0Ggc6PGWY/B97r a05NI2Pc1HzIrInbSeq0EZjWgYgmfzpFp46KJ8bnKMXRnuztzU0QBl1YHKdJO0lzcqMh 3Fdqb/HCi8CMKATx/gX800xb+O1EdbOHaNF1K+gg74+/JjZzzxrHUKb6OdbwXIBgN7+/ Z4NcQpc6qRrQubDAK/aZj5Ha2pQSViXuW+w014BhVR6DkFqG+WuAmeTHCwlOuGgEgkmt y3/jjjcSYqPDF7DqqozEYAfVdlNcsf9evM95UmHjd2V92lVBSgOmdwFn4UEaUa1HBTjf s9KA== 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=aVTTnz/8fSE8XqVbO+igHiEnEik6rCIbqSZyBrV0w2w=; b=e+2m8dMbrf5wp9ChYy2QGUxSDKPumg0/3BcPqUO6AGxH62yj4FWqZLeQBusWXvQ4xH 9wTXUPqQ/F4b1y9NfNa5vLXi7JDWCsjTR9tkdadxbqPwHWRRmkSIAq0LZHgCuowVWvJC E/bDrX/EiRVjR8pRDSDf9FQStgxlxj3h7Sw3GILPddkuX5SrlmhLSrBa5ErvL1xd/3Xv +VGtbDn5SLquKllDOs1xd8hLJTzSL+jri9RT1fkNaPN8Y23rFujUh8RKPMTcYFWjactP +g/dqnWj5VAsES9JibY0PaTOzqNl1vTz58Msnvx1+/fmHCBgC6GFG3EJfiZXG4TMhyQQ vl4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Uejqy444; 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 iv5-20020ad45ce5000000b005351d4b7bbfsi6967151qvb.263.2023.01.19.06.59.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jan 2023 06:59: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=Uejqy444; 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 1pIWO1-00075K-De; Thu, 19 Jan 2023 09:59:29 -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 1pIWNx-0006gn-BL for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:25 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWNu-0003bJ-Fg for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:24 -0500 Received: by mail-wm1-x330.google.com with SMTP id j17so1784130wms.0 for ; Thu, 19 Jan 2023 06:59:21 -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=aVTTnz/8fSE8XqVbO+igHiEnEik6rCIbqSZyBrV0w2w=; b=Uejqy444UqX7cdhXNIAv9Z+kvBZfLPRiY1oZLhzkEiCBh9JSZqO38sThLjAsSsfCRS 6DOvBfEQVslvU4J/3tdNNfeSsNR1K8wQhopccQbmumHQ6HXr8P3CLYDM/vMX/3aKL7lk 7wCjjLMEbrSsvxqFSYVOavtuo7YvK/CDI4kK/Z7Ia628bPPVqf/Z4bdV5epBoXiKrtaB lV4XaHtx2nGJ9US5keRbkaPKY3WUuYqtExFg84eOqnJuf8w9Wes2IDmZxsfEZHYmio6N sH/0SMl6GrEmWqlEpoP+mzPIyS9Z+a9xWxekUKM8m+uCPR12wKhK1SFnsbBKATzIPE60 IK7w== 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=aVTTnz/8fSE8XqVbO+igHiEnEik6rCIbqSZyBrV0w2w=; b=VSOrGurmz/CM5NudhVynNgDCbQ8YdNpu4Hz+1vb7Q/uAb1N7HAwaguN4WcPwAEM0s5 sIDXP+f/rmxAYf0XthSYm6x9J/Kgn4LeGEtsK0NP8O/L77yBi06xuMIZFSF3ct4MdXsR MA9oFIhU8aWPam96bnYo8sXl1wmA+IDqBUwZc6e22fN7fOucEEBmctsk4HvewJIbiRR2 Lqeeym08CFiNso/+nW2QI21NJM3HLdAI1rRCjXfQGqSfhyUE+IqfDLUworkgCHJGPZYQ L0h4eMvHFAFZy3FU1NOtgvuf3OKLrNqplPa/8Pyb5NHJQ31hl1bWy3wUNUczKDvqtMTd SHyw== X-Gm-Message-State: AFqh2kooGKHJGjUiG+ByLmrNyi6hiBmXVMUDBJeHWdOgi+VubGOVLdMA QP0WjFURdEw9mrSFuWOKMtoKySuuqTovL+NP X-Received: by 2002:a05:600c:1c23:b0:3db:b9f:f2e with SMTP id j35-20020a05600c1c2300b003db0b9f0f2emr8947227wms.14.1674140360169; Thu, 19 Jan 2023 06:59:20 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m15-20020adffe4f000000b002bdd155ca4dsm19683454wrs.48.2023.01.19.06.59.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:59:19 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 08/11] tests/qtest/migration-test: Build command line using GString API (2/4) Date: Thu, 19 Jan 2023 15:58:35 +0100 Message-Id: <20230119145838.41835-9-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 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Part 2/4: Convert shmem option. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/qtest/migration-test.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 7aa323a7a7..8377b3976a 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,11 +681,10 @@ 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, + cmd_common->str, tmpfs, arch_source, args->opts_source ? args->opts_source : "", ignore_stderr); *from = qtest_init(cmd_source); @@ -699,11 +694,10 @@ 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, + cmd_common->str, tmpfs, uri, arch_target, args->opts_target ? args->opts_target : "", ignore_stderr); *to = qtest_init(cmd_target);