From patchwork Fri Jan 20 08:23: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: 644627 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658344pvb; Fri, 20 Jan 2023 00:25:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXvxeaZ9F9wQpVXbNCuo6C4TheeMxzUbppgjnmAhw39NxuW9gyKM0yecbbF5i0GxjFBp9eWS X-Received: by 2002:ac8:4e0d:0:b0:3b6:3b9e:f0fd with SMTP id c13-20020ac84e0d000000b003b63b9ef0fdmr18609416qtw.26.1674203133060; Fri, 20 Jan 2023 00:25:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203133; cv=none; d=google.com; s=arc-20160816; b=bgabAUn1DgMoJt0LmyZoe2UVI1SILpVUelATdbeHSi+LdSgoCAdXELSjKKVlhCTBhg rIsSQTLoebaYbE1mP/NUV5pavdk3im90NPE/uYFoZp8xU1lCM/BWUM8v8b1hek6LiaHx dyZ1vGjCKqff9DLXQKUx6fg2qafog5+AmGSjjStrCtF8TaX/k+f/P+eHing0P7KZJW7A md9Xzw8J1q4gJoFA6Aw5dQmasB8zDHrG/1sUDB+zYbii7DZ+KrQB5328fgdEGXXDEkzH nl4x2+fYfcVfehlGiXAMvY+lSjIf+pYmvSBQw2aBsALABQC9ZS8ptQH9Y/d4nxNkTOY6 BZ9Q== 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=Wur4svIjiQz2AhES/kPc/sLE88sCvtXVfBZRncbaNl8=; b=puo6C58WwP32o77rF5CwSrhhP0a1/F6uziuoQFCX+vO4ox8ty4JqubfQjIAJHitDU9 BrbtmeMQ32X7dXrbNLTX4+u1yM3KG6xxn423boW/7YaH7fJakjrvSodjeOpqZ8No6Op+ zuvLNZakzJJo/tjRulSVvZ+dfDddDyQFBVpxmDEfc5Ky/Bknnv0vziQtM1+Rt31/tp/E QsA7r/wTNsB479lW0Qk5+WvVIIxgsKb6Qyja8R8W9NxjkVblmOEfECvZc05AlFtBwCrY 6b5OlLN2xcgHoefiRImBXw6XsFyWkW2RyhLQdwYbXTOXhDJ47c7qrzMHV7UG7DwNXxuJ Hyxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tsd8yw8g; 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 ca5-20020a05622a1f0500b003ad2c69a429si10491329qtb.275.2023.01.20.00.25.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:25:33 -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=Tsd8yw8g; 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 1pImgl-0004cV-Ng; Fri, 20 Jan 2023 03:23:56 -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 1pImgj-0004bM-4S for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:23:53 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pImgh-0004Ym-L5 for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:23:52 -0500 Received: by mail-wm1-x329.google.com with SMTP id l41-20020a05600c1d2900b003daf986faaeso3062738wms.3 for ; Fri, 20 Jan 2023 00:23:50 -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=Wur4svIjiQz2AhES/kPc/sLE88sCvtXVfBZRncbaNl8=; b=Tsd8yw8gjM9WiWFw1u+nhbOAlviY0vi1LROWylW2VzuI+GjIQLkfcFkOj0qWq4cMgi Ax69DOAlk87lTdD+yBFpWtmq6aLQkJApghGcFerFyX1zI+TfzTJj5qfiye/VTAzc2ApM TiioFwe5eIOPy9Wa/zNbXrzsVPX5Ol3mvuBXfQeJ9FINgzwYBGnDARrlwu/rslyymbDp 5dYc1jBdQxGIWTLm3TpABQ3BwNA8+n8PmfcxnDV/4lQa2ysYTWD2dwvb+kJ+31CrhE78 Wx5dSAKoR1euHRiWhboQjM111/r7IhS+4bOObXRRUd7lmu3TSjh5y8OFSjCE0KQ5I8UZ gKTw== 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=Wur4svIjiQz2AhES/kPc/sLE88sCvtXVfBZRncbaNl8=; b=RGlieFiqjNvOhGmD1YBVKwM+E7pkP0z1KwM5b480UASRlEcrR8PSsYb1B9ye5WqFV8 vZ3ki+4V1TVrXJAPInvO1EJ8P9NcxpxYBZBLKGPeaz6Xvsfg+mQ+t0CVOQAQ1RXcU2a9 l4dL3VY9WJo69ChuwxP0ebe77+IkeQrVhiz1h74Ce4LkwIb3I2YLGVkibMlk2ZIazwDQ KVBxNPHWYTDlQcRKdeDoJ6cdJ19oaVFfG2aNKIbvWzTfXTnDrrMJtmUW2i7+/AOhpQmb FMQRDcjE1DQGpvQ58qSp8BYW/lB3DP55MyokcthMFbDGri/vi6q5euWruUZM6CkgxEK4 k3cw== X-Gm-Message-State: AFqh2kqqJuYbOC+GvtzVi7Boe8nkUG2BihOfQMHzUM8vINaI7thKcXM1 2lvQqEV9kYGrzO/AwhfShlaJXgoIKqktcSgk X-Received: by 2002:a05:600c:1d8a:b0:3db:f0a:cfa1 with SMTP id p10-20020a05600c1d8a00b003db0f0acfa1mr9825757wms.9.1674203028581; Fri, 20 Jan 2023 00:23:48 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n42-20020a05600c3baa00b003d96efd09b7sm1729432wms.19.2023.01.20.00.23.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:23:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 01/11] tests/qtest/boot-serial-test: Constify tests[] array Date: Fri, 20 Jan 2023 09:23:31 +0100 Message-Id: <20230120082341.59913-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 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 Fri Jan 20 08:23: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: 644633 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658604pvb; Fri, 20 Jan 2023 00:26:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXvar4/yUVUjC1IoUlsCyYHRakNnyRJsNPHRAX1dak4j+ap0E1pHOonQ7XONzE9UjxscS92C X-Received: by 2002:a05:622a:4a83:b0:3b4:7e41:daa8 with SMTP id fw3-20020a05622a4a8300b003b47e41daa8mr20884061qtb.28.1674203175718; Fri, 20 Jan 2023 00:26:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203175; cv=none; d=google.com; s=arc-20160816; b=oh0aTvWtRsQNGz21nb8E7QbEX90f/0kgt1OcbURUwyl32qmxlX+xKSs3Kdm8fhv+rq wh/sHo7m2T1dBf2fQWCSeWqf9qgbMtm7mWzhJir380O61jv+P6bhU10GYiNMDJc/hDIq JyQmLiE/lOTSGoMqEJ7KsUOBWE0RXVQ+6kzLOLmjVQyFDP6ojNU3H2ielC6uhn06zHzL k43CqjWeYSD1VaMRH09INrvukQu8HPCf2eJgPpxpsIUsU5XgJRmvW/xVzRGxhd8nzBTe jMb9bUEpYgV0DN1v6FXW1cWioAVKgfM7Uza3hqeWrJ25PSIrbFqASR6xdJFy8a9dtUd9 jzPA== 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=96awe59Bl1JmrEDLbt0RIPfUyUqBQm6nbi4HGeicux4=; b=DkjpcSziu6OoXiB5m5ryWs3z/uA3RbmJTMbJt2ACd3bJCaI2CZcYbZipd5RkVNznpR 9mPi8GUNWsgEOLvoE1bRbIizYBZCxDPR4rF+N6OrE5s6Ouqoass7xRc7qkQ+QURgNKm8 NMCFsfOitxF/tUkafReBNeWcDV4S33ejifia+d2aexir3/Bv6IRqfc+3WzzXf8JV5lDl XgJvtWK0WJFGHOO78QOEdQPPd74crS2aJMEdnqg7ROOI9NUBP3gfUWK1p6u+iEt4z//6 kjYguIvILqnIGFIpm+QjJ9ElpJqlgD1VeyHAy35E5/3P8E302zqE7pzAV6NWbAAvKSOl Zb5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SiTX1Vhs; 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 fg26-20020a05622a581a00b003b69de6b99asi197597qtb.229.2023.01.20.00.26.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:26:15 -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=SiTX1Vhs; 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 1pImgp-0004fl-1U; Fri, 20 Jan 2023 03:23: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 1pImgl-0004ch-W0 for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:23:57 -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 1pImgk-0004Yl-F1 for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:23:55 -0500 Received: by mail-wm1-x32d.google.com with SMTP id k16so3391185wms.2 for ; Fri, 20 Jan 2023 00:23:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=96awe59Bl1JmrEDLbt0RIPfUyUqBQm6nbi4HGeicux4=; b=SiTX1VhsgcvxE1cKCro2n5Mi9jtOQaep9/ODJ5g0I8+IccdsjcoIpUGTPMAivMl57Q OaRxlXCu+tR9/p3M1Y5Tud8mXI0nVmo2kgJ7S9qBnKY0dh0PqQkuHEZr0TcmC86xsd3O 4vPMCgQSXG+msdPBFmNTR4OJiiTutJ8O5KeQhuE9R6jza0UaWXZJgdSGX/BxJRsEq2v3 zHeGDMqOrRGAFzDaVmAjOAMRiLxz/ubqnvgCGANAgh+oH9hQNlzHMkYNTOX/M8PcxeGj tESNWrq6K+XPjPacohfOGBXxO86UDMcXnYxAgVjbfs/+2nztFZLYBjfjjNkAO29ceibc KMOQ== 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=96awe59Bl1JmrEDLbt0RIPfUyUqBQm6nbi4HGeicux4=; b=OqMpDgTkXkh5Mxn2bBvbbWL+gJUosAZvUsB6K363yhHmk4jy3yvYj33bLVG3wJo/7V GHT900zwVyvAZEQnVpsuJc0v+5BddtrcXYuGOQv67MGehbDPdz10o5d4gDMUxTi3fzm3 QJITXtQkL97TvGKld4YtbIePw3a9vqvYs+vDS7y1VHySuNd4MvwSgiJB8tF74ODBg2cE oygTaIAb7q/NDyRhOkVh6BuTGKCc3xhb+raY8nxFyBstAlJ/b0U7qq8rvaI3XGBXHC/D VPiIF8Hn44e0XZ4Nu2ra0MBE8g2HIIAmH0XYhkCnpI0t7RpY/zLXrwrCVh8mW/zkhCZ+ pY9A== X-Gm-Message-State: AFqh2ko1d81ZQVvnSsDHbikrpIlBXlcOqDkshh9WlTPHaDw1xTGtHPrK MIDiQ3re+yZjXCbqpGicSfbRvCSpv8LrxbIA X-Received: by 2002:a05:600c:3d9b:b0:3db:1afd:ac36 with SMTP id bi27-20020a05600c3d9b00b003db1afdac36mr6977627wmb.32.1674203033493; Fri, 20 Jan 2023 00:23:53 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id u8-20020a05600c19c800b003db0647645fsm1571932wmq.48.2023.01.20.00.23.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:23:53 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 02/11] tests/qtest/boot-serial-test: Simplify test_machine() a bit Date: Fri, 20 Jan 2023 09:23:32 +0100 Message-Id: <20230120082341.59913-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 Fri Jan 20 08:23: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: 644622 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658106pvb; Fri, 20 Jan 2023 00:24:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXuhkojOabvR0isIsnBFW+nPQxC3MDMC7aAlwK4tIjxuf2UxpqqDTEjW1BGge8V3xkZcio0g X-Received: by 2002:a05:6214:3506:b0:535:27d5:f05b with SMTP id nk6-20020a056214350600b0053527d5f05bmr20718588qvb.17.1674203083753; Fri, 20 Jan 2023 00:24:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203083; cv=none; d=google.com; s=arc-20160816; b=TZiZvfXwdj+dLxnRDMcXchE2BGLHpr2mcS1cfkUm02y/+fXvi1FOA6rtQjVyfVQup6 NedCB9McbWion7DJ8Ko0zs6/QQvbBOBOuNcdXNHtTr2IPKBZGTJo0S29+9dTUqgaWVtg SZ/IBT3kMUnBjj4K50zSdMxV0S/o+0LiFuNKTnGZD0Ozh5BUsp4vtMGACjulfw17zthZ H8o33umwMYVui1K2f07WMTay0mrt9S6QK3Io9Z8S4WXN67orca4hxMqZQ/PTjPlsCJ8c m3PWY3GzY9OjjkHGLA7MkJUaYjzJRD/t6Dhal6fXPFWOKbn7ZQ0d63EEhf+Di0cMyvQ/ lT+w== 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=1A5XESI7TZ+yAtbO2UTL/bHexDg6E6J3DUKnc81TIsg=; b=BHrQbbdzuc6wX4JcdgaMMOZ5FN7DblpaXcZ5Ma42kE4jPwd9me6pFX+VeVuctCOjbM Az2anltljC7Rn3MNqYpgJsJB5hrkqiTk2wIW+/aNNViWsNXHs6xC/ZSZGRgTKNbMAAKF tjeLdSsfUqb8qAaz7RKB6v9CO2q413fY6wASpXrPJjOO+LpO8le0IYo/NxIlVsRUiZ0z EprAS2RtgeI533ev63qG3YqOA6jFMosFfnHWmCYz1Cz12Qv+MW6iaYsv4elRbH03KS8e cPKiLt2/BGsUrC9m7upmDG0JI4oeS9ZTRGnW+KjJ33Af+sJpkRsUxqmJP1zLcXiLOTd2 +R9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sij4FTf8; 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 k12-20020ad45bec000000b005318cf5172asi4376814qvc.520.2023.01.20.00.24.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:24: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=sij4FTf8; 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 1pImgy-0004i7-29; Fri, 20 Jan 2023 03:24:08 -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 1pImgs-0004ga-Dx for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:03 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pImgq-0004aU-Ai for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:02 -0500 Received: by mail-wr1-x42a.google.com with SMTP id d14so446574wrr.9 for ; Fri, 20 Jan 2023 00:23:59 -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=1A5XESI7TZ+yAtbO2UTL/bHexDg6E6J3DUKnc81TIsg=; b=sij4FTf8IkBYLrd8CAQVgE2UQ7XoNGnRjyz4CuHxqJ5axll55NYvvPM++dJGCBMbW7 gQLLsZ4bjPl3pTq7+7ASYx7fZ2tWD35dIhf4w1QqU0eaqdpWdun/3DrDEypBIDcb9BNE dzuVHpYP5D+toXTbos1pgLwNQLlz9hZMpRwcE5SDOFUwPPDqvPfyLN1Gg/Kahpxnvw2Q rWh/nzhKEo61zV/Y/lDcbo+MlsyVSsDOXkoCqDYDiIJq6TrN0IBwIo0MJw9QmLm9+eH4 bAgSHRwY5yIg+BGbTBuZQpP81fhAeRFcwJBH5woEBNuZtH881ww9zI1xkcYfs/xMOZEV WGtg== 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=1A5XESI7TZ+yAtbO2UTL/bHexDg6E6J3DUKnc81TIsg=; b=ntr4v7udm1uTcKrk/yqtYQ+GF7REhmD8krhAMImDMIgo8VzoE0tYyzgLsd/YAFx/fq yZMbQPRSB1SU8lDT2/MtMW0Z+SyV3J7atzdqjhoKRXok11S9mmxyBEPQGISVez7/+auH vds56kFJndCr70GOQEDC8QzYvMwncVCrXjqE4fsjqTGZ+EEZsdnGcKRADKPZRlt/c0Vu zviWC9QlcEx3vWzZWaL13PpCJ+GhNY6WvY0SKwFAakGnEGn8eO3hOBwiCKBzplPcbEzL nSdW+3u3hP+JkXhvcOtpGnAmtcBBuS2laA1h2krJ6VPO+wmLe23Rp6QexkC8HT5a6tv0 fAIw== X-Gm-Message-State: AFqh2kpU1rFSB8rvVaUrRgbdn3Y8soHH2uw1V8bn65n2FvkZeM0yA3gJ rwDJEy1S1ICw4xVJHrkTZuIOsgqlc8z7TIwb X-Received: by 2002:a5d:4842:0:b0:2bd:eccd:7ea4 with SMTP id n2-20020a5d4842000000b002bdeccd7ea4mr12256356wrs.47.1674203038501; Fri, 20 Jan 2023 00:23:58 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id w5-20020adfcd05000000b002bdc914a139sm26774409wrm.108.2023.01.20.00.23.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:23:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 03/11] tests/qtest/boot-serial-test: Build command line using GString API Date: Fri, 20 Jan 2023 09:23:33 +0100 Message-Id: <20230120082341.59913-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 Fri Jan 20 08:23: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: 644624 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658259pvb; Fri, 20 Jan 2023 00:25:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXt9h+vT+zL2itYAbTKdQXf1vAW0QmLNBgf//NNR5XvJRXONVnFAZKJ1UAuKJD9rw+Ywnb0P X-Received: by 2002:a0c:f9c1:0:b0:535:65cd:774 with SMTP id j1-20020a0cf9c1000000b0053565cd0774mr1714256qvo.2.1674203114223; Fri, 20 Jan 2023 00:25:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203114; cv=none; d=google.com; s=arc-20160816; b=HNcvR/UOmjSX1xOeor/Hkah4MpsSnNI8xS4CJZAP8vppHSdIYFi/ADYVqlGVm2aed1 0lQ6ICTNCUiTWF/UfeV9fU9E8ljkLep5sb2wIYNHTmvmG9uDlbDpWTk8tlP9/p/xWXWt SVyTRTJXUJCapQE5+d9XYTFdO41Mid6uCm5mhMABgkSKWYcAB9tVRaTLH4ubqGwZ2SKd Tx7NjuxMKbGdMZDuhRglrWAQo+D6KEaYinL8XJ00JJyR7M0ny9GTfk8jauyI+o4T+IN4 E6YG12scaAQ7kmYi2R0BbZCZMl+WiJxrbUWY/XAkweNNUVkIk1tIQT0alBZKkKFRVxw6 xh6A== 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=Cm+umm3mYxK9+2vcvx9AjhkEUHA7aStmnl97320UCkM=; b=kOcHCHppkTzMob9JD1DV2yz2mWvsqZyv+QAc2MD4aCZe3gDrqwkQLEDTgfHQz5honj YjJBfVCYbrmBclsvOfff8+T+KsqhVwzhsTZb++ofZ+L5HDx1+o03QAC/DYVURc6D84WM VQmG7YcWFoNO8ni33sC2c1JPANZvmYr7KP1lih62KjnzHHyu/rqgVllQmhsge9so+Xw3 wvk61lmlOr34cv7+W3UIiBeYuBXGsIUaiam+/DYlvqjaoU7pIH/skQV2Ap8vqHoITfSM Enum9M5ojQo+F4OTlc4ULuMeKfn8Ax6QGEGe2vUqXAUJtY+IWUr3nrWqzF8dC530Qrgb 2t8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZpunFXMV; 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 h3-20020a0562140da300b00531837e8611si24503021qvh.12.2023.01.20.00.25.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:25:14 -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=ZpunFXMV; 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 1pImh6-0004k3-M3; Fri, 20 Jan 2023 03:24:16 -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 1pImgw-0004hp-2F for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:06 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pImgu-0004YJ-K9 for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:05 -0500 Received: by mail-wr1-x433.google.com with SMTP id h16so4105328wrz.12 for ; Fri, 20 Jan 2023 00:24:04 -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=Cm+umm3mYxK9+2vcvx9AjhkEUHA7aStmnl97320UCkM=; b=ZpunFXMVSA4HnDYLCxUAriPXIak+DVQgFJdJ2EuMNuyS4tj/uWIf8PWhBitRFop6yM pZg2ZYBwWNXuqkCEu3FrSdWX/fiVN3a0Nu4s22Ptreha+vqxjn0w7hofupOEswa0ASiW B7Ws4CDr5rYpBswrj92vVOGSHQETB0E9euM+Dn32W5ySyheZcrpixWE9OApSqHEysK9u d+fPWpWjF+oqtke4aQ+78zL/2eSEh8erc5RaNGAfa7DQBmbpsOK2WSr1Px+TCK25DB5U m4p4dDUX2+oT9lJZbOxUTMp+1J2A4EtTcLiSTA7f7uJ1uTlkak7w3StJ0ibhty+THl3r OgEg== 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=Cm+umm3mYxK9+2vcvx9AjhkEUHA7aStmnl97320UCkM=; b=WmedSSO7QeSl+OcC0oYN4RQ4WOi5mSZQ7z4NUsbO3Rq81anLWBGLYF43c7VuQQi8G1 k+IMUDl0Cu12Vk554wh+X9O47UvlWP9R8ZaX9YDztITXfmXUQ5B/+75Q9PgQg1i5SFzZ OD6qeEqm0h6+tJ5S6zz7nbGmDELE9sUy4lePqYOeJT9Qm0+Qikx/jeOd0SAxeBcg3hDk usAmcwMKxjKyOewJz1lfk+OBpI3oblrXZe3QTGpta2VciqxRId4M1yyPDbeNY1HVUDd8 BV0L88xTGIAsw/mRv2Jtj1bMXytSuAvt9AWyQwNyXFMfM9TTIrO0jTWAkgRoZ69ZCsdq 1V2A== X-Gm-Message-State: AFqh2krdtXWPLkTNTXJcvJy4soXLFBkDekjERRr/BXG8WGRCbGIjcFkS LgQdy6t/sdWKXpYGVwdp+LcwaAPCDPQ3CILX X-Received: by 2002:a5d:4dcb:0:b0:2bd:c1de:a33f with SMTP id f11-20020a5d4dcb000000b002bdc1dea33fmr7516960wru.19.1674203043574; Fri, 20 Jan 2023 00:24:03 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id f3-20020adfdb43000000b00236883f2f5csm36048130wrj.94.2023.01.20.00.24.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:24:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 04/11] tests/qtest/boot-serial-test: Only use available accelerators Date: Fri, 20 Jan 2023 09:23:34 +0100 Message-Id: <20230120082341.59913-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 Fri Jan 20 08:23: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: 644630 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658441pvb; Fri, 20 Jan 2023 00:25:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXssb2SmuQ+Rc3MVy7066pZpnZ+lalYk44vq/elVqfgK3yq7d+xNgaFZeKG2SYD/9P/cpHAc X-Received: by 2002:a05:6214:3783:b0:535:239d:abea with SMTP id ni3-20020a056214378300b00535239dabeamr21117219qvb.23.1674203148221; Fri, 20 Jan 2023 00:25:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203148; cv=none; d=google.com; s=arc-20160816; b=aoTODLviNdLrs1QU1gCqCfn5yLK4h6PvnoJhGZsgyinr5PEBBb/pepvIC34VwGmF+H 6681KIcqSaZvFcD8GCxbagCKuCStaXV+/13bLRF1xu8h2c7wkB9qBY8343B7Z+/3mjrt Fbo7Y95+6Rfs6MVlLm4vkixnz4u5yHPuiHxq0J025JwkrNxlLDyv7EkPKHgCj0nxD0DD mlbyXkMsfbsM7IL8sjfFtwcpAyzAJ4GXaoVYrL+IQxvVXuzwHUYrfmN+ZPlKRLMQlYij 0xa+F352X4u6IERGmY0qUM6e824yYM+ylB/Tu2wW2WtQbX5ujmlNvi55k2ybUKQD6TpF xNqA== 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=mY7oyQj8bfUQn3aOeG+xwKrGHm6i2eqj02t4Nx+dHyw=; b=EUb4FxMi6ndjR9p/McJ6H5M/mYZfKdDOJpMVUG1hntFh5/oKkNnjPY4o1CvYk9ZDfc v/gdFM7dhpYMvNfKmLjMnOumJTz4iLdRqW5zTt93HCH21gEFYkuR9ttM9pZubk5Y1hDS yue7Mtw4Z6AlMCpcavjT4y5eXVQ0ljzSNTGGLHI0UMSgKVDSX0/rE+kyUvS+Y1q5ialm oaLRXBDWW3e2KPVHLQNup4ujNJVclCsM98tCkZzbOC8/vcBJXVubc/nPlSnd4Qulbjkl DMeLIOBJXjsKtNILqptQNQox/nvqPk80/ElSQHqTfv8Ux/at42gY2MmyhegvwZBjJhaf +Aqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mI6b9UHz; 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 a13-20020ad45c4d000000b005320dba84d9si25746246qva.361.2023.01.20.00.25.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:25:48 -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=mI6b9UHz; 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 1pImh8-0004mz-43; Fri, 20 Jan 2023 03:24:18 -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 1pImh3-0004jl-NL for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:14 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pImh0-0004dI-2O for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:11 -0500 Received: by mail-wm1-x32b.google.com with SMTP id g10so3398396wmo.1 for ; Fri, 20 Jan 2023 00:24:09 -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=mY7oyQj8bfUQn3aOeG+xwKrGHm6i2eqj02t4Nx+dHyw=; b=mI6b9UHz7VwJB3FJYRPDidQ8ghs6YLa7TctpxwlzBiJMTF7IWbrDr65GAtGWb/CvIp 3CmTgRniDVM8QNqpxP/Al+k/4j8UJs4qqdMA482KJKjXui3GDtQ2QE3IrXRiO5HwYmW6 dMX0bOpXxKupdjH//dwviLouy1U9kDGrrIq+KeJe6NpLXlkfeCbIP+HzNbA8pQY8Royr agKHrebV5a59vBOA0/tyzKmvdAvC2mNKZNJ++kuhR0l2RxYUkIQ/Vx9KCccuVvz2uQmu +ivTAr74lXB6f+FzCSJhYVvJUjkBKHSvzpJPSH5crBOLmJakPtIH2wx+1OCV6zwdPrNV ZdbQ== 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=mY7oyQj8bfUQn3aOeG+xwKrGHm6i2eqj02t4Nx+dHyw=; b=fSH38oUHAggd6vgi2CKlb2PznUlBE5GImWgN3uqgOL/wPVsoXcTIPkiVGwZM2LOT3d XjnGnkZ1Q0c9boaxO0Sy4W1etfrNY97mdJHsmAgKXMYPyyj5UQjXtN6o40a6dH/AbwXz jQ1ouexpRTrEd0kFjuKTXycuX33E+KP9OZV7gn1lGxywHupDWMYSQG2kkgwZmHTrCgbj KeFsQL8BymUTvtFBmW8EdE7ovNmsHCjr9Z4E1BHw+AWmovg2YEVaFjgo6Y4hN+m6yPlB MMUNdbRgWKAHRZJGp1IBK4i8xhVPWL/LDAKD06pr93FFfSbhH3G145XviXf7nfbf8Ny9 qZeg== X-Gm-Message-State: AFqh2krORmNipOrXXX1PIKlyjVX8KVsqzf4io3GlDJaWFv2QazPpdTYL erMQloRVTFTxeZCaJAbxD5ybPRrwYT55suxO X-Received: by 2002:a05:600c:cc8:b0:3cf:497c:c59e with SMTP id fk8-20020a05600c0cc800b003cf497cc59emr9568717wmb.6.1674203048594; Fri, 20 Jan 2023 00:24:08 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id z4-20020a05600c0a0400b003db01178b62sm1674206wmp.40.2023.01.20.00.24.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:24:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 05/11] tests/qtest/migration-test: Inverse #ifdef'ry ladders Date: Fri, 20 Jan 2023 09:23:35 +0100 Message-Id: <20230120082341.59913-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 Reviewed-by: Juan Quintela --- 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 1dd32c9506..5271ddb868 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 Fri Jan 20 08:23: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: 644625 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658287pvb; Fri, 20 Jan 2023 00:25:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXsIrhLXhNEd/3A6BwP/k4AOZiu905l9d6j7Rdvz1erQulfXXdaP5jJDfIAXGbnwUc5aYpjx X-Received: by 2002:a05:622a:4a83:b0:3a8:3039:a702 with SMTP id fw3-20020a05622a4a8300b003a83039a702mr19270301qtb.43.1674203119830; Fri, 20 Jan 2023 00:25:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203119; cv=none; d=google.com; s=arc-20160816; b=KoffwlNrg/XgoQmPzRRQwA+eWIcQBowiELnA3a+TINj8Idn4sahNHDcHpwzBEDI6wp mZ6H+4CgviIhfL1X3xe4U6H0Z1ZDXTKNLc191S4AJqj4WHztHgx5ASkuO6pEq5FWFsZJ EDxZjkPLoPRVKrGF4Dv/dSFv0Q9JeGni9xTr56GRRJSyr3a4ah0XAYTRhYJPBQyFCJp3 Kl2vvi+IKzd+Vle6BU/p7FG86hdTd12Y+LVEucumPVxNAviQIs5rmauWeM4xr8YL9yeM xMLS6XfF16OctS/Mjt52O0u/YwOi6X3gghbiA9ILnY80uyg0y2eNue0hTIq+f7nHT0Is zgvg== 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=N5m6RkKP7q/TMIRjDQYBTfdOOAJj550dV/XF1lV81V8=; b=lZ/BMBWYc8+3XnPDdqcFmAlGfV+QcpSqdq43ttNVqVNsjGAvhpyJzsdiDgiwuz6sNS eZOuyIxiEEravA80ebzHdC0CXr7QhUfhM4efmIaHv6l1BdbwkmXxmoR86/zz9A00Fuj3 KhiQKCJkAkyqOWsDOEF7eelFD8jzM8+mA8EbjKN2UZZ0p6jEr+B/9y7hUfb5Mme+GUqA G+CPhECcdNj28F505uHS14RgVJ885MBGCb0KeG69LGPyMbjbqGsDufuqiUEIUtfEaoYf JTHSNryKXXmx4+TUBJQScc518wAbKljhu+tsgV6zPFpElMUMBU0GCBkxLJkQsZD6tQLT fVlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ejrrv4oC; 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 dx6-20020a05620a608600b00707a5d60b62si3934066qkb.685.2023.01.20.00.25.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:25:19 -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=Ejrrv4oC; 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 1pImhB-0004pX-Fq; Fri, 20 Jan 2023 03:24:21 -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 1pImh8-0004no-Ra for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:19 -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 1pImh5-0004dh-EO for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:18 -0500 Received: by mail-wm1-x32e.google.com with SMTP id iv8-20020a05600c548800b003db04a0a46bso724603wmb.0 for ; Fri, 20 Jan 2023 00:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N5m6RkKP7q/TMIRjDQYBTfdOOAJj550dV/XF1lV81V8=; b=Ejrrv4oC3Wuul2SsVkNrFQoWgwLiPrb2VP/L/gZnJuK1k2l9cH5aFBAorzBfVEWACk pC3NmbWFsoiL0i/Jd4lULB5tJi4ZXnjrr+PxSPZ5cStlWa+FNFx9gKtcEomzCJ9W3gcM CxfWTsH8SlNfhMTs7XKT6zWMm5JY3NI/sisp9CHqSyB1chy+6KB+OH2IL2OeXYzE/EWC mAdHJ5tPPLl0EEh89kqCtVbDSLYFHYrYg4rkX/6GH1w5vVk3lTxivOsIzZwF1wT3v4hQ Msr8JET+3dvYNOdR67L9QeCtrtyekGUg8klr5z0sqlcF2EEI0MHayCuy0epUFKpdJwWm 4U0Q== 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=N5m6RkKP7q/TMIRjDQYBTfdOOAJj550dV/XF1lV81V8=; b=YJwiJWsMo5JZD+sE3fnOw8SfLtp2kJ3sdMq526FeLWVOC9ikqQX0WrSjkuHDh/9A4x wRC89CIvv4SjHXpNkcgH07QONau5BV32yiTlSQ7Q0x/blAx72q6gGf+i71Rr1jTOlD20 F9XmUdCdlWzJWm6hmR8msO/u9MnVeLNZ6ZaHuMPrKl56DRk3mRBb7vTvzhVRG8PqWqnt J0zv1oCOEQD+zPXRmtRqBhxsZ122THSUzRlWlVlAB83JLTXGYEXqT9kMvvo+n80Mr+9s AxPnyAwQGPej82tPtMoo6SwrgWY+fxSXsRTFo+TfFI3/ymHg8Dq2DBVOIAKqgS7C0y1S qbEg== X-Gm-Message-State: AFqh2kr2HRvTLm8MaA2XVFa4Ib9/vXdity3v/ioFmm5KJTk6GnwpkrCU DvCnZmOuAgcXZ/agVWdsijBEIZIZHEZr/FuM X-Received: by 2002:a05:600c:4256:b0:3da:2a78:d7a3 with SMTP id r22-20020a05600c425600b003da2a78d7a3mr12691383wmm.33.1674203053573; Fri, 20 Jan 2023 00:24:13 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id v17-20020a05600c445100b003d9e74dd9b2sm1583458wmn.9.2023.01.20.00.24.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:24:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 06/11] tests/qtest/migration-test: Reduce 'cmd_source' string scope Date: Fri, 20 Jan 2023 09:23:36 +0100 Message-Id: <20230120082341.59913-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela --- 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 5271ddb868..f96c73f552 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 Fri Jan 20 08:23: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: 644631 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658495pvb; Fri, 20 Jan 2023 00:25:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXu6cRaeWeTaNUHfE/CrGgCch31HAS0OSwYTGxPGGiBI+sW9MsYZPammNfb5FhUP1rbd0eK2 X-Received: by 2002:ac8:75d4:0:b0:3ac:4611:ef20 with SMTP id z20-20020ac875d4000000b003ac4611ef20mr17651549qtq.55.1674203157775; Fri, 20 Jan 2023 00:25:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203157; cv=none; d=google.com; s=arc-20160816; b=LXGQHC/iRdsLFzO70IVZ7uEYzzKL9HTtdux1nc0pfHkKgoLpVvQZ16SDOUHfdKJ+rz 8RdrCjZK/DheFQIDItZEOb2dxubd8CZLxbue9cfv8+Lh0tmGtlx5Fw+Y56mf2PVS7DpH k0PGuVrZh31/E/UVyippQiuGIaMRpWIK574dS118zNYBVfGKzfNy5o97eBU/0xKl34rN 48CTMvG7V0pbFJx6MURMKVNg3SssTZb2VKlAfbPaNhuQBWweEDraT0q5wlCO6aaLvxLv ZpKSh8NyE+KbXjTYPdPZ6BzoVOyDwsR39F53NJpouIGaVmcNCv/YX7LlJVGxxrQzIp8O 6sMQ== 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=V49wRNxwVefl714Mn2UmK/YcN8/tnExcJzoF8D3gX0Y=; b=dsoN9QHLn3v6EvUyYDekOTk8brBKmBKf2eV6vu5aaeWYZODqwNlKKSsKWjggvCKLmc XrIlEt9Q2vXaUVlBMCpytm2FAvBceJ0HqwlTfy1vmF5/s8VGC7B9dducqBDyibhpl23L ceyPieXx9Y4lQhb3KqVod1MLcSOimoe7RCn5gwJhipZUv7GQ8twQBTpEipI347bIO79M c/7wb9ZDpc+bDZe066kIVqrLy7RMBY3bopdvt8MQ9E6xJb/+WGhVSzP/WxjSvN+atZd6 3/mOqULCSLf4F36VLcSaQsPHKWr+/xhMeOHMsx1KnvvMkxyzOkp3MgRDHaNS/WaoGN06 7NVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o0vr145+; 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 m22-20020a05620a291600b00706237de283si14081965qkp.173.2023.01.20.00.25.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:25:57 -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=o0vr145+; 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 1pImhD-0004qg-Bl; Fri, 20 Jan 2023 03:24:23 -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 1pImhB-0004pc-PC for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:21 -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 1pImhA-0004eL-7s for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:21 -0500 Received: by mail-wm1-x333.google.com with SMTP id e19-20020a05600c439300b003db1cac0c1fso3791430wmn.5 for ; Fri, 20 Jan 2023 00:24:19 -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=V49wRNxwVefl714Mn2UmK/YcN8/tnExcJzoF8D3gX0Y=; b=o0vr145+gFbKvwUSR9+CpLM+GMLsJSuJbsC54vIZlk+ggA6K0uqDBjISQlaLvLV1j8 9k6gO5YfKHXmnXBKPLKW0RXSuILVsngZTvi+EXZMKc4+ZD2OAGqwbo8CaOaESJ7HZzs4 w2fcXU0VDjXsy1g1Q/lg4PkACpRu384iKN9JilIQbOQUFDvTT594/YiPU3861zLwsYvW yvt9oH+Tv8VCsZH7vjwFdN+5/mX0vkEjIqDS7s4zpGlQB+WQ6XnQNV0KpCzfoUSMZfD7 cncvB/DznVuqUICow5wb3yHe/YfpWmfDBcwYG/2tA1RtSLzmt7wD6YoZ/UL7FZU3EIt9 iIdg== 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=V49wRNxwVefl714Mn2UmK/YcN8/tnExcJzoF8D3gX0Y=; b=vZzaMY8YzaP+FFT5lwaXPT9f5CDqScP81rBQ6gq9bkvRfieIW4Q8PY/U30nZO4EzdD 2Cq/k63ul3ZK8QxZWx7XIhhMJI6+f9PvxkK8OzH9HnuiR0iVptTiVVQSiDJt7SPE6e1W ZKNAbO9/lWbogUkemlK1AGTA5kPPZ3dD12UTPqtZOPN3m418BIIf6hefyi6SKn1AQ0xt xUgzTl+s2KC58k9LWvKMKzkjZfBV1TIFlmFU+vyG6Me5hQNU/Kj5ag1HvPk/usCWewrI gx13Xfn3u4aGeAwvuqhVIbFnBaOpGuyD9Btig48ULxVrvejvc9B57sFk+J7mIdiLBrVi R0wA== X-Gm-Message-State: AFqh2krWuOc3IL8aYXh3mhaKHOxTutb3wC0z15JKUrbV4OuNKqfU8e46 GED+9u/lo9EtNPisnHrGE7+NQPNyIM0bYVRg X-Received: by 2002:a05:600c:2255:b0:3da:f950:8168 with SMTP id a21-20020a05600c225500b003daf9508168mr12617985wmm.35.1674203058641; Fri, 20 Jan 2023 00:24:18 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id b10-20020a05600c4e0a00b003db0cab0844sm1507471wmq.40.2023.01.20.00.24.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:24:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 07/11] tests/qtest/migration-test: Build command line using GString API (1/4) Date: Fri, 20 Jan 2023 09:23:37 +0100 Message-Id: <20230120082341.59913-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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 1/4: Convert memory & machine options. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- tests/qtest/migration-test.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index f96c73f552..9cdef4fa65 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,29 @@ 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 Fri Jan 20 08:23:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 644629 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658407pvb; Fri, 20 Jan 2023 00:25:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXtm191NU1i/DNHqwjTV/G7WW64JkD+1vlYnaU/thRQAdDt9QgSkcY4F4t8c1bZJ/SVPyAwG X-Received: by 2002:ac8:664a:0:b0:3b0:b9a4:b25d with SMTP id j10-20020ac8664a000000b003b0b9a4b25dmr18524676qtp.67.1674203142302; Fri, 20 Jan 2023 00:25:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203142; cv=none; d=google.com; s=arc-20160816; b=LNPFg8UdL6WrdWq1kok6oAx1hXWxxtyiFhWcqavbvfVhCbx7Ln70ZitIdmf5u+LR1L sRoPcmydrOrfLfJgLjsRWxH10vicwWd8HV2GqlyJXp99SHswwCEI0RIHuEucG07mkNJB DJRy8Y/XmYCwh3gWpqD8T0qE7yT/fqUE8KfIpArQN/LXol8u2B82H91J4FpM9/dfxGkN 0mzsV5rWrhehB/RjXmXSdc3u68ck+kintMVDMQpBq/HjXVrXQjNS4w8EBs4QVjF1gIc8 TVjG9sbGz4O1/DuGHFemOO/qhKsYPgCuKCNe20FbpBCVT0DZgueBC68GdWRl+MzLvYIb srbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lFLQeKMXh/hwQNy/OTcwcNWvQl29Jep2/8SFzcZ0GJ0=; b=Ge88/xAaazOZutXd/zWxOQw810m9k3FeuDQ3YjFi0p3qlhePR5goXA2j5nTdAT5rws Wutk3FxjYPKYsYniRYV4hkysF3Zo8GZM6xrdcT3n3zyRNLoexdHQAezRHRtEN8BbfWfH cbBKj6RM1N8S9FAKoOV93SCSR+2W2Hw/iknhVrAqeUQluvrSmBD8wOxPdSaMsHLpwyvH J8J5N57r0VO1vTDLXLzeYM/qmQMpgdHQv+x8mbpzi7KyZZG7JKJ5YErczJPHUox7Q5CN XRNE72BNGYpWHRaLZVe6h33aEw7Aflo35q9IOoVmob+DXWy+Iq3YIXLoNjEmooCKT76d dHrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IF5pz5Ep; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u13-20020a05622a17cd00b003a542aad5a7si10560432qtk.697.2023.01.20.00.25.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:25:42 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IF5pz5Ep; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pImhH-0004tm-Ua; Fri, 20 Jan 2023 03:24:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pImhG-0004sL-Sl for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:26 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pImhF-0004er-By for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:26 -0500 Received: by mail-wm1-x333.google.com with SMTP id f19-20020a1c6a13000000b003db0ef4dedcso5272144wmc.4 for ; Fri, 20 Jan 2023 00:24:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lFLQeKMXh/hwQNy/OTcwcNWvQl29Jep2/8SFzcZ0GJ0=; b=IF5pz5EprsFwFttDnqA4mYpz1vqAulCqFdgm1415c/oQai+BOzDMRJ+lSz+uQSveBj GtzmEx/uiLWnAmp6lWJkD3OIWcKGplUAWSNz7WAs1r0Euw/ZNmRkIePLJybTW1YSvX5k AZhQbrcZ+lAxtUR372TG6VIZ9hwEJPWg0Apml16OxxQ1UDE5m0nZ6yyLR0aM6HOg1Yjw lEuzCwKmXxbPnKoQDE+LmtqJWR4KfOwV7QU9ePwYV71SqUCOLhVUNI8G/XpsgQAbmX9z CWrymwzf60FnSeRQP9q0Eg106RlosCXMD+KUmvsbeWwSaUveM3QwmR8LOIvzSBrSAPb3 eeAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lFLQeKMXh/hwQNy/OTcwcNWvQl29Jep2/8SFzcZ0GJ0=; b=Wz8Kp/yK7ocbfJutF65Q+aKCz5erKLCDJMs9i3rtJuCpzGn2mMuCcMDtxM3I16T8LD LvYOIZXLmeX2UhPVLSFpK0P52ptvnG1l4UOY8Cp0E9FJ2Akne/cOG69ztJ2Xfq7l9cib 7olD8JMYRPAu0/6aQfjCTDgLBXuah38w0329Upjz2WtQUj5twGjYndPzKpworOOg/Ctr ziC2MDnZ4RNtv7iZdViK3YTLPnYWsS61ue8bSRvmrtMfIRiRWkJ2fliL7k4DB+PP0M2D cvIvBSe1Rl/nI0xLs1bHPXVd3wOIHbADipbh9ogt/bwYpEJ+kjUB8Z2rEnjU9nct4Ash 9qfw== X-Gm-Message-State: AFqh2kpLWH2EZCfSpIsmQlhkoJOUUZun9NVqBp4hGwLEsyyRvDMbvy+W 4Ra6ydTHwcXF1e29YtvFXfmKJEgipdC/s9MX X-Received: by 2002:a05:600c:1d05:b0:3d2:3be4:2d9a with SMTP id l5-20020a05600c1d0500b003d23be42d9amr12725435wms.20.1674203063879; Fri, 20 Jan 2023 00:24:23 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n42-20020a05600c3baa00b003d96efd09b7sm1731671wms.19.2023.01.20.00.24.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:24:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 08/11] tests/qtest/migration-test: Build command line using GString API (2/4) Date: Fri, 20 Jan 2023 09:23:38 +0100 Message-Id: <20230120082341.59913-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Part 2/4: Convert shmem option. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela --- tests/qtest/migration-test.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 9cdef4fa65..670097a956 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -588,7 +588,6 @@ static int test_migrate_start(QTestState **from, QTestState **to, g_autofree gchar *cmd_target = NULL; const gchar *ignore_stderr; g_autofree char *bootpath = NULL; - g_autofree char *shmem_opts = NULL; g_autofree char *shmem_path = NULL; const char *arch = qtest_get_arch(); const char *machine_opts = NULL; @@ -670,13 +669,10 @@ static int test_migrate_start(QTestState **from, QTestState **to, if (args->use_shmem) { shmem_path = g_strdup_printf("/dev/shm/qemu-%d", getpid()); - shmem_opts = g_strdup_printf( + g_string_append_printf(cmd_common, "-object memory-backend-file,id=mem0,size=%s" ",mem-path=%s,share=on -numa node,memdev=mem0", memory_size, shmem_path); - } else { - shmem_path = NULL; - shmem_opts = g_strdup(""); } if (!args->only_target) { @@ -685,12 +681,12 @@ static int test_migrate_start(QTestState **from, QTestState **to, cmd_source = g_strdup_printf("-accel kvm%s -accel tcg %s " "-name source,debug-threads=on " "-serial file:%s/src_serial " - "%s %s %s %s", + "%s %s %s", args->use_dirty_ring ? ",dirty-ring-size=4096" : "", cmd_common->str, tmpfs, - arch_source, shmem_opts, + arch_source, args->opts_source ? args->opts_source : "", ignore_stderr); *from = qtest_init(cmd_source); @@ -700,12 +696,12 @@ static int test_migrate_start(QTestState **from, QTestState **to, "-name target,debug-threads=on " "-serial file:%s/dest_serial " "-incoming %s " - "%s %s %s %s", + "%s %s %s", args->use_dirty_ring ? ",dirty-ring-size=4096" : "", cmd_common->str, tmpfs, uri, - arch_target, shmem_opts, + arch_target, args->opts_target ? args->opts_target : "", ignore_stderr); *to = qtest_init(cmd_target); From patchwork Fri Jan 20 08:23:39 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: 644626 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658318pvb; Fri, 20 Jan 2023 00:25:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXvy7Hpa1Ff/RfqzZ9gTdEhMIbrxNw9YXJNlIfjvqqAyidqCFi8mQ13dIS5G903E6YZIeKJN X-Received: by 2002:ac8:7517:0:b0:3b6:98c7:48fd with SMTP id u23-20020ac87517000000b003b698c748fdmr2208119qtq.15.1674203126182; Fri, 20 Jan 2023 00:25:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203126; cv=none; d=google.com; s=arc-20160816; b=YWRO29Ms2Wr+WapIxFbEscWKiF8iw8VAh9JHZMidttG/arl3a5BofUPmCk5wqX2mOO N9bBcJizUtBqBB4pksyCltrTvkx0XQ0TtXiuXjtoyZ1UYxSNH2VMF480StVhcD6l0SRY yKSAYKbvgB3NwpSNE3xkrrlj1MiqEOsBzc7aKLaUsMhpodaTjElMQUEcMMOHg1ggzwpg N2FPPouapiorFNXqglsZM84C6d6xeFkCIvIzY1wNku64J1lVihZbWDrJ0smNoIv7uHV/ I8/zwNRJyB3w4NnqvkEsJn/zN4xIolsJqMkpPSwW+uu8QxsaVy42s338GfTAX5ZjVy/l wA6Q== 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=W5TXNXh3AquUKHDIlWKH1U7Rhf/WLE5rFLgjN1F2D1o=; b=aLuVjIQdS3HB0Roto+7VUsXEUbLmsPFwonUjMLj5She94JPnsuGXkx97HuRPDbLHAh zhNXasXfY/ldO3LAZHQcis3CqcKgRdkK5S7HmG0pXFUDlMl5CWiORJ3dDEMZ44QTE5SH Rj1dSiC8/xa8pt1c6C/ikOrY9B+lPxb17D+guHR9BQwHTdmrTjY0gumlQ3A6aUPQOuIp yKg/P/vFq/zJHxsJd1eYkipZ7ChELKgK7cAoT8qNywmyiwAH+gnRLoi1LBjf+3RLU7/P U7FLmEaYzlbHrcCBZq3+OMcZKri/L+Sp4yuS7LJp7jsiwlyccJaa6HrwoIM7215+9PdW 8gog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m+LYgICb; 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 s12-20020ac8758c000000b003b53591e4e3si10250806qtq.353.2023.01.20.00.25.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:25:26 -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=m+LYgICb; 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 1pImhM-00058n-U8; Fri, 20 Jan 2023 03:24:34 -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 1pImhL-0004zF-CZ for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:31 -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 1pImhJ-0004aS-RB for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:31 -0500 Received: by mail-wr1-x42d.google.com with SMTP id b5so4182365wrn.0 for ; Fri, 20 Jan 2023 00:24:29 -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=W5TXNXh3AquUKHDIlWKH1U7Rhf/WLE5rFLgjN1F2D1o=; b=m+LYgICbB3UFgva2MXKv+qAr8r7Oq0PXc7tul9i4gg3Q/F9UhvTonjUMBspmItaCqX hMq3q7Rj35P7cRKzQT4KGysEppzXmAs8sYgRrhpQWuxl9vNEWOpR5hrBXdx08NnojJWy 5kjbKLwb2x3F8sk6dfHV0zgFpupBp5sHK5kgcpPzx3kXOsMOJEru80ppnyANl9WmWwjP zABs3FVzfNK0OVnxDpvlcucXuWppqxDEzUAbh1NdE9Sd51j/wtbH+bcFOtMH6lpGOmkZ jIUfHoaqRi9VCMIx1DAh7tGQJRzkmrMLKy9WfbWIrVF+SeScEmGcOnacVdWsM78Raw2p mOxg== 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=W5TXNXh3AquUKHDIlWKH1U7Rhf/WLE5rFLgjN1F2D1o=; b=KJZk1fKo5pUrJYPFTftvL19OVB5F1mFrxE57psT7Z+EV3gU3evSsXSKoKkfF/0eMMB k/eVkdxhtZNmU/pcXERa4etjlreDdZmGa5IUq07QtV6iC7DqDsKS89Ah+oa0QHHzGHgu z0c3i6nBDmzzahx/eqoZ2yqwKFbz/6k5hrhNKRRPmYHKsgHAbqS5bURyc2Z7v4GPWVgX z7bOS+9Zz2LWagSfkxmC/URbgDIMgY2OjpO6tXJCY/2S1mv8W3sxxm9gBiLMMD7MXWE+ 7HPoZJzVm5L17spLDKKF/6ZNigbsK3yOH/by6Zrydf/PRpY6QFw4pPhMSpTBVrv9U3DY +hHg== X-Gm-Message-State: AFqh2kp9hsQ8CnZO+/U93Pk7PKRIJoGjTUMlnfyPTriix8SDLKdIfeqQ 2D1HvEg+SMKovhLyPxvR+2JSMRikbaC/vBrk X-Received: by 2002:a05:6000:608:b0:2bd:db84:d663 with SMTP id bn8-20020a056000060800b002bddb84d663mr8787590wrb.5.1674203068931; Fri, 20 Jan 2023 00:24:28 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l5-20020adfe9c5000000b002238ea5750csm21286817wrn.72.2023.01.20.00.24.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:24:28 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 09/11] tests/qtest/migration-test: Build command line using GString API (3/4) Date: Fri, 20 Jan 2023 09:23:39 +0100 Message-Id: <20230120082341.59913-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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=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 3/4: Convert accelerator options. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- tests/qtest/migration-test.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 670097a956..1ed3505c91 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -603,6 +603,13 @@ static int test_migrate_start(QTestState **from, QTestState **to, got_stop = false; cmd_common = g_string_new(""); + /* KVM first */ + if (args->use_dirty_ring) { + g_string_append(cmd_common, "-accel kvm,dirty-ring-size=4096 "); + } else { + g_string_append(cmd_common, "-accel kvm "); + } + 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,12 +685,10 @@ 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, @@ -692,13 +697,11 @@ static int test_migrate_start(QTestState **from, QTestState **to, *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, From patchwork Fri Jan 20 08:23:40 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: 644628 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658366pvb; Fri, 20 Jan 2023 00:25:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXuk7cvWh4gxCmzCP4wv0XcY1cJdnJqzw75J8xUKx2OD6i7eU+TU2fjDKDWzZpiBp9fErU1m X-Received: by 2002:ac8:718d:0:b0:3b5:5234:e895 with SMTP id w13-20020ac8718d000000b003b55234e895mr18789090qto.15.1674203136111; Fri, 20 Jan 2023 00:25:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203136; cv=none; d=google.com; s=arc-20160816; b=WnPVdz0Q1lsZBaTAw5vFBMPD3hGKL86EbRt2HPDlSHDBLzrA5a2BArhvpDnUyx/cCS XAaYZRl9EoX7VsTruCHQYRJvkf895JxIOqLHRPuPq1EnS+FC1ag72VQnqarsGcxzF0oO uiQ4VmjU2mZ8oqW618NcssAfbIYQN6eYDSXTq2hN8HRb2gv4k21ya7DIYCpLgntosYFL y1Eq1QvojUEZmZxiueU4qNZneDMZX88aI/h393+w5J+FEDdO5+POZe9yy6CWJB4Y3EdV NjaNmg+G8VpsgWMjSH6aVhY9/sdiWIgj2iHF4IVKljVrcpz3ZoEdm//Q1DpOa9TjETYq uECg== 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=8eiWB2mgS5s8IODt1mSJBolF54HXrNWV0tPwSRIkLm8=; b=B5yqv+kj267KpFu6CYQ/OLwqVSB0wf7B8qFZ2y8qf7Nt1yzNuWjAgu61JOqVwUDTcS LN5Bszhu94WAjZyeh4diER20JeNvexOmZmP71yVyKLOtXu7MuCYDwIZjXmRFGejGpG0h HAAsuIpcY8UDwzJoHmuUfqqQ0RdUERZc88LPnUG0rxtMCPU9Fmj+SUcY1/6qpJ6/+Z0t WPnO1pMkKP3YN0684w0nwDxTqdauNo8fFErWKxRoy2UrRjJSPEozPbOrF61hr5AcQwGt Ci5GFathjglqR9Yuwq6iha1iAt3GP8jwXkdWG4rADB0OrVytPjJcjaYYfyGSGSNxK7du 5i5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T9fNlr7q; 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 i10-20020a05622a08ca00b003ac4b229ae1si548605qte.129.2023.01.20.00.25.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:25:36 -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=T9fNlr7q; 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 1pImhX-0005O9-0R; Fri, 20 Jan 2023 03:24:43 -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 1pImhS-0005Ia-QX for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:38 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pImhP-0004gJ-HP for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:37 -0500 Received: by mail-wm1-x332.google.com with SMTP id f12-20020a7bc8cc000000b003daf6b2f9b9so5273068wml.3 for ; Fri, 20 Jan 2023 00:24:35 -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=8eiWB2mgS5s8IODt1mSJBolF54HXrNWV0tPwSRIkLm8=; b=T9fNlr7qdkM84eEPuX5uCJ76nlAtPpVEul0xug1Pz08e652KrE84UQWICNDZMBTEp7 If0+D41sb1wOoRWMMpmcG3Ab+JKEsBgY2q/ruawR0hNU3/U++QQc+uRklunMUUxHeyj1 /o9FbNoE2iSiLlW2WdqfMOGYsNe/r9RYgTMwmBh8S6G3V+Ngr8M55U4jM+pIx5lDH2CC RopvZgZ0ERsE0Z4U7m3pZLlyclIxTFdwDKLavsoz1HyTOm5SN2gDgS09QOm8275Ze7Ux cMuOdMbkKTi9h7XrwddtIb3AOmk/0iUmW9B8ifWc45hqvc03zmkANKHf6RpUUyDRyP44 CliQ== 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=8eiWB2mgS5s8IODt1mSJBolF54HXrNWV0tPwSRIkLm8=; b=eXL7CCYF8lVLOdpMH4KYSP8uvSQd2AP6Kykuj1j2HuGwIxtjUwWfuvdpQCdl95kTd/ oWF1jOa8DEjER1HI0TMuc+d428q2afXXfcxiBu2Df+LXuer3gkGrsv9ZDwiFquxrnoMo PU/WnjFig1V19dmVu9sr6saTuz3g6q/L1Gi1xckUHCzCfn2P5nEc+muPqiQlT2I/nwr8 9CRS+AXr4ZAjTEyV5Dox45++lrJ9hZulT4lotNr19XPSKZfV2sUa2xkaFzm2UhIkzyIx OFyvxBL7SEb8oaVbY3zIJHvOOIxxdnEsiTwYKZ2o8aKB2yyzdGB6MDz9FrOaBOJxy5Bm AGdQ== X-Gm-Message-State: AFqh2krUg5WypVB++OvqqraiNeZN3V5z6ho7Fg1Ocz7gWmCNE6haIbXh RyzHVATboTpAFIs8Nc3Pxo0XdmEkyboX/UUf X-Received: by 2002:a05:600c:354e:b0:3db:331b:bd57 with SMTP id i14-20020a05600c354e00b003db331bbd57mr1073167wmq.23.1674203073952; Fri, 20 Jan 2023 00:24:33 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id hg8-20020a05600c538800b003d974076f13sm1552992wmb.3.2023.01.20.00.24.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:24:33 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 10/11] tests/qtest/migration-test: Build command line using GString API (4/4) Date: Fri, 20 Jan 2023 09:23:40 +0100 Message-Id: <20230120082341.59913-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela --- tests/qtest/migration-test.c | 53 +++++++++++++++++------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 1ed3505c91..e7786bcbc5 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(); @@ -666,12 +666,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) { @@ -683,31 +680,31 @@ 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 Fri Jan 20 08:23:41 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: 644632 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp658509pvb; Fri, 20 Jan 2023 00:25:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXux1n+BdaM6ZhqBBhOjqh4etRqmVFtqJEkFUVrLluEV21YF1xjERrkSrnp6yX8/rrjex3Fu X-Received: by 2002:a05:6214:3901:b0:534:a801:112f with SMTP id nh1-20020a056214390100b00534a801112fmr24679171qvb.46.1674203159374; Fri, 20 Jan 2023 00:25:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674203159; cv=none; d=google.com; s=arc-20160816; b=NK6BnmUwZRiVHOZ8X4jwXgfzfehvh+Ib1WDhfj1OnWL/e0K5jlDsI/C87vj08JquAU nj8ob/hCHt721CzQwHnYlE8axYw1BX8S4F3fO+1PHlU65uU6Ak+O4xm+/s0U4rUls7RZ hHi1MH/MeUXEJO0pN9PFUfFxLcxlsFr44n/sMeTaRPW146Snn1MG8hEl/Mq3LNY0c0yw d2PLH3w1CIwmuSkDpVOB2vlKxqtT+bx83Now5Sm8a7uzk5CONCBdcujcSLbRrp43Q2kb WpsIuOk9UkFjY8Bj84typa6I1y3hEGaEBFyxNlDFaf73oVZox6u727FvalYqn81LBXns Q/OA== 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=ZIdBPotAEeCeaU6kILE+ldJwz4Si4KaekjZjTSfk694=; b=Z+k0Qr71DQ1WM1R1QRpM4wel5K15+Cx/vdehhAVDNwN22+P5gQzVfcyvsJjtI8/4QK tRNW2tJFiI3wxdpXiE0JKciEmMkaHhEd24G/CmHdIIxP8dkSwqoerUyLLVBo8ris7SU7 679b9cg3tlE21qwDG5IO3fJ9GiwDx4Xiu+azJsRpFxtTxOHG7DiDcpR8of6PJqLlf/y3 by02xc/H5eguj+5p/2KvEUJTDcfDlmQO298wCSpRWfc08N2jD29FFANoKrsNfFOhkXbN +T2M4bWeH+qItogqJG42Jr0I+ZAJEEERNuHmRcbrDi8Euk0dfFwOJxipOLShz1A6IGsq Lscg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sHvxXtKK; 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 3-20020a0562140d0300b005322ef6c7dasi20762085qvh.587.2023.01.20.00.25.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jan 2023 00:25: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=sHvxXtKK; 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 1pImhg-0005Yc-3T; Fri, 20 Jan 2023 03:24:52 -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 1pImhY-0005T0-85 for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:45 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pImhV-0004h8-GH for qemu-devel@nongnu.org; Fri, 20 Jan 2023 03:24:43 -0500 Received: by mail-wm1-x335.google.com with SMTP id d4-20020a05600c3ac400b003db1de2aef0so3068174wms.2 for ; Fri, 20 Jan 2023 00:24:40 -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=ZIdBPotAEeCeaU6kILE+ldJwz4Si4KaekjZjTSfk694=; b=sHvxXtKKINDL5U6Fdhmg7M/qsjYAQGf7jqQBR9ve+9ggFVkRejHOhRUwvWa1s0Q5fx +g8BJsZ3n/aQOGSDk3KKxYaov7iqSrSb5nHxix93hueSgapMFY7RArUk2lMxlJQ+azAg nggVngL6RMipESmiyLR3BmJ7CYRz5qOZZiGcIE0DIPUvQUDHdIb9QyWPJdURibsk+hOI SJmGbuLeJTfg2gmxWxlnqiqd81UcfV3aFXKvHb6qA+/xgQHPoZTlW5JQ9pnNldiawUIL 4fPBBInWldoqtoBuvL9DvmCgRTP4Pr+YXuymCBo8ls95IoW6MYwjDdgq2BG9nnSo+O4y SZug== 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=ZIdBPotAEeCeaU6kILE+ldJwz4Si4KaekjZjTSfk694=; b=t802sdBiMr7MXHbYDaiTgCuhJPYg2ZB0e3oXHG5vEAK/xCUcrg+G8tvLpQ4fo4T7D3 I6w4k8iO8+41cwgFezGhxJY+N/U7ln5P1PrvySMla1/1hF+qh6aYoZjK9HoRHIH+DURt Fu4Fd9BWAVwOWxYPz4GWMXbn+txSvSSBhT7OkYn7SxJI1OJWtLXJ13nhp8QmleynuJyI QbRaCp9SMip8ICLBbs9EHTFg7o2vGxPk5Tu6+DGubNPYmK3dY7rb0XN57G3PpL3FC1O3 MuUAu465l97/KnOXcOrXthBv2YKIatlYQwXHkrsg2ZR7VB9WFAKiUVITvUaiR2ZrZcsv b65A== X-Gm-Message-State: AFqh2krwqc1Pf7Bhr9scimFPXouVjzqaLqg6WT9by9D9rloVEM2H0YZK mzCIQHAmhLydoPTUz8ICjauOXO5fpwerp0cx X-Received: by 2002:a05:600c:a29e:b0:3d9:ee01:ae5b with SMTP id hu30-20020a05600ca29e00b003d9ee01ae5bmr13156308wmb.12.1674203078971; Fri, 20 Jan 2023 00:24:38 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o28-20020a05600c511c00b003dab40f9eafsm1611013wms.35.2023.01.20.00.24.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jan 2023 00:24:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , Thomas Huth , Fabiano Rosas , Juan Quintela , Laurent Vivier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 11/11] tests/qtest/migration-test: Only use available accelerators Date: Fri, 20 Jan 2023 09:23:41 +0100 Message-Id: <20230120082341.59913-12-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230120082341.59913-1-philmd@linaro.org> References: <20230120082341.59913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 Reviewed-by: Juan Quintela --- tests/qtest/migration-test.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index e7786bcbc5..b0eaddbf5a 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,13 +605,16 @@ static int test_migrate_start(QTestState **from, QTestState **to, got_stop = false; cmd_common = g_string_new(""); - /* KVM first */ - if (args->use_dirty_ring) { - g_string_append(cmd_common, "-accel kvm,dirty-ring-size=4096 "); - } else { - g_string_append(cmd_common, "-accel kvm "); + if (has_kvm) { /* KVM first */ + if (args->use_dirty_ring) { + g_string_append(cmd_common, "-accel kvm,dirty-ring-size=4096 "); + } else { + g_string_append(cmd_common, "-accel kvm "); + } + } + if (has_tcg) { + g_string_append(cmd_common, "-accel 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) { @@ -2460,12 +2465,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); /*