From patchwork Thu Jan 19 14:58:28 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: 644085 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp256814pvb; Thu, 19 Jan 2023 06:59:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXsBgj35s8j6cOMVtduZbsxU1hKnW36hleqeNqG6PcYMOWTafj8l81wJwilZOjIwPJDoE1a1 X-Received: by 2002:a05:622a:40c4:b0:3b6:94a3:b0e7 with SMTP id ch4-20020a05622a40c400b003b694a3b0e7mr1261819qtb.34.1674140382796; 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=wBUK/EWfu1gayQ7GtJm7ZTPcGZ3XqMrgz4APO/4V4PRiCC3QlGQ2RZSaG7x/CZDosL bYYpG90q2DFlBUIsxkAnakj0zA565bHnbnRgdGUY/WK92Zwjp71xLaCzCngShPy9FJqq tvtXUeeXNPgfRrylkB3opreYPNPBxDLsOj20jns5CAYuYbf4LbCZLfB8VJfDG6DDUh4n irZkHgkkgpJIaKRGcmjp9qwANroKIEQqPaaHeleRKTum/idZhj5OdXIepwtJQrs21uKk i6sntkavAa8wlbR0CIgWU8w87fER4zF5IfCxbrcV16zfCLS3SjY2ufvpHKUweZurEySY 3FpQ== 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=lp7QBocGltbT5Ch7Xv6lzQ/CjEgDd3cHtWRpI2qpHEo=; b=L1GDRKhmOXnj5mJzTxONb4sEVkYWofPNESVDkvEWr5oZvf6HsXcGSdTIiSKuetXlyz KUHDz5NHysecCeEBS2vHaJuSHuANhndauUVl26HgE06KkDvXK2qwlYP4gJG48Nmd8RWx p9gCjkdBTy+kGn97pAgjXVeILFLzeBEfXlT0+E6DQcGOegPvLbJR0qWTxB1NGyX3hPpW tqfn/aLisa6PaE/47QBRrhOcgWkIUNZe6jbjKFjBpXi6s9SvwMwA2n737E4N1hMElefA 4rqXqjbXU6SqRasRIaeftNxf5kvijzMGtWXdB/EhFX8RzkSOFQ09zR0x9dzQJw8Z7TNR 8mDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yw0+mx5L; 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 bn9-20020a05622a1dc900b003a81551fa60si22878619qtb.181.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=Yw0+mx5L; 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 1pIWNO-00062R-75; Thu, 19 Jan 2023 09:58:50 -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 1pIWNN-00061w-7g for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:58:49 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWNK-0003XB-PB for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:58:48 -0500 Received: by mail-wr1-x435.google.com with SMTP id b7so2144137wrt.3 for ; Thu, 19 Jan 2023 06:58:46 -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=lp7QBocGltbT5Ch7Xv6lzQ/CjEgDd3cHtWRpI2qpHEo=; b=Yw0+mx5LwzWzLqJ65ihZ/F0XociSAqdvsH9CUtFT8zxSAZwHDKKtQPZvOkIT71MloN mi3AcikjmPT4Ir59uwycmOBYAjNJbU2OjAn08tOjgbDFWPdBKzi/R9SKheCOYNrYzQ0z 48viT7/et5oIehZUboxHDeK/nDV/OpXDGrNeE3GjFGRjWvl4CDbNdlnOuWCDWoDwcLOQ QsoEOpIXeWjjMYb0TSHZdhQ1+9SYhhyU/TpkkM8E2ZLtuocus3HaOnKlxKpR/T0L4ci8 sQJExcmh6obfAlITQNo87MGz5C5EriP24LjeCQJbK5XD1L60hoABtRa7hPiGf4Mo1D8a cy4w== 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=lp7QBocGltbT5Ch7Xv6lzQ/CjEgDd3cHtWRpI2qpHEo=; b=lk89xQT+CWajy8OCdbrIIqCvkuwdJzalC8rvZq2y5j7pKVxV8SyZ/J6yvCjFiyyvWl IpT8220ExVSN50kVVlYgx0aO9D+d0Qa6z2iVRZfwgdivW5hQxQJIB33zUrRCOCABtFXm Q6IFLhA9YsWTh5E3O/f1jK10ki6wu1RHtBtq7VuSwdEVrY0bTXKv288mYaW5R0u0ojwb T7g/NkWmbongh0j6Q63PNGM2nREVmTficGHVemQh6NhGKbYajjCvbEUv3tK6YdTdRmU0 qWHdOMwJlva9hXO/2PWJ9AlWCvLlud/ClBxDuvSO2duFUmMb8DMpq0+fz3Eo8q36aNHo rv3A== X-Gm-Message-State: AFqh2kpwEnHyMim4/ryT+8pvFocciDiR7wTMAvernR2ve3h8ZkcQq9fC IjofFt+QEHoMVxaRaQx+HMjF3QMk+9A30Nxe X-Received: by 2002:adf:f642:0:b0:2bc:846a:8ea2 with SMTP id x2-20020adff642000000b002bc846a8ea2mr10492523wrp.4.1674140325209; Thu, 19 Jan 2023 06:58:45 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id u18-20020adff892000000b002bded7da2b8sm14136235wrp.102.2023.01.19.06.58.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:58:44 -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 01/11] tests/qtest/boot-serial-test: Constify tests[] array Date: Thu, 19 Jan 2023 15:58:28 +0100 Message-Id: <20230119145838.41835-2-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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/qtest/boot-serial-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index b216519b62..3aef3a97a9 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -139,7 +139,7 @@ typedef struct testdef { const uint8_t *bios; /* Set in case we use our own mini bios */ } testdef_t; -static testdef_t tests[] = { +static const testdef_t tests[] = { { "alpha", "clipper", "", "PCI:" }, { "avr", "arduino-duemilanove", "", "T", sizeof(bios_avr), NULL, bios_avr }, { "avr", "arduino-mega-2560-v3", "", "T", sizeof(bios_avr), NULL, bios_avr}, From patchwork Thu Jan 19 14:58:29 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: 644083 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp256715pvb; Thu, 19 Jan 2023 06:59:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXs9a4B7szBmi51kbHMosMNbSMj6lau1Ejs4E1mYkJiTlCDrakaF+nom59lcXcif2DvNAaUC X-Received: by 2002:a05:6214:5f87:b0:534:61a9:6f60 with SMTP id ls7-20020a0562145f8700b0053461a96f60mr15307109qvb.18.1674140371712; Thu, 19 Jan 2023 06:59:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140371; cv=none; d=google.com; s=arc-20160816; b=eRSQ6nRkVMf8Re3Nm6b7ayhZ3K1XPo0fH8JK3XTyaxmY3QfWT/oLQ0s+IwvOQeL5pm 1KovwgGDaFfQ0kay6qRV/eDm5Udshf2mSzfWYMq6n7iPTOJ0zfdHl/FlVXU3MvSBV/bO y/ufAwea6Nanp7+l0+FQfEKie+gwsDYFk7NV6B3IFOvg6AAcMx6ZFtJ57FHPwbQoqzuf bvJOVL8eqJ2mfNDBNw1MbJ5pCD+eCwQdjs6sDBwOjbz3k7eeHQOVJKd1jm1+xPoQ6v+7 ihYRSHe7h2olq0HSbZWednl6+HaAeUFD4fzuaRGzqXrh7f3sG+VdoGdDdQ9Eb9+Ht1eW KU3A== 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=Dbql9l7vSKPentsKxfsPytXlVVV9PrWNWaeeTqrtx+A=; b=w7OH2UtRB7PK4bZE9nvkz91Zw4YI9tCbSg7Nnzpyk/DrQFCH+9ry8K34U505mZvWGI 5MQaP5tIAKa9/msLHJTHfqZ6zcLGH79TK7RjnMg+Dl16jti2XlghZ4oWXipDdNMbC3rd uWdbVtTpL2eQ0xqsBaYOT565gVhM1Huy+ct8QMbcWdA7s8EGjM/Y8zIbgyXFe5BJ/9Vy yybW7L2c8SetHP1mr39TM9EilRe2wddqXPAa7KJFfwh26YRfNhYCyhOSj8vGxfclrY1D 9eP6xzfSCCSNaQhwhGmm0Xa1SaQJ4MI3icFdWXjWqbty/rEm5pHrpWb3BnDqaUucZKya sjIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oEOk9AIQ; 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 6-20020a056214202600b005355c76d48bsi295869qvf.537.2023.01.19.06.59.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jan 2023 06:59:31 -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=oEOk9AIQ; 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 1pIWNS-00066U-Fg; Thu, 19 Jan 2023 09:58:54 -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 1pIWNR-00065I-7z for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:58:53 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWNP-0003Xh-Ox for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:58:52 -0500 Received: by mail-wm1-x32d.google.com with SMTP id o17-20020a05600c511100b003db021ef437so1455828wms.4 for ; Thu, 19 Jan 2023 06:58:51 -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=Dbql9l7vSKPentsKxfsPytXlVVV9PrWNWaeeTqrtx+A=; b=oEOk9AIQ/Fvj26tENwefQ4Gk1I/NGhdiZwSqLMwxte9ZzMTIZAKIgE0pXqFONYj2gq FBw0altoZ/+Dc6qpuF3XQFDmPdqPl1EtLggluXdCwy59w6lp9a9fmTtfLYAAkDFz+p0x +8PGA0AXy/NPs4dsh9ZhAO7Moqmt31MLqkafg0QNMGpPwcu3GwF5oZjUb4ajojO1plEo U17DUwgu1GN0dU1FgDzHiMXWkCQPUdE18u/gjClQxzFAv0AUD8y7Q2gEaB0/KNMlucCv nOVmyeyTO0SSKJ4OocqNVWHkjCkMlLKpqmV1Q+XYEPIXiP2FKSZPz1xG9ispuXd2BPxU 5gMg== 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=Dbql9l7vSKPentsKxfsPytXlVVV9PrWNWaeeTqrtx+A=; b=dQVbOALwtwO0Zu648+TuWDNrMkyLAOY4aezO2PiKlu5m+HgEAnUh8MGzDs9KF9wLL+ wZRPFXrQD2goG9Nh5TQrkSK9L6vema+wmS9grOmTDma3P4pEeHN2Jhc4v1hbF4PPd2un u5ZSP3ATuSeHsXosqSfcjS1MXuEO47OhhE0B5FIJTZDSEv/jLSpR9vVQnrHkbxax3pob a3j1a2mIJOP13Alb2IbCwlF+hc2vyLAAbYU3cOkXTBHME+UMXM0X+IpFxjV36Qrq/Hzx inqZMI6i14zA7H6aT5ShZS4OsG+YZDakAsa5eff1fuw1z/CpHfW9CPXc3xuNVnnDqFNh dxcg== X-Gm-Message-State: AFqh2krMzgzQQwuDwh031ogRPGBH7c4jz89wGLJKoub/JE6nTNLnNM6H 2f04ELd5u4KflKxpBWljatz7CjEen6PHvd4f X-Received: by 2002:a05:600c:4b0f:b0:3d6:2952:679b with SMTP id i15-20020a05600c4b0f00b003d62952679bmr10446693wmp.34.1674140330223; Thu, 19 Jan 2023 06:58:50 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id ay13-20020a05600c1e0d00b003cf71b1f66csm5521830wmb.0.2023.01.19.06.58.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:58:49 -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 02/11] tests/qtest/boot-serial-test: Simplify test_machine() a bit Date: Thu, 19 Jan 2023 15:58:29 +0100 Message-Id: <20230119145838.41835-3-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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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 Slighly modify test_machine() to simplify next commit review. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/qtest/boot-serial-test.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index 3aef3a97a9..3a854b0174 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -227,7 +227,6 @@ static void test_machine(const void *data) g_autofree char *serialtmp = NULL; g_autofree char *codetmp = NULL; const char *codeparam = ""; - const uint8_t *code = NULL; QTestState *qts; int ser_fd; @@ -235,21 +234,13 @@ static void test_machine(const void *data) g_assert(ser_fd != -1); close(ser_fd); - if (test->kernel) { - code = test->kernel; - codeparam = "-kernel"; - } else if (test->bios) { - code = test->bios; - codeparam = "-bios"; - } - - if (code) { + if (test->kernel || test->bios) { ssize_t wlen; int code_fd; code_fd = g_file_open_tmp("qtest-boot-serial-cXXXXXX", &codetmp, NULL); g_assert(code_fd != -1); - wlen = write(code_fd, code, test->codesize); + wlen = write(code_fd, test->kernel ? : test->bios, test->codesize); g_assert(wlen == test->codesize); close(code_fd); } @@ -258,12 +249,14 @@ static void test_machine(const void *data) * Make sure that this test uses tcg if available: It is used as a * fast-enough smoketest for that. */ - qts = qtest_initf("%s %s -M %s -no-shutdown " + qts = qtest_initf("%s %s %s -M %s -no-shutdown " "-chardev file,id=serial0,path=%s " "-serial chardev:serial0 -accel tcg -accel kvm %s", - codeparam, code ? codetmp : "", test->machine, + codeparam, + test->kernel ? "-kernel " : test->bios ? "-bios " : "", + codetmp ? : "", test->machine, serialtmp, test->extra); - if (code) { + if (codetmp) { unlink(codetmp); } From patchwork Thu Jan 19 14:58:30 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: 644093 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp258280pvb; Thu, 19 Jan 2023 07:01:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXslbZGiNq5wFSbgJ8EYnw8EX38IEAfQmZsg5rKTx0luRtWa3iJHJL3e82hls9fEzHW/DDAB X-Received: by 2002:a05:6870:ab14:b0:15f:6a0f:7fd4 with SMTP id gu20-20020a056870ab1400b0015f6a0f7fd4mr5396976oab.24.1674140500054; Thu, 19 Jan 2023 07:01:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140500; cv=none; d=google.com; s=arc-20160816; b=y9uKs7dO5u8pvA9acjb//sgCxuTafzYQuaFkua5HRG1/2ZfeWp9jnOSehWS8icLNnF NiHnyGk+NZL1PSFfPbQZ1kXXdHTwgdu/6+y4rm97ELlq9KkvI4oYy9EtcXSc6X5XvsuW SUstbZA9Q1psg/VlA1XTu9dqu/YdAgMiIKO+RxLXt7ps5sxJ294YiB/pI7CtKEdvpL+3 6hSZHHTkvb/cpB3fRO4lGFT6zhdLtMDgXK9Oqy5/uQgvo+gYCYRqb6BQhbcAx6tLaJXm c7+SLfa96n0ecHi2e53n6Plft1syoh1EDVnCU3Cc13MaN/Z+t/3JP92cVikkEsIUeKcK Irmg== 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=es3Dw8MLiqLXATzoVsMpPJx/0iri3aBMV7qIVLaAL/4=; b=wUhaRoJNlQcRJaxLJxlnOLL/oJkEkfUaKWW5zYQ7HjDEPVOeCvmHbjwTu/x2LXvG6r Vx3f0ZuIAQL+Jpfvozq4879F9PA+gxcZeizqlmR5fqCKrFYCzm7KcU/4cZQypVxW9C0C Mr9OqLOYWrre4EeSs+sud9HKgKAR1Uh4v685dQ5ZaKRqctpLtuhhgzw8iIsfAodTKPp6 KCthuxr6e6qqIhy4xMFmPyXakd0Ce4RzK+PZK14MRYY8YTyDCDYUoYPhMGs9Nqli2Lis eZtXYzoDakTNBXe4tmrelVuUBmzk9OALlWEiRVup71CPc/l6wt9vMEZuNLSZ7IrqWJK4 X8zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s0S64k3Y; 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 x13-20020a05620a448d00b007067c891977si7532428qkp.235.2023.01.19.07.01.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jan 2023 07:01:40 -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=s0S64k3Y; 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 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) 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-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) 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) 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 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé 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 = data; g_autofree char *serialtmp = NULL; g_autofree char *codetmp = NULL; - const char *codeparam = ""; QTestState *qts; int ser_fd; + g_autoptr(GString) cmd = g_string_new(""); ser_fd = g_file_open_tmp("qtest-boot-serial-sXXXXXX", &serialtmp, NULL); g_assert(ser_fd != -1); close(ser_fd); + 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 = write(code_fd, test->kernel ? : test->bios, test->codesize); g_assert(wlen == test->codesize); close(code_fd); + g_string_append_printf(cmd, "%s %s ", + test->kernel ? "-kernel " : "-bios ", codetmp); } + g_string_append_printf(cmd, "-chardev file,id=serial0,path=%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 = qtest_initf("%s %s %s -M %s -no-shutdown " - "-chardev file,id=serial0,path=%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 = qtest_init(cmd->str); + if (codetmp) { unlink(codetmp); } From patchwork Thu Jan 19 14:58:31 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: 644088 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp257033pvb; Thu, 19 Jan 2023 07:00:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXuLilmrn75Rz4JBHJQP7yYE9KGJOH4/027nFq5EHZ3ACkGHrk/T8aVhWNVZNGMauoYwCplp X-Received: by 2002:ac8:71c4:0:b0:3a7:f3f0:483 with SMTP id i4-20020ac871c4000000b003a7f3f00483mr13877786qtp.60.1674140406520; Thu, 19 Jan 2023 07:00:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140406; cv=none; d=google.com; s=arc-20160816; b=pY5M4vQ0zJMTnK/qt30lhvaSC9sA3x54NMqUtYI8HNZDk1m/W+30QGnUKQRxTi7D0q xuYa41KlJRMTJIjdXcKyFHu/QBywEWYpWKxXDrE/tOVVyM+9Vryt/0P446AnZmRWz9/V cVrCK0Qb5UzeK84HV5B57K8P2ohkZm09PsAZgFhl/0tfhtI2hax6hrFdFNLpkDcxOZlr 2DgEEPyqE2PpJBYc832MvAWPeA+my4zwXsZ8NLhxpQfsENW9MRez75QrAU5s0+EcUOV7 yTMQYrVdtI708UOHrZwOhzrS6NJWqXoiojx+95MXLQN9a2J/tMOLTVbPsvgw3mCCf569 Qtuw== 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=CThcQ4IXwzbhuIEPH7wu+o1eE9qqn2LCOFCtuelW+qs=; b=DNc3f01JvTWRrA4F1tDMJtFqw+3ynK2E84xniTauHrZmyKAHawAKEaSWXMcqp3HCcH lhOOugiyvjo0HRL/60QKZYv9pI+EKlLAFMJSJcnVhhlYmr0SW2hX0MU4/0r1V7fZuk0x yok74PK9qEO5R32o/3ckFxx7M1s7pYji+jAUTuQH81B7yb9Dxv3Ufy/1+25Mr/+a3drQ H++znybxDQVLWoRUOSN4lXN6wHkvVwnTzDH5I0rnXr1Qdh24gOP4MReSurMDVYUKP6HX M7L/3ykCygPpoaipGXeTcNxQuR7yced1/uuryCYtIzC6kqbGoTqlkfR/Fs75I75NqGd7 Cosw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eoQBug3d; 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 z1-20020a05620a260100b006f8a0f33593si22826825qko.319.2023.01.19.07.00.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jan 2023 07:00:06 -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=eoQBug3d; 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 1pIWNc-0006Fz-VY; Thu, 19 Jan 2023 09:59:05 -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 1pIWNa-0006FZ-QU for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:02 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWNZ-0003Xh-5j for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:02 -0500 Received: by mail-wm1-x32d.google.com with SMTP id o17-20020a05600c511100b003db021ef437so1456122wms.4 for ; Thu, 19 Jan 2023 06:59:00 -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=CThcQ4IXwzbhuIEPH7wu+o1eE9qqn2LCOFCtuelW+qs=; b=eoQBug3deQoyR+Jfv0vaED0GlQGC5kNRSzN4lBMPYsNU1mAzqbi8ZVvMpbok2KB1kq D/w1Qjuv6V21C9ScLlk2lJwfzcp2CoFKHTgGfad4rd0R229bqIj+JA0U2+g7ud4Xt0OJ iGPbGQkKlkDfNvDftYSymT9DW/cJN/wXxUscQTaumWncryWR3RZTN0csMhLpOlPQYbQe l/NFOMe18pwpkEM3vv8p6R8wCsDvdGrLhobvUjnU0cOvaVo6Q8aKgUmrWCeV3kYHAWtA UAPQg5P33ZYBZ7UuOt5GvrXh0/V7W9TX4JLKDSZkhcKDsouC51UWoSD2tYJrFVoHRpNi i7rw== 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=CThcQ4IXwzbhuIEPH7wu+o1eE9qqn2LCOFCtuelW+qs=; b=KriKsurGOY0P523FJ20y9G7zTscVOvZw+VXdPKHGwxK3ia7ciF2JVhxkUfEmLhdmUE 5KOwRgheKrXvB7+NknHXvMi2bgPOPBE/owNkh6zabqa+eMeZj1qlysesg+rKAVyexIWM QiflzUgTZDgRwtqwAT9bBQVJsONJTjExZD7P6KAF4ry4rzMcR2ykdGqZSoiqzTN4LgGb BvYG7PO39jWSVsJxUlZj5oS3VSvwUVfCmZlftysKozboFlt4EGGqslFbxoUjWfrdjkAB JzC3NSaf5z3URzfmVF7orp4mkha3ghEK9oPxPLRVl8zr/0lfvLr0zvuriCd3ya4ziwyv w8tQ== X-Gm-Message-State: AFqh2kpgpMkbPKiKgN5+Bg7/le9nD+Deje/zx0EjgxNzfbo+UVsdScVM fYVtSdcYwgkRUo+G+rew6FWoVHGfSAqg7qdd X-Received: by 2002:a05:600c:3d16:b0:3cf:8b22:76b3 with SMTP id bh22-20020a05600c3d1600b003cf8b2276b3mr10243748wmb.0.1674140340296; Thu, 19 Jan 2023 06:59:00 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id q24-20020a05600c331800b003d1de805de5sm4793780wmp.16.2023.01.19.06.58.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:58:59 -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 04/11] tests/qtest/boot-serial-test: Only use available accelerators Date: Thu, 19 Jan 2023 15:58:31 +0100 Message-Id: <20230119145838.41835-5-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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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 For example, avoid when TCG is disabled: $ make check-qtest-aarch64 ... 18/20 qemu:qtest+qtest-aarch64 / qtest-aarch64/boot-serial-test qemu-system-aarch64: -accel tcg: invalid accelerator tcg Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Fabiano Rosas Reviewed-by: Richard Henderson --- tests/qtest/boot-serial-test.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index 92890b409d..f375b16dae 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -17,6 +17,9 @@ #include "libqtest.h" #include "libqos/libqos-spapr.h" +static bool has_tcg; +static bool has_kvm; + static const uint8_t bios_avr[] = { 0x88, 0xe0, /* ldi r24, 0x08 */ 0x80, 0x93, 0xc1, 0x00, /* sts 0x00C1, r24 ; Enable tx */ @@ -257,8 +260,12 @@ static void test_machine(const void *data) * Make sure that this test uses tcg if available: It is used as a * fast-enough smoketest for that. */ - g_string_append(cmd, "-accel tcg "); - g_string_append(cmd, "-accel kvm "); + if (has_tcg) { + g_string_append(cmd, "-accel tcg "); + } + if (has_kvm) { + g_string_append(cmd, "-accel kvm "); + } g_string_append(cmd, test->extra); qts = qtest_init(cmd->str); @@ -285,6 +292,9 @@ int main(int argc, char *argv[]) const char *arch = qtest_get_arch(); int i; + has_tcg = qtest_has_accel("tcg"); + has_kvm = qtest_has_accel("kvm"); + g_test_init(&argc, &argv, NULL); for (i = 0; tests[i].arch != NULL; i++) { From patchwork Thu Jan 19 14:58:32 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: 644086 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp256962pvb; Thu, 19 Jan 2023 06:59:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXuMZl6elpXW/Qb0awa8mq1MvNI4F4kG2ov03oDkttl+M5u9Bs2dT+3YX/zSdNyiUvxpDPNC X-Received: by 2002:ac8:718d:0:b0:3b2:4393:62ce with SMTP id w13-20020ac8718d000000b003b2439362cemr15522577qto.21.1674140399491; Thu, 19 Jan 2023 06:59:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140399; cv=none; d=google.com; s=arc-20160816; b=dLiCUxizWCKidhofrdX6O3jJ9Cw9Pe1cocvOXKUbV6spshEz0Q9NYNwL+UHe3BuQvb LBavX+4ZP++DCLlPWd7DP1T2LrDUi6qPCMjZAeVUISKkzMyrkMmxjerLdCVeWqEYnJc3 Eaqb4DOSbgs7EuPMw/wBIz5cmDBCNS5alLUB0VpUmu2fxCW6o50UCOZIy5qDpCe6jLra m8Z80CyajaPC0HJlOQmIqGygkFZxWzAtLwpxPqtK7W7plg4LjPts2Wq1DrvjNK25w4uQ y9FsnlvZMZ584x6c3A781zEZYBU72T08Sw6osBZSCKIfW8slGOI5aSuZhidxhAIguNfG LlGg== 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=9MjqM2w9hw3LWgeDOmCQX9tZeJS1teSf33PVNVZfRuA=; b=AsjcM570g4NpSQi6hmePTv8F7JLqR7YVV5LsjzqX3n7Dvm8JlsS3ti6W1UhqOaPQvf i4R7FyQenlKfs1FnrJ3wOODGBBjYxUCFJgoZdxsvGkagW8PI34JX4hFPkvbyGN7FJC4f 9dX4Ncp+ZHvT3eG8VNikKac1z8fETuc+f/t0nIVo2tRIHHMbnEyOU8+O5j8iUOhGNE8I R9+6EZGPcDfDBcgEvp3HcTukCHJ90CxN/AD/gwg6fp4A4A7FdiWqlMqgJQ421dl9QBMH uVJ/OLaOCZB5VCMsRciSxykkCd171Rk/EqSfvxAQlGcwGgP7yhiyqnYyQ7XVJ5GTOXuV KG/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oGv1leY4; 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 bj7-20020a05620a190700b00706ab1c6e8fsi5147156qkb.542.2023.01.19.06.59.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jan 2023 06:59:59 -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=oGv1leY4; 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 1pIWNj-0006Jw-Kl; Thu, 19 Jan 2023 09:59:11 -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 1pIWNh-0006Ia-Ew for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:09 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWNe-0003Z2-Sm for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:09 -0500 Received: by mail-wr1-x42d.google.com with SMTP id bk16so2113489wrb.11 for ; Thu, 19 Jan 2023 06:59:06 -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=9MjqM2w9hw3LWgeDOmCQX9tZeJS1teSf33PVNVZfRuA=; b=oGv1leY41kTrRW2rwI6qM6gjAqfHsvkfBcPUqeJBS6mrskxptcHLv+f+XSyX1U73r3 zuKKd/4RatU6xOXRNlXg3Ds9U4Uh3ZeWGue5MhL3hOAVohOi+reoHg9aqvhJXh56gdT2 5o69d9eqinktB2+RXaMwt3zFreg6sniGMTK6zB1IeHHtdro/WITVKhhwkqp3gpWY4+3d eyUaQ8qdEas5T8iZmYaadB2PiB/re+O51ATNalxDAvMkvCBz/0iUrct6HNDMT4ECewDh 36yDEiPl/R2h8jpu1rxaHaDvNX+3tJCE8en0rQW508pjijs/qq4+glkuJFPAQc6aV4+N j1uA== 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=9MjqM2w9hw3LWgeDOmCQX9tZeJS1teSf33PVNVZfRuA=; b=QTgy3HjWSo71tFGheoMF1y7C5mePbf5f8lu2ahpa/6HVfgkjDRPlXO0gVCVBFHdWsW Trd8ZxeU9g7rndh6F6IP1jeGMl0kU3ICNUs49SFjmGYSBl1EoNfqC0SbldDf2/iyAd94 iasgh59MHk6AoFYwdF6WmCcRfVYvPoQb4xM/ZBZ5cKJoUlJ8uB+7tHAxfS4aDZVD8mhz d2C8C7PT/wZj1p9UZHtDV/vCcjbEQ6zLWR8odvEa2KbV0Ubf01/Ae7mDIwywGoo8PEDR 41/zsEgZKeHWe2ouEPhilpVKMNuGd9APz51g7zLj1pSRSkCYUz5/bVaGGWBqsCLWXS/O tClw== X-Gm-Message-State: AFqh2kqoSH+sU882ERvtgsZ4qooP4Exg1+VuodUg1Cl6V+qFkWWLUigL ZNbqUrzzDD6Qpi9N8Nq65ir8CQE2CarEUVsF X-Received: by 2002:a5d:6581:0:b0:2bb:dad4:9525 with SMTP id q1-20020a5d6581000000b002bbdad49525mr9162698wru.10.1674140345186; Thu, 19 Jan 2023 06:59:05 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c8-20020a5d4cc8000000b002bdeb0cf706sm14689742wrt.65.2023.01.19.06.59.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:59:04 -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 05/11] tests/qtest/migration-test: Inverse #ifdef'ry ladders Date: Thu, 19 Jan 2023 15:58:32 +0100 Message-Id: <20230119145838.41835-6-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::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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 This slighly simplify the logic, and eases the following conversion. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/qtest/migration-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index dbde726adf..8beeda4686 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -647,15 +647,15 @@ static int test_migrate_start(QTestState **from, QTestState **to, } if (!getenv("QTEST_LOG") && args->hide_stderr) { -#ifndef _WIN32 - ignore_stderr = "2>/dev/null"; -#else +#ifdef _WIN32 /* * On Windows the QEMU executable is created via CreateProcess() and * IO redirection does not work, so don't bother adding IO redirection * to the command line. */ ignore_stderr = ""; +#else + ignore_stderr = "2>/dev/null"; #endif } else { ignore_stderr = ""; From patchwork Thu Jan 19 14:58:33 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: 644092 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp257556pvb; Thu, 19 Jan 2023 07:00:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXuDrAU9C+TPawwXbZVLgV07hQcQ5FFRl8ElA43G4+4x7G51m9Q0dELSMKYkg5drC6jnj305 X-Received: by 2002:ac8:7616:0:b0:3ae:95c:8485 with SMTP id t22-20020ac87616000000b003ae095c8485mr16726861qtq.35.1674140451999; Thu, 19 Jan 2023 07:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140451; cv=none; d=google.com; s=arc-20160816; b=qgjajVh+HncUrZS2cRQXe7R9C8AEtMcJyq3T0yXaM437RNvJpeFQarWYFZHYiL7aUd nk6fB/TTV3CvxZ/8HQGZlpta8CaZ13d9oT2b5s/YQ/TenG+racq2AwJ/TTUoJT/pd5UC lqUR6Q1Anwgq5cNqITj0+PcnF58D4x7p2J5/AnLOoTu768PUe71X3lmZqFA1rKFteLdF xmPmX43fu+thL16ijUIKGdooXao04qQ6mJMFE8p9Dv1s8+FtjJNk/qGDnK1Fscj/xO1h L3UMPVsSNgtkWAYo+DiapKTH7xgdHs1tGPoDUPKgUywLB3nO2PTpzSeqbliD2P63+M6t gjhA== 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=PDdmGNe7wNRYvz5eLda5xFcX55ORUlYvsE0xP8qQXTc=; b=jLrEA/zBOkyYoy71+Z20uWKmc8sAzhFnjzdLACiupFwV199ZSXx0Ps/TsXDIZ3HjR4 5aY0HfqIz7SbKYZ+xuf78nydJqwOG/kyJhMS6FYnfpL8wCA25GdRCl7r/NPVdhY40gO6 rOqBV6NdNylmFHG2Hf899wZWXxAf5TPnGQNnRpywxQCYx6Lv7qXJC1lbSkZWXrfubi+F YInY73H9GHHB2UYiM53XfOu1omxmgKsFyNhfFIksBu8tB0s6MW6cJI6m1/0nT3KoJnEa 0ZMXBG10M351y9qcx6Jy89zLR7J6UDINFBfY+YobfilCpItu1e08wcDNUFH3Wht5Wch5 mdTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zw4gwQNr; 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 j15-20020ac874cf000000b003b0d885a064si1922837qtr.513.2023.01.19.07.00.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jan 2023 07:00:51 -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=Zw4gwQNr; 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 1pIWNv-0006aQ-3F; Thu, 19 Jan 2023 09:59:24 -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 1pIWNk-0006K7-JD for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:13 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWNj-0003Wh-4o for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:12 -0500 Received: by mail-wr1-x429.google.com with SMTP id q10so2152642wrs.2 for ; Thu, 19 Jan 2023 06:59:10 -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=PDdmGNe7wNRYvz5eLda5xFcX55ORUlYvsE0xP8qQXTc=; b=Zw4gwQNr5o6Kb1CTDQ2lJ/6L0sQSdoltMXeOQROzc/aazNjlkEAqvKsWcMnNpJYJ5m Q2noZCyj+jnrdU7FmX40hp2CwcDCpYjNXFPLuO/AqWWJ00rc9+JQJVAA1JMjB/MbaET9 9CWFwCArBV3FF5gUGtva/tfQymhvpRzHopNe+ibfak+7OpG2nd7iY+pBCscDrdlXWCtn lKvZUwtCdOj30zgVwPJzS79zlzUJIxUVTlSKC716vtb9jQ46sUDkEK7wTAEtvzgr+8EQ t8pWA5fO7MOBla4mMdaJgPDKUFXR8Rt1rQ88lb6GlPkUM3e1ZhnuppiKngGXXJVlbwVZ 575Q== 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=PDdmGNe7wNRYvz5eLda5xFcX55ORUlYvsE0xP8qQXTc=; b=BPZ6dbPV+TI1XcWGe/XyaoQenWwY24osvoSwq+C0Hke4kSH+41yOtnJUkgLZyuEsYv LzU05aXzC7c4/kS/pCNRvDRdozWMZDrtaN7dvH4GeJAIJ5pRbXrqIl1ssOXWOFQqrPBL /i6/8DidD/vZF7ls8ntESMxd+VA6nakJXCM9qr3oVhf0w5vVvN60r0XjsnHaFtOHJOdW w8IdpJJdZEXw+olWjwnRNFieDW+Etv3XGcuR4iaw0SRXoufeE9ehCAzzdQHE9aPpYS65 MVetCwMM6+PHGmlwD4fxQwC5ndax55z5GubiA29ZS/gWKWEYfhH7NMmpP1JgCxRaLg3k Hmzg== X-Gm-Message-State: AFqh2koIfrKft1FwaFXG1k3FXvS1hrm5tpWKKYpYZ4tRHBbZ1TvcMegk 1cXYKt7V2QRMHnewHoZ7BOrukxt1iL5/k6an X-Received: by 2002:a5d:5955:0:b0:2bd:e87c:e831 with SMTP id e21-20020a5d5955000000b002bde87ce831mr9074190wri.69.1674140350266; Thu, 19 Jan 2023 06:59:10 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c8-20020a5d4cc8000000b002bdeb0cf706sm14689922wrt.65.2023.01.19.06.59.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:59:09 -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 06/11] tests/qtest/migration-test: Reduce 'cmd_source' string scope Date: Thu, 19 Jan 2023 15:58:33 +0100 Message-Id: <20230119145838.41835-7-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::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/qtest/migration-test.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 8beeda4686..6c3db95113 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -584,7 +584,6 @@ static int test_migrate_start(QTestState **from, QTestState **to, { g_autofree gchar *arch_source = NULL; g_autofree gchar *arch_target = NULL; - g_autofree gchar *cmd_source = NULL; g_autofree gchar *cmd_target = NULL; const gchar *ignore_stderr; g_autofree char *bootpath = NULL; @@ -672,20 +671,22 @@ static int test_migrate_start(QTestState **from, QTestState **to, shmem_opts = g_strdup(""); } - cmd_source = g_strdup_printf("-accel kvm%s -accel tcg%s%s " - "-name source,debug-threads=on " - "-m %s " - "-serial file:%s/src_serial " - "%s %s %s %s", - args->use_dirty_ring ? - ",dirty-ring-size=4096" : "", - machine_opts ? " -machine " : "", - machine_opts ? machine_opts : "", - memory_size, tmpfs, - arch_source, shmem_opts, - args->opts_source ? args->opts_source : "", - ignore_stderr); if (!args->only_target) { + g_autofree gchar *cmd_source = NULL; + + cmd_source = g_strdup_printf("-accel kvm%s -accel tcg%s%s " + "-name source,debug-threads=on " + "-m %s " + "-serial file:%s/src_serial " + "%s %s %s %s", + args->use_dirty_ring ? + ",dirty-ring-size=4096" : "", + machine_opts ? " -machine " : "", + machine_opts ? machine_opts : "", + memory_size, tmpfs, + arch_source, shmem_opts, + args->opts_source ? args->opts_source : "", + ignore_stderr); *from = qtest_init(cmd_source); } From patchwork Thu Jan 19 14:58:34 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: 644087 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp257012pvb; Thu, 19 Jan 2023 07:00:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXuRO51kMeDTJrTVJZ1RujmnFjQlvOkOT9mVnr97oMsYB3LLVUPAAQteEEIKy7kATBlctD27 X-Received: by 2002:ac5:c2d8:0:b0:3da:9f52:96ae with SMTP id i24-20020ac5c2d8000000b003da9f5296aemr7174864vkk.16.1674140404155; Thu, 19 Jan 2023 07:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140404; cv=none; d=google.com; s=arc-20160816; b=C/PJppl1bPyv/pBSpcALAHj/84z9J4Xh6mHiwy82Kip+DsCk56OAJBQEY/edAunHQD tvChlS5jCPxyLIzv9EW4D8/VdQdjj63ijFqfSza4DbgqRk0gMYAW2NTkN3jv3cPcnsO6 IA8CzzBh4lU28TgBcSWIkI1V1GNvtOXBy2T9SG3GX3fEn8AYDtMDBCYPSBKAVXd5XXG5 hNclelx0lK/Ym02SSq5DZgjTRn5Fp/0xrryx99z04hpgP5dwnX/Tez1NgDDCbF86PkNU +PxGBZ9JiB4uJeU1EVtFUWapyDEl1jiPnMd6LtfDL4U8ix8L1+vog1873y5haOqXFFAr Z8cg== 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=isWU99zMSOEnAE1RSfFCfmsXaFaInKvayEoBiTZj20E=; b=JobYNaMR3uqy3LIPf0igWCvRFV3J+hAeG1AjCaGfVcuWGSsJpHe+m8CfEHkNuSB7wt CQs4qSJXD23oXFEC7xHg1U0apaKIgUng4PiLoJ80mVRdtCYC+wQgsC0vdAwOZaslunBc mm2Yb0EhDx9uO6kayCsM/a8aRodAZ5kG6IxhSjOIqJmw3xbDfe+kO0MEK26Us1uxMcW/ S3k89r29RnQaDKRxrjFWEd+jmBC/Z7Oov5Ab9kgsHngo5Gq7iGxwxNm6ofH6tcVsaL0E WG7HmLE38vc7Ohl7TlhAFUNEn5gapVVc2tC+DJzVydvIiEJGhTCLIJbDWzQ8CdCgnLGx juRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fosVB18T; 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 x190-20020a37aec7000000b006fa49f3a642si21071237qke.159.2023.01.19.07.00.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jan 2023 07:00:04 -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=fosVB18T; 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 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) 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-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) 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) 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 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Part 1/4: Convert memory & machine options. Signed-off-by: Philippe Mathieu-Daudé --- 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 = NULL; g_autofree gchar *arch_source = NULL; g_autofree gchar *arch_target = NULL; g_autofree gchar *cmd_target = NULL; @@ -601,6 +602,9 @@ static int test_migrate_start(QTestState **from, QTestState **to, } got_stop = false; + + cmd_common = g_string_new(""); + bootpath = g_strdup_printf("%s/bootsect", tmpfs); if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { /* the assembled x86 boot sector should be exactly one sector large */ @@ -644,6 +648,10 @@ static int test_migrate_start(QTestState **from, QTestState **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); if (!getenv("QTEST_LOG") && args->hide_stderr) { #ifdef _WIN32 @@ -674,33 +682,27 @@ static int test_migrate_start(QTestState **from, QTestState **to, if (!args->only_target) { g_autofree gchar *cmd_source = NULL; - cmd_source = g_strdup_printf("-accel kvm%s -accel tcg%s%s " + cmd_source = g_strdup_printf("-accel kvm%s -accel tcg%s " "-name source,debug-threads=on " - "-m %s " "-serial file:%s/src_serial " "%s %s %s %s", args->use_dirty_ring ? ",dirty-ring-size=4096" : "", - 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 = qtest_init(cmd_source); } - cmd_target = g_strdup_printf("-accel kvm%s -accel tcg%s%s " + cmd_target = g_strdup_printf("-accel kvm%s -accel tcg%s " "-name target,debug-threads=on " - "-m %s " "-serial file:%s/dest_serial " "-incoming %s " "%s %s %s %s", args->use_dirty_ring ? ",dirty-ring-size=4096" : "", - 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); 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); From patchwork Thu Jan 19 14:58:36 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: 644089 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp257056pvb; Thu, 19 Jan 2023 07:00:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXvcwxhcACAWbGHFEs32FChL0kL2msOwNb+1Hcrqthad8Szd46zAPB7LzFmdMU/x6YoYAQV6 X-Received: by 2002:a0c:ea84:0:b0:534:ec57:5aa4 with SMTP id d4-20020a0cea84000000b00534ec575aa4mr14874688qvp.42.1674140408215; Thu, 19 Jan 2023 07:00:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140408; cv=none; d=google.com; s=arc-20160816; b=QAR7I/rjFrHsC14UtYD9zksywkFtsKhpkRItJkEpsbJlWqKI2KMv9lnQtU+NsOfJvr aKkAdPJrWX3XNhdYgvXCDI1fAkSxEp6sLrcktHZL2zYZmBEILY8pFEiezease6drrTWp rs/2H0LO8EEzi92osU7wgJaYdCBvDAcyJfhGXoJSwgH8oV2Z3p2kBdWGpn/LgXUH9v0V iOfGL23FrUgmnNFHrTsagVw9toh2recmXagfWqMy9MpbnIutP03V+rba/3kWEVr+TBe1 Fl5/j2YAw9+AIkmq0IOiCDYKHt9Uhqbpn7ZR1jymecC+DkKkbHB2m8pWI9oaiEZx+M7m 8uxQ== 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=PHvSg/mQjdmpWjiVzZNybtfs6HzFLrJQQgtlLJ8QVaM=; b=CDvwW0LmUrf4jfGOpS3ShLCRn1cLJgBNbenhIs9AjONo1o7Tgf3fS30THlyNX5e6XN p6e0RaVr9alBaaqfHmCqjhQjNEdu0DaHw7oUXIxTGmialI2RKiV3KsZ39yiorJDSCkJf uABG6xbDdmff7k7Fjno40pbbG0UJLFHERqw4aN7lbpEJwiD7XLaH3TvpLHZVuXUNoO8o eD2lDl1mzKex4zYe1jsuf2PCNbU4aiMMgU2RWniuPUA2IFnmQfaWhDJ9I2FMWe+/N8l1 4ELOHVvua10gU3+JdvNaxdf2puMKHu1MfZ/1hub7ZiQBloPXNgKHa5nEM0kFTHNcnHFl mlpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=grtJredg; 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 m4-20020a05620a290400b0070695fa0625si6346060qkp.501.2023.01.19.07.00.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jan 2023 07:00:08 -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=grtJredg; 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 1pIWOA-0007so-9k; Thu, 19 Jan 2023 09:59:38 -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 1pIWO7-0007pu-VG for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:35 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWO6-0003fo-DC for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:35 -0500 Received: by mail-wr1-x432.google.com with SMTP id r30so2125193wrr.10 for ; Thu, 19 Jan 2023 06:59:34 -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=PHvSg/mQjdmpWjiVzZNybtfs6HzFLrJQQgtlLJ8QVaM=; b=grtJredguK6Odurr8v7Nd4MFu1fynCqzad4KflFqBvCOvKX+FXGkUunlfMNyIT4oFH z16/A0Uny8/UNv/i6+UzFR38ZVcxLJm+VQ744tmpB1GFODIms2l9/odSdjaEp6g1rCAT XmlumW/NeuNl9QFTab9UKA3c4fWgpiEGg5laOQCB2BQ129FW7fnLQbpZJwqpL69XK27j kltJG7DG+qeDQKxf0NRoS5iOzpw387teTPKoc9NApqEw6Zey5WHbi5qJDtNoTEGxaJJ3 yLyrxYYRjrnWuRAoxG+T+eWlp40CeRadvvxp39lGkM+VWDOChkTJyYfKsROvpm+1jI0S iCjw== 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=PHvSg/mQjdmpWjiVzZNybtfs6HzFLrJQQgtlLJ8QVaM=; b=DApxLANFUUEjqcRXrdXROuOFUCQKFSaOqfes28TPda9jTfDaDLdA9rlEDZszaFUYUa DKPEOb7A0+eLT9yPr5IBr00jLNV87qoKSxXH7AN58omrbZn3o87OBGfLYSFWhWc76KYL 80qOXP2vKUeoS88rpW0EM73dMvPi953i7/lBzaQXka3ty3CvAcH7ua+n2JlVY5IHzmNS Clu6Jm4cry0YIPcIBuaf3q83CoC8eHbevHYEuRoDrLjqXgjZ8QPhDhS1wqLwpWb6lFH1 SFf5vv6i3htSQfgQ0vxhdZfYxUDbw8LmmdVHX2G9M2JCTnWV3f/4adZYMNzguvDkBONd Nq6g== X-Gm-Message-State: AFqh2komyA6wf5VCG0kSJj4Jk8cRygvElkGlU2L2XIf2we/jtY4vU8Hy kZGYm/u3qc+SyFepVmBLwB6jEifzjQui6yb6 X-Received: by 2002:adf:dbc6:0:b0:2be:12a8:9f75 with SMTP id e6-20020adfdbc6000000b002be12a89f75mr8304705wrj.55.1674140372843; Thu, 19 Jan 2023 06:59:32 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m15-20020adffe4f000000b002bdd155ca4dsm19683640wrs.48.2023.01.19.06.59.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:59:32 -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 09/11] tests/qtest/migration-test: Build command line using GString API (3/4) Date: Thu, 19 Jan 2023 15:58:36 +0100 Message-Id: <20230119145838.41835-10-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::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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 3/4: Convert accelerator options. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/qtest/migration-test.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 8377b3976a..015b774a9e 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -603,6 +603,9 @@ static int test_migrate_start(QTestState **from, QTestState **to, got_stop = false; cmd_common = g_string_new(""); + g_string_append_printf(cmd_common, "-accel kvm%s ", + args->use_dirty_ring ? ",dirty-ring-size=4096" : ""); + g_string_append(cmd_common, "-accel tcg "); bootpath = g_strdup_printf("%s/bootsect", tmpfs); if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { @@ -678,25 +681,21 @@ static int test_migrate_start(QTestState **from, QTestState **to, if (!args->only_target) { g_autofree gchar *cmd_source = NULL; - cmd_source = g_strdup_printf("-accel kvm%s -accel tcg%s " + cmd_source = g_strdup_printf("%s " "-name source,debug-threads=on " "-serial file:%s/src_serial " "%s %s %s", - args->use_dirty_ring ? - ",dirty-ring-size=4096" : "", cmd_common->str, tmpfs, arch_source, args->opts_source ? args->opts_source : "", ignore_stderr); *from = qtest_init(cmd_source); } - cmd_target = g_strdup_printf("-accel kvm%s -accel tcg%s " + cmd_target = g_strdup_printf("%s " "-name target,debug-threads=on " "-serial file:%s/dest_serial " "-incoming %s " "%s %s %s", - args->use_dirty_ring ? - ",dirty-ring-size=4096" : "", cmd_common->str, tmpfs, uri, arch_target, args->opts_target ? args->opts_target : "", ignore_stderr); From patchwork Thu Jan 19 14:58:37 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: 644091 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp257480pvb; Thu, 19 Jan 2023 07:00:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXta7sR/zd9SHulOzdWeFcrJKjQUzhGgcBwysrkc+LSlkoaGR8wfV/EDa3sxlvVrrGW8ppJY X-Received: by 2002:a05:6214:590e:b0:534:2ef6:20f1 with SMTP id lp14-20020a056214590e00b005342ef620f1mr20008560qvb.23.1674140443651; Thu, 19 Jan 2023 07:00:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140443; cv=none; d=google.com; s=arc-20160816; b=XHycDB+KT7Y/gItMlu+ZhihtlTiRnxoWMLZlNf8fZDo1LMo8Iw/JVba9g9tSH/1iO+ itXUuypWW9vtXjETTb+Vgt0Lu3Wxth5kNYkVcCWYn1COnzu+dq3CZPApklo49+m+qEs9 tE/PDJHN/B9Zqd9FXohbBr4h9xR+te6+6Ahdw8ie5bVAowieyNwEml6lk4xIK/OZ1k/9 zEMDiiwNFt9IPEOzCpDj9ViGVo9uZFYqpC3bXryn11jp32nS45/eEPKFN+FX2jUf6LBQ zb+BifHtaAdrMEUJA+PewlheommCk+hM8aAYqtUAvKHvkREsS+8JTH3bDPjyvp1ApUdW jf4A== 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=+M2TN+AUPgYoGzs4n18JWHJ0/EJHwDEI8iObjSbntGk=; b=Yhc7q0VONYbs86OAjjq6ElQ8EEFQg2y2iYsoRV0B1fXNj4FVS4PYgMz/2SZGgq7Ww5 fE3KtZdsIWmo/1kb6csWsiUE0HFnbTf5xKNk3WoZzGCflQnlQmI5NZ+fJLeOIWCO6vIt 959mWJPWh4uoS4FYEGhtKt+88lR9AbP3f6ocjnSWZlnt9q6JdGtx2p8cDQi49ATvK14Z QUvg6sOUebIjcd+NI61qsxPy7Ta5MRPh1UzVjWRdzRDvmb804TEraxaIrx7hneGijCk6 m8QMQvv7ngHjf4v+kVwGbr+ppN41fVaRCfvh3PCH8VA3hMR+vetZhZA8sLzwgeT1Q6hD zQxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QbOQPdJ0; 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 ey11-20020a0562140b6b00b005348ef6ed16si11316279qvb.301.2023.01.19.07.00.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jan 2023 07:00:43 -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=QbOQPdJ0; 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 1pIWOE-0007yz-E1; Thu, 19 Jan 2023 09:59:42 -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 1pIWOC-0007uJ-UR for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:40 -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 1pIWOB-0003g8-DJ for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:40 -0500 Received: by mail-wm1-x333.google.com with SMTP id q8so1740365wmo.5 for ; Thu, 19 Jan 2023 06:59:39 -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=+M2TN+AUPgYoGzs4n18JWHJ0/EJHwDEI8iObjSbntGk=; b=QbOQPdJ0WKZylesS32Mn24k6Dyxvsy0FIoS+3o3pVYJdH4lZosgq2I+vs4mg7KuHdt IMMDgVXyWO6ruNRjLoY0q9EEs1SOJMlRcXp7hcLrsBBEpY42+eZLl0Ef8Bz0IMnrdciU oxlY5MdOTmC37Ek1zUL0The/m7mi97Q6uPJ4TUjH5u3NWPmSvMh2rpyk6jEfn9SK2uDv YIC4gme6nkr+J4pjc1i4iwfQ72Du1nPLFgohmxCJb4HBxo+B+hrf+VcCSmYAeyE17ZiY 5z0kPN01jkt4B0atmKCRZorIc01+P43sS6mtVxQAgv5TZQBGmOGqX0OW/0l4ZApy3wX0 4TBg== 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=+M2TN+AUPgYoGzs4n18JWHJ0/EJHwDEI8iObjSbntGk=; b=uyLRIZZWSeucm2+9zG+XBx/Cqcdl+l7SfGwSc9oR+c+42fzebHwMhT9apHPgvcgsfO 4BzmSqQBeEEOXgmiBWfEjcQknRFQbAqSCwIviNcGh2GezFs8HAWNug7MFu13Pb8098z9 A1gCk9RqYCr9qWY+UsUbKDHfhqo9J90bQLfrbmwDGHSnmXr2Vz+JvPaSW8A9N9IqF6c/ yUDhyOFu+FGM8xiJvThkV4ViFwCTNtIViZntvk5xmkOz/7JC4xz1x4b4IrNjkr6vcqXd nLaFkwA8d0jnrA1a2Jx15YX2wN70KfnldD2+v+AWXgtXZg9hSo5KicpTqS8g1yp9JzQr Ls5g== X-Gm-Message-State: AFqh2kpVkgarEyNvc80nAzQCCpqpikrkFUE7f1pO/6VSwm8I2GzFI6dx 9gTi8r7+cgbkJLCC2P3WzUbJ3eeIzqLn+R/u X-Received: by 2002:a05:600c:4928:b0:3d2:2043:9cb7 with SMTP id f40-20020a05600c492800b003d220439cb7mr10589628wmp.5.1674140377851; Thu, 19 Jan 2023 06:59:37 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id g22-20020a7bc4d6000000b003daffc2ecdesm4886329wmk.13.2023.01.19.06.59.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:59:37 -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 10/11] tests/qtest/migration-test: Build command line using GString API (4/4) Date: Thu, 19 Jan 2023 15:58:37 +0100 Message-Id: <20230119145838.41835-11-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::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=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 4/4: Convert rest of options. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/qtest/migration-test.c | 50 +++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 015b774a9e..a930964268 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -585,8 +585,8 @@ static int test_migrate_start(QTestState **from, QTestState **to, g_autoptr(GString) cmd_common = NULL; g_autofree gchar *arch_source = NULL; g_autofree gchar *arch_target = NULL; - g_autofree gchar *cmd_target = NULL; - const gchar *ignore_stderr; + g_autoptr(GString) cmd_target = NULL; + const gchar *ignore_stderr = NULL; g_autofree char *bootpath = NULL; g_autofree char *shmem_path = NULL; const char *arch = qtest_get_arch(); @@ -662,12 +662,9 @@ static int test_migrate_start(QTestState **from, QTestState **to, * IO redirection does not work, so don't bother adding IO redirection * to the command line. */ - ignore_stderr = ""; #else ignore_stderr = "2>/dev/null"; #endif - } else { - ignore_stderr = ""; } if (args->use_shmem) { @@ -679,27 +676,32 @@ static int test_migrate_start(QTestState **from, QTestState **to, } if (!args->only_target) { - g_autofree gchar *cmd_source = NULL; - - cmd_source = g_strdup_printf("%s " - "-name source,debug-threads=on " - "-serial file:%s/src_serial " - "%s %s %s", - cmd_common->str, tmpfs, arch_source, - args->opts_source ? args->opts_source : "", - ignore_stderr); - *from = qtest_init(cmd_source); + g_autoptr(GString) cmd_source = g_string_new(cmd_common->str); + g_string_append(cmd_source, "-name source,debug-threads=on "); + g_string_append_printf(cmd_source, "-serial file:%s/src_serial ", + tmpfs); + g_string_append_printf(cmd_source, "%s ", arch_source); + if (args->opts_source) { + g_string_append_printf(cmd_source, "%s ", args->opts_source); + } + if (ignore_stderr) { + g_string_append(cmd_source, ignore_stderr); /* last string */ + } + *from = qtest_init(cmd_source->str); } - cmd_target = g_strdup_printf("%s " - "-name target,debug-threads=on " - "-serial file:%s/dest_serial " - "-incoming %s " - "%s %s %s", - cmd_common->str, tmpfs, uri, arch_target, - args->opts_target ? args->opts_target : "", - ignore_stderr); - *to = qtest_init(cmd_target); + cmd_target = g_string_new(cmd_common->str); + g_string_append(cmd_target, "-name target,debug-threads=on "); + g_string_append_printf(cmd_target, "-serial file:%s/dest_serial ", tmpfs); + g_string_append_printf(cmd_target, "-incoming %s ", uri); + g_string_append_printf(cmd_target, "%s ", arch_target); + if (args->opts_target) { + g_string_append_printf(cmd_target, "%s ", args->opts_target); + } + if (ignore_stderr) { + g_string_append(cmd_target, ignore_stderr); /* last string */ + } + *to = qtest_init(cmd_target->str); /* * Remove shmem file immediately to avoid memory leak in test failed case. From patchwork Thu Jan 19 14:58: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: 644090 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp257128pvb; Thu, 19 Jan 2023 07:00:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXvAEE40l92ymj1l+UamyFmyLEH366y2kQaYuFz+yl5gloYtNDW1D7/aTSIAr9uzVdJnjGEk X-Received: by 2002:a05:6214:501a:b0:4c6:f7a1:dc03 with SMTP id jo26-20020a056214501a00b004c6f7a1dc03mr23172393qvb.37.1674140416208; Thu, 19 Jan 2023 07:00:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140416; cv=none; d=google.com; s=arc-20160816; b=FGTl/LxoZQS/vQuB26DBc/34BknwZDqZiO6FJXo6kRbXj099QMU16sGNPF202wyyhq Czv5FSydAAVsYkDtf0oiRiM892wkOpuORDT8YzgiNecdfARxjEAPhSN0G8lJgnunHG6g 0d6cmhvY/w1bmk8/DB3fC+wirYkIGb70OY5TGhgYCCkIrbtBzLZ4GOwiQeHZMk8mCnqJ LXfLXX4pzlg8B7xboFLVj5R3+jiMx13mPubJqoatK/BYxItNJUAHyZRNfKgQ5ZJpitF3 EFyqFoiaCREDF9QlwhF4aHkCt4HCTI7JznSdS1CNnoK7+hH95RqiGyloSGXOnLwBGJVu i0Zg== 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=rDyw5jGUguYP19whij1cKtwFdUxKXvk9EDw1Rxg7JLU=; b=IwSLKzYivYJsQ0kOy8vFuzkB03/ZHrGoYh9yNhSAmIGDHIcZ8niGqrtsqwnuoBzFkD rsEgBfRJKRCiVwlxcXBmJd2lMPrhh6EVYYgpsp7Uoz2Q20j2fNZaBgRQUHDmtFjs+HRl RSVkaixjvETjz+6kj1RehrFqjWaCInUeRaD4Iejn9tTDg0BTxPQwoPriU7qMNQv+HDa9 rBhAO22Ualf2Xv5HFomXDBKwblApNQSl81tSUWmEHe17R+KKDmzg6eoL9g5Usi9ezw5k o/oaoRqXRyXOrQyG/HiG5VkqNIYm4ObIeHh1CSWCDTz1pw0Ft5HeB2g6dYx+5RGLn2Qt JV9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zx625sje; 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 ib12-20020a0562141c8c00b005317e9a5d4bsi22408009qvb.252.2023.01.19.07.00.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Jan 2023 07:00:16 -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=zx625sje; 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 1pIWOJ-0008UJ-7T; Thu, 19 Jan 2023 09:59:47 -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 1pIWOI-0008Rz-B7 for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:46 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWOG-0003gq-Oz for qemu-devel@nongnu.org; Thu, 19 Jan 2023 09:59:46 -0500 Received: by mail-wm1-x32c.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so3765045wmb.2 for ; Thu, 19 Jan 2023 06:59:44 -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=rDyw5jGUguYP19whij1cKtwFdUxKXvk9EDw1Rxg7JLU=; b=zx625sjetE/+G4xs3sYp9MwIfdMcxC1aARl39RwoEN/uciBhGKTKsV4TY2RJUDwmJD J5ON7BC6hSt7aZPX9qDrs2R+uCHOzGiSbourlj1maxlOE8iAdufYGeYAevZIauAuluRO 7c4AlzQ1BDuQM+XAe9FY8wIqkcYFuQ92J5hBs7uP5+wiryzn2tkIc8BTeTnPClelUQ7Q /RsUkV0shJfRgwt7Cv90YT1WSTUWz+36/ZvdDsBQzueAU6PXwoutYk7DQ2D8kMwm3k93 Y89th4YaXUKSr2jJ/eEpHwneNRbJgsfeiUoEDfNfXNVewzQM8EyqTwjnIAPI55876nlD W9zg== 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=rDyw5jGUguYP19whij1cKtwFdUxKXvk9EDw1Rxg7JLU=; b=lPgGbt0AmRzuJmg2Q791y7C/ga+tLt/Ow5UDAzgy99wSgE4Y1u1LXCHIdWRrxKMxRI EXImdPUQnvMlb3HDfnvX1ddV2xCI+3khxTi+9IszlpM7Ps3gCV0vkCD+LqLIXcjTgVDi zVmbMsJGKyFYsSt4nzDXmMHVqRPWgNJKlMqQLFbZTTOv1z3hQtxz9a+Pojh2HJFFkkXE +2P9YD1YdRb2i6E564MVYXlWWy62KnokiYByorg8EqjnYTv9dEtruP6pSwHnMiwNjmaJ V54vH+fXH16/e1OP3DGK2SPnN2kmjbMMmvylG0fNVynTlBor3iedToNv3wvSD27x0rTH jNdQ== X-Gm-Message-State: AFqh2koEeV6HKY4hBv77RZkXTd1C3pbcRj2Er8V1AmBnj4a5H8S6sSwx oD6wOfx3TDou/LAxXEyJI06WO0J6ymaEJBLE X-Received: by 2002:a05:600c:3b13:b0:3db:26b8:5023 with SMTP id m19-20020a05600c3b1300b003db26b85023mr1648284wms.10.1674140383093; Thu, 19 Jan 2023 06:59:43 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c2-20020a05600c0a4200b003daf6e3bc2fsm7009111wmq.1.2023.01.19.06.59.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Jan 2023 06:59:42 -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 11/11] tests/qtest/migration-test: Only use available accelerators Date: Thu, 19 Jan 2023 15:58:38 +0100 Message-Id: <20230119145838.41835-12-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::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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 For example, avoid when TCG is disabled: $ make check-qtest-aarch64 ... 20/20 qemu:qtest+qtest-aarch64 / qtest-aarch64/migration-test qemu-system-aarch64: -accel tcg: invalid accelerator tcg Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/qtest/migration-test.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index a930964268..17783d7334 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -45,6 +45,8 @@ unsigned start_address; unsigned end_address; +static bool has_tcg; +static bool has_kvm; static bool uffd_feature_thread_id; /* @@ -603,9 +605,14 @@ static int test_migrate_start(QTestState **from, QTestState **to, got_stop = false; cmd_common = g_string_new(""); - g_string_append_printf(cmd_common, "-accel kvm%s ", - args->use_dirty_ring ? ",dirty-ring-size=4096" : ""); - g_string_append(cmd_common, "-accel tcg "); + if (has_kvm) { /* KVM first */ + g_string_append_printf(cmd_common, "-accel kvm%s ", + args->use_dirty_ring + ? ",dirty-ring-size=4096" : ""); + } + if (has_tcg) { + g_string_append(cmd_common, "-accel tcg "); + } bootpath = g_strdup_printf("%s/bootsect", tmpfs); if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { @@ -2457,12 +2464,14 @@ static bool kvm_dirty_ring_supported(void) int main(int argc, char **argv) { - const bool has_kvm = qtest_has_accel("kvm"); const bool has_uffd = ufd_version_check(); const char *arch = qtest_get_arch(); g_autoptr(GError) err = NULL; int ret; + has_tcg = qtest_has_accel("tcg"); + has_kvm = qtest_has_accel("kvm"); + g_test_init(&argc, &argv, NULL); /*