From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661334559; cv=none; d=zohomail.com; s=zohoarc; b=mOengurF92soLuE3qikTJDGe6grQHHUjrUc2grJvymRLkps0Lkluh4VgpKH0jJJHc7HLNABWFbUk8doYBJY33gwrydSWqvUmYJ/74OvyhG2P39yxa7rdDViW8iN41/c3W+zFaUDqZokM9fTIEBc9qpd/5tUDW8jdrL42PV+Jj4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661334559; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1DPLOLxJPplKModHASULqKHpd5A7q1S4jYAA/H54UVA=; b=KrG9ldrVlpEt1dVyJZqt7SfV7tvnA8XtLyrq/ibfJA3Qs/XJYCm5UH/dxV/QbTXMgNJq2Se2MCWl0KmwZccKq0O58E3BcaNp0EmbDju9pXbFgPZE6J6pBK7Vr3uJ5qn4NwjfYXuv1GIJxgctN5Byk3bRpIAhxcQ8xYhvs6IGzvc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661334559923963.3875308639806; Wed, 24 Aug 2022 02:49:19 -0700 (PDT) Received: from localhost ([::1]:58316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQn0g-0001b3-LW for importer@patchew.org; Wed, 24 Aug 2022 05:49:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmsU-00012L-D0 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:40:50 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:41972) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmsS-0001GJ-Ov for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:40:50 -0400 Received: by mail-pj1-x1033.google.com with SMTP id p9-20020a17090a2d8900b001fb86ec43aaso593984pjd.0 for ; Wed, 24 Aug 2022 02:40:47 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.40.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=1DPLOLxJPplKModHASULqKHpd5A7q1S4jYAA/H54UVA=; b=NTMJESw9CbFuTPFTy7uDbRb7S0q4eiAUy9o9dKmBv5zpRZDNA8lqIkJ+UlpVJTCLpd EX0PfRq/IkFCg2Ss90LMEawZU4SYIlOdqkx8RbE09Y0CqsGJcxKLK6BET+RcoPbQo6/J V/YJQvhPFTWvmZlwgLUeODuOi6vwLCvsCGexqxEVstebFUMj5DLO0rz9lXIQdpyKhfFu 7oA7I9jlze/5ip/RvD7em2qId9qwr8YfKEGKknSb5ivQSG+ZYtXTnJX89I2vii+HqGop k4TOzQ9br5yN0iLIaAeEAMJCvJDA/2Oca9moGHOwhd0CUZZRv3zY+kgdq4Ro+N4C+hnj fCqg== 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; bh=1DPLOLxJPplKModHASULqKHpd5A7q1S4jYAA/H54UVA=; b=qHeAtz73o+AyOj5h+nKQ1HyIsCVtcc/IjOSvP8x/uSygpDiNDbhwBDbyC2EH11Kf3+ kkqrU65Im5BNk7j0fOee8pIKJWWF7OcFAt8GctHa56ywGLSRjo9Ewd7vZEDjyOu6oGCR V29Hfx0G6+hONyuRWu4/L1i9X9Jt4SXzD59ArDklrz2hW5zhMcqP5t4tnWOyaKVJ+MUD +Eyz4gZml0FrhBljF83z4UcuKi8Ls12UhUfuBUFj/2J/DLoEN50MfUh7boi91Ebbg8Gp hg/s5avgWUXhA5jgx0LWV+31+kb1Zhr1ojZJblt1+JFigMtIoAq1zAmQLZUuCzLuVmeE OBtw== X-Gm-Message-State: ACgBeo0QJEmJMk5mGbZHQtK3gmA85IcW22yPt6yt51i4wNRtMTjaa4Yz VVz7h7iMVNj9DXyHXB1gv10MjDj+hPI= X-Google-Smtp-Source: AA6agR4zk0Xa55oBSL+RlSkfR4P9shz7zdk6fr0tBv+CAIvLj0MPkj97lg0oUYwhGQOUO+jgxZKitw== X-Received: by 2002:a17:902:b413:b0:172:a628:7915 with SMTP id x19-20020a170902b41300b00172a6287915mr28472711plr.99.1661334046118; Wed, 24 Aug 2022 02:40:46 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Alexander Bulekov , Bandan Das , Darren Kenny , Laurent Vivier , Paolo Bonzini , Qiuhao Li , Stefan Hajnoczi , Thomas Huth Subject: [PATCH 01/51] tests/qtest: Use g_setenv() Date: Wed, 24 Aug 2022 17:39:39 +0800 Message-Id: <20220824094029.1634519-2-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x1033.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661334561913100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Windows does not provide a setenv() API, but glib does. Replace setenv() call with the glib version. Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- tests/qtest/fuzz/generic_fuzz.c | 8 ++++---- tests/qtest/libqtest.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuz= z.c index 447ffe8178..afc1d20355 100644 --- a/tests/qtest/fuzz/generic_fuzz.c +++ b/tests/qtest/fuzz/generic_fuzz.c @@ -994,16 +994,16 @@ static GString *generic_fuzz_predefined_config_cmdlin= e(FuzzTarget *t) g_assert(t->opaque); =20 config =3D t->opaque; - setenv("QEMU_AVOID_DOUBLE_FETCH", "1", 1); + g_setenv("QEMU_AVOID_DOUBLE_FETCH", "1", 1); if (config->argfunc) { args =3D config->argfunc(); - setenv("QEMU_FUZZ_ARGS", args, 1); + g_setenv("QEMU_FUZZ_ARGS", args, 1); g_free(args); } else { g_assert_nonnull(config->args); - setenv("QEMU_FUZZ_ARGS", config->args, 1); + g_setenv("QEMU_FUZZ_ARGS", config->args, 1); } - setenv("QEMU_FUZZ_OBJECTS", config->objects, 1); + g_setenv("QEMU_FUZZ_OBJECTS", config->objects, 1); return generic_fuzz_cmdline(t); } =20 diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 8c159eacf5..ad6860d774 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -1424,7 +1424,7 @@ QTestState *qtest_inproc_init(QTestState **s, bool lo= g, const char* arch, * way, qtest_get_arch works for inproc qtest. */ gchar *bin_path =3D g_strconcat("/qemu-system-", arch, NULL); - setenv("QTEST_QEMU_BINARY", bin_path, 0); + g_setenv("QTEST_QEMU_BINARY", bin_path, 0); g_free(bin_path); =20 return qts; --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661335437; cv=none; d=zohomail.com; s=zohoarc; b=OyfespSURMWfW5S90/ZjE2dCSJpMsW6RuuiDWdrM2JwUCmnKMHDws+JnGgwnvdRvBT369Tu4IcoqWwaVGGyM3bZYDUZMYbfQXEp7ZInSskYTO+/EHEnxvQQxmJ1V6k6Dopz6WFjt7IaEUAkJxCp+h+JoQXNZgsLk3l36jlEq8W4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661335437; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UXKRju1FGFN9DPiFZ4J+hFGTgwWa8qqlnkHV2v3j370=; b=MNFhRR8yPrd1qCTGG7EToMBFlzRBdJZ3qC1sUqesndP+bo8RoAkg5Z0vSndax/XmiMU38E4ykSpwQvP1RffXZzYEL6A9vo8TyXSaj6qIBtD3/6M0wjdLilvDddlXax7KKskgrBnzeh/oCLiv6eOHpPx7W37O185AGZ/PF6wxf0o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166133543729030.175744746014857; Wed, 24 Aug 2022 03:03:57 -0700 (PDT) Received: from localhost ([::1]:49422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnEq-0007x3-1U for importer@patchew.org; Wed, 24 Aug 2022 06:03:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmsc-0001L6-2E; Wed, 24 Aug 2022 05:40:58 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:36445) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmsa-0001Ho-1g; Wed, 24 Aug 2022 05:40:57 -0400 Received: by mail-pl1-x635.google.com with SMTP id c2so15200937plo.3; Wed, 24 Aug 2022 02:40:55 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=UXKRju1FGFN9DPiFZ4J+hFGTgwWa8qqlnkHV2v3j370=; b=H75A5dn2AgcFzIemjLr66iiTva3GHNNLzQ2BqKqEOqymi/V9I9hNPP+jPXbauTFtpD lt2vzI9GKKbj8+Q9a4joEw+z0TtKwxnMea2/D5f1a0xMRY7FSd07R0zmHePNlklYJ2JS Szuh/Ao9ywa6TWQZ4jXFflmeqvQwkrA11V/yn8y77QKNnHLMLJwjXFqRzuu63mUXsbRW JKiPqbvnpSxbOGmaQtJus5U7uZ9rXI8HTAd0v9SvbxJMLbzs1ABvT2WX1PE5IOgzQD4m CzQzCAhHGF4ZZBvDVVZJTm2r6mdSSmSKiEZMqOUfYbFMB5mixLqySMaPI5NlsXyFD2gn 37sA== 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; bh=UXKRju1FGFN9DPiFZ4J+hFGTgwWa8qqlnkHV2v3j370=; b=q7x3j7bGS1ZSLgHA4J+0eLMINHJxI5gYJo007rVNpWSDG3+tkSCm/GoM2E1NAeVJ6q EdZzpl0mvAJ/p9sP8/SfaoRfnvT3BcFK+chPtkf329aIBkqUp8rkgBwzyL6F4753VabI 9CeE9mXfN8WgYfwPoPXpxcfZrZfF3pud+C9fJJXB/Ek6MHugVt7kRQfLKk1auXm7NtsG G1q9N8cg855n7mCLj1CUvv/u4WzdeR+cxTaVfTXz3rmQ3sQ9TufOwbzYW0x3E7T2HsYB nCUz4ApWKuXmNdj9GLVslRxlx3Ko1mERIldy3ozZVsqdIIYAGJKxNhCqGyvdXMdvKv6c VZkg== X-Gm-Message-State: ACgBeo2u+sUceZmGpuYNhDzl8GAKkCk7c4/8kX5iHcbkLYvvR5A/nt3l mBhY5eiyAhyO0VB0SIBogj3tgN7AaO0= X-Google-Smtp-Source: AA6agR6aFBd6Ct7J3zKfU/Rxwxz5UguxZ2dUU+5JppZ9BjXc75nNr2MK9jtT1QIIg6o75yc8NqYmoQ== X-Received: by 2002:a17:90a:f0c9:b0:1fa:e017:7d13 with SMTP id fa9-20020a17090af0c900b001fae0177d13mr7486488pjb.128.1661334054042; Wed, 24 Aug 2022 02:40:54 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Alexander Bulekov , Bandan Das , Darren Kenny , "Dr. David Alan Gilbert" , John Snow , Juan Quintela , Konstantin Kostiuk , Laurent Vivier , Markus Armbruster , Michael Roth , Paolo Bonzini , Qiuhao Li , Stefan Hajnoczi , Thomas Huth , qemu-block@nongnu.org Subject: [PATCH 02/51] tests/qtest: Use g_mkdtemp() Date: Wed, 24 Aug 2022 17:39:40 +0800 Message-Id: <20220824094029.1634519-3-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x635.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661335438745100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Windows does not provide a mkdtemp() API, but glib does. Replace mkdtemp() call with the glib version. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- tests/qtest/fuzz/generic_fuzz_configs.h | 2 +- tests/qtest/cdrom-test.c | 2 +- tests/qtest/cxl-test.c | 6 +++--- tests/qtest/ivshmem-test.c | 4 ++-- tests/qtest/libqos/virtio-9p.c | 4 ++-- tests/qtest/libqtest.c | 2 +- tests/qtest/migration-test.c | 4 ++-- tests/qtest/qmp-test.c | 4 ++-- tests/qtest/vhost-user-test.c | 4 ++-- tests/unit/test-qga.c | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/gen= eric_fuzz_configs.h index 004c701915..0775e6702b 100644 --- a/tests/qtest/fuzz/generic_fuzz_configs.h +++ b/tests/qtest/fuzz/generic_fuzz_configs.h @@ -21,7 +21,7 @@ typedef struct generic_fuzz_config { =20 static inline gchar *generic_fuzzer_virtio_9p_args(void){ char tmpdir[] =3D "/tmp/qemu-fuzz.XXXXXX"; - g_assert_nonnull(mkdtemp(tmpdir)); + g_assert_nonnull(g_mkdtemp(tmpdir)); =20 return g_strdup_printf("-machine q35 -nodefaults " "-device virtio-9p,fsdev=3Dhshare,mount_tag=3Dhshare " diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c index a7766a9e65..26a2400181 100644 --- a/tests/qtest/cdrom-test.c +++ b/tests/qtest/cdrom-test.c @@ -52,7 +52,7 @@ static int prepare_image(const char *arch, char *isoimage) perror("Error creating temporary iso image file"); return -1; } - if (!mkdtemp(srcdir)) { + if (!g_mkdtemp(srcdir)) { perror("Error creating temporary directory"); goto cleanup; } diff --git a/tests/qtest/cxl-test.c b/tests/qtest/cxl-test.c index 2133e973f4..4e6d285061 100644 --- a/tests/qtest/cxl-test.c +++ b/tests/qtest/cxl-test.c @@ -95,7 +95,7 @@ static void cxl_t3d(void) char template[] =3D "/tmp/cxl-test-XXXXXX"; const char *tmpfs; =20 - tmpfs =3D mkdtemp(template); + tmpfs =3D g_mkdtemp(template); =20 g_string_printf(cmdline, QEMU_PXB_CMD QEMU_RP QEMU_T3D, tmpfs, tmpfs); =20 @@ -109,7 +109,7 @@ static void cxl_1pxb_2rp_2t3d(void) char template[] =3D "/tmp/cxl-test-XXXXXX"; const char *tmpfs; =20 - tmpfs =3D mkdtemp(template); + tmpfs =3D g_mkdtemp(template); =20 g_string_printf(cmdline, QEMU_PXB_CMD QEMU_2RP QEMU_2T3D, tmpfs, tmpfs, tmpfs, tmpfs); @@ -124,7 +124,7 @@ static void cxl_2pxb_4rp_4t3d(void) char template[] =3D "/tmp/cxl-test-XXXXXX"; const char *tmpfs; =20 - tmpfs =3D mkdtemp(template); + tmpfs =3D g_mkdtemp(template); =20 g_string_printf(cmdline, QEMU_2PXB_CMD QEMU_4RP QEMU_4T3D, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c index e23a97fa8e..9611d05eb5 100644 --- a/tests/qtest/ivshmem-test.c +++ b/tests/qtest/ivshmem-test.c @@ -481,8 +481,8 @@ int main(int argc, char **argv) tmpshmem =3D mmap(0, TMPSHMSIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd,= 0); g_assert(tmpshmem !=3D MAP_FAILED); /* server */ - if (mkdtemp(dir) =3D=3D NULL) { - g_error("mkdtemp: %s", g_strerror(errno)); + if (g_mkdtemp(dir) =3D=3D NULL) { + g_error("g_mkdtemp: %s", g_strerror(errno)); } tmpdir =3D dir; tmpserver =3D g_strconcat(tmpdir, "/server", NULL); diff --git a/tests/qtest/libqos/virtio-9p.c b/tests/qtest/libqos/virtio-9p.c index 70aea8bf62..ae9b0a20e2 100644 --- a/tests/qtest/libqos/virtio-9p.c +++ b/tests/qtest/libqos/virtio-9p.c @@ -48,9 +48,9 @@ void virtio_9p_create_local_test_dir(void) */ char *template =3D concat_path(pwd, "qtest-9p-local-XXXXXX"); =20 - local_test_path =3D mkdtemp(template); + local_test_path =3D g_mkdtemp(template); if (!local_test_path) { - g_test_message("mkdtemp('%s') failed: %s", template, strerror(errn= o)); + g_test_message("g_mkdtemp('%s') failed: %s", template, strerror(er= rno)); } =20 g_assert(local_test_path !=3D NULL); diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index ad6860d774..7c9fc07de4 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -393,7 +393,7 @@ QTestState *qtest_init_with_serial(const char *extra_ar= gs, int *sock_fd) char *sock_path, sock_dir[] =3D "/tmp/qtest-serial-XXXXXX"; QTestState *qts; =20 - g_assert_true(mkdtemp(sock_dir) !=3D NULL); + g_assert_true(g_mkdtemp(sock_dir) !=3D NULL); sock_path =3D g_strdup_printf("%s/sock", sock_dir); =20 sock_fd_init =3D init_socket(sock_path); diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 520a5f917c..52988b86eb 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2450,9 +2450,9 @@ int main(int argc, char **argv) return g_test_run(); } =20 - tmpfs =3D mkdtemp(template); + tmpfs =3D g_mkdtemp(template); if (!tmpfs) { - g_test_message("mkdtemp on path (%s): %s", template, strerror(errn= o)); + g_test_message("g_mkdtemp on path (%s): %s", template, strerror(er= rno)); } g_assert(tmpfs); =20 diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c index 9a42480cef..bf7304c7dc 100644 --- a/tests/qtest/qmp-test.c +++ b/tests/qtest/qmp-test.c @@ -166,8 +166,8 @@ char *fifo_name; =20 static void setup_blocking_cmd(void) { - if (!mkdtemp(tmpdir)) { - g_error("mkdtemp: %s", strerror(errno)); + if (!g_mkdtemp(tmpdir)) { + g_error("g_mkdtemp: %s", strerror(errno)); } fifo_name =3D g_strdup_printf("%s/fifo", tmpdir); if (mkfifo(fifo_name, 0666)) { diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index 8bf390be20..d7d6cfc9bd 100644 --- a/tests/qtest/vhost-user-test.c +++ b/tests/qtest/vhost-user-test.c @@ -491,9 +491,9 @@ static TestServer *test_server_new(const gchar *name, /* run the main loop thread so the chardev may operate */ server->thread =3D g_thread_new(NULL, thread_function, server->loop); =20 - tmpfs =3D mkdtemp(template); + tmpfs =3D g_mkdtemp(template); if (!tmpfs) { - g_test_message("mkdtemp on path (%s): %s", template, strerror(errn= o)); + g_test_message("g_mkdtemp on path (%s): %s", template, strerror(er= rno)); } g_assert(tmpfs); =20 diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index b27c77a695..a05a4628ed 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -60,7 +60,7 @@ fixture_setup(TestFixture *fixture, gconstpointer data, g= char **envp) fixture->loop =3D g_main_loop_new(NULL, FALSE); =20 fixture->test_dir =3D g_strdup("/tmp/qgatest.XXXXXX"); - g_assert_nonnull(mkdtemp(fixture->test_dir)); + g_assert_nonnull(g_mkdtemp(fixture->test_dir)); =20 path =3D g_build_filename(fixture->test_dir, "sock", NULL); cwd =3D g_get_current_dir(); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661334323; cv=none; d=zohomail.com; s=zohoarc; b=SNg3uhdZRTUhgZiqL+GOYKsHfS/gQaxFlDE/mzDHON6XUx4B7ansvEDLsPWVkd/zAOJLOPCHP9sQRycrYgM9JdYUJVuHb0uQlL3fY+aGy+vx4VJOQTGrjQLhNYKcMfKSpWZQvQjq0ZcZb4ExigKzqNuxgHbmdNCVBEdG5EXbQak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661334323; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oO0SYzbawNGrDg6auw+O7c5purm7PS7f7P59XKUxYbE=; b=gi4osE0kK+nvkQJBDIEg+n9GXcmFE9rv7DGeIC/6Hcalk4mJkUkfpuM5URN4i/Wacg8cCxWQcbiH9g7NIIi05KNjFAxxwbxjP6VxVKaFs0tQPH4TDAk2Hh8KTakXcHZFwgTp/ZauMHTj/kzMlFZ/pOij2dZtBRdAJOfhGwFtD5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661334323861276.2035691452637; Wed, 24 Aug 2022 02:45:23 -0700 (PDT) Received: from localhost ([::1]:59820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQmws-0005Uq-8g for importer@patchew.org; Wed, 24 Aug 2022 05:45:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmsv-00027F-FB; Wed, 24 Aug 2022 05:41:17 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:33629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmst-0001KP-Vk; Wed, 24 Aug 2022 05:41:17 -0400 Received: by mail-pl1-x635.google.com with SMTP id 2so15218274pll.0; Wed, 24 Aug 2022 02:41:15 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=oO0SYzbawNGrDg6auw+O7c5purm7PS7f7P59XKUxYbE=; b=bHffE/UwOb1YAe22yBuG5fn/8y6I7CgETiarUmwh0cOsZ4toU1fBE240zfzNmvuEkD AtwCBy016YB072o6x/1itEcsJ5I9Acq97/h9DabW+wKtYunIWYOB6HbqbGD3PvBcAjRK LjCHTZLLzVptMLV3gkWIfMwRWBZif/c5rdLwZUHu5OAQzFKqfBXEkh/TJCpihpNgXumt xugWUmQVUeQLyE9gkr5qK43uzs0PYUbzyIEIRTeakubsceLeGFOlojLTJL3EGzg3ydOr 6deW8S5esFxDpdbfNWYnm1m7GOFpkQDrJivCWFlObMHRXkz1CRl3XQqR0uHEADgpiRaY 7S5Q== 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; bh=oO0SYzbawNGrDg6auw+O7c5purm7PS7f7P59XKUxYbE=; b=z4W5Fu/goIrBhvmx6KtNtYqW3pS/C8SPFZQvWTr9UF9na1egtjpjp6aKl3J4x2Y3dj /3Q7OQWvXSUWUqyOWeCyDnQ3ApNiJvYNKBjs52NTjcZpcDxbqfnJ3OzJnt08J9WsULlr mWcmQmglNpWG9sNPajtWeBsUMfb79DA2xgES8f3of6tUN12OCtwG1YNwVwfUE6eLCd/9 nZxXswThuSHQT95FPjwlQ4sNj8/jH9Qj13XdetGiDcQAPfIjO7BJvCFhqIroLKWi/NnH uPvXQruMNi8T9WYLsCcpBZK2pz0hWkD8P/6kFO6qVgrgqG3lGE8ZS6iUALtME7U2AKVE sY/Q== X-Gm-Message-State: ACgBeo0lQJJQgcxjP4wnjW7Cf3yeDRGMEUSlDHfuls3lgkXiywMd5Bob cCZxJTKSQu/U34FW/GwAGjRYwD5R4DA= X-Google-Smtp-Source: AA6agR6WF5MDSNfIXFV63CN8Viuk6Y1f0mlwIKX0E4X/WN200TS/sctBRDiJLarwM/v19YIWslMj9A== X-Received: by 2002:a17:903:2483:b0:16c:dfcf:38e8 with SMTP id p3-20020a170903248300b0016cdfcf38e8mr28430232plw.43.1661334074159; Wed, 24 Aug 2022 02:41:14 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Hanna Reitz , Kevin Wolf , qemu-block@nongnu.org Subject: [PATCH 03/51] block: Unify the get_tmp_filename() implementation Date: Wed, 24 Aug 2022 17:39:41 +0800 Message-Id: <20220824094029.1634519-4-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x635.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661334324611100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng At present get_tmp_filename() has platform specific implementations to get the directory to use for temporary files. Switch over to use g_get_tmp_dir() which works on all supported platforms. Signed-off-by: Bin Meng --- block.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/block.c b/block.c index bc85f46eed..d06df47f72 100644 --- a/block.c +++ b/block.c @@ -864,21 +864,10 @@ int bdrv_probe_geometry(BlockDriverState *bs, HDGeome= try *geo) */ int get_tmp_filename(char *filename, int size) { -#ifdef _WIN32 - char temp_dir[MAX_PATH]; - /* GetTempFileName requires that its output buffer (4th param) - have length MAX_PATH or greater. */ - assert(size >=3D MAX_PATH); - return (GetTempPath(MAX_PATH, temp_dir) - && GetTempFileName(temp_dir, "qem", 0, filename) - ? 0 : -GetLastError()); -#else int fd; const char *tmpdir; - tmpdir =3D getenv("TMPDIR"); - if (!tmpdir) { - tmpdir =3D "/var/tmp"; - } + tmpdir =3D g_get_tmp_dir(); + if (snprintf(filename, size, "%s/vl.XXXXXX", tmpdir) >=3D size) { return -EOVERFLOW; } @@ -891,7 +880,6 @@ int get_tmp_filename(char *filename, int size) return -errno; } return 0; -#endif } =20 /* --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661335089; cv=none; d=zohomail.com; s=zohoarc; b=GSej/7iaro/7NpX9LCH8sMIkgEyiWBBdxTGczWeW7HizIpVxfnxZbyCUWRBmw9WRMV/7xWyhLpGiY/bFUiGifS0u0YoSzhHuze91qNyUny8O1Z7bhCDKRF453gaORPaIZSNZ97wqWgagUZwn8EbWMa6/plhEs8io4CLB0rmep7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661335089; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EZVtm0SvUeW5TzKWeVkn+QL0GZmVIRTePkK09k2LuDo=; b=XxdX7P4Bh0CXURpX6TDxBu7copzHPF+ZfVM59Ga5E958KrinTJy7HVYR0iu+s2LepMdjgtt1f8C7wB3PD3v8Jr1k+lxZi1EolC7YxHpjDtjtfAOswYDPsmdJ9CmuPfOM2QQpIC1LnFNg50CPU2+o4YqWJ2nLZxg8AnfFNOi8GxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661335089728685.6439859725768; Wed, 24 Aug 2022 02:58:09 -0700 (PDT) Received: from localhost ([::1]:37992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQn9D-00087r-Qm for importer@patchew.org; Wed, 24 Aug 2022 05:58:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmsz-0002H4-Hk for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:41:21 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:46880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmsy-0001L5-2K for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:41:21 -0400 Received: by mail-pl1-x636.google.com with SMTP id jm11so15166184plb.13 for ; Wed, 24 Aug 2022 02:41:18 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=EZVtm0SvUeW5TzKWeVkn+QL0GZmVIRTePkK09k2LuDo=; b=I7tZixZ9DlnNl6LPagcrRUkB0muB8Kr4lbWvRANjZKoLQaUI1TBZw5E/nr3yliNlrL qmjELqZpnRUK4OHhhq/zjS023cbRlnGmmpeHjNPt9uakCLHhtME7EV9Z3feYZLkepYEH TQq+5KMp6vbLFv+o9WUmd5cZgcwzP9mYr+6TklYIKzuajTEVxrBk5EeCEmhUDQpN9rrj ufn+TJw3KfDB7UGUXCkSjGS50ExUF524oMcmW1fRHXcT5J8fyNg73rvOm0IZFFrEZPpz KOXUYVm+XqJqs99q1w8KYnJKq1QCGhiQwPyLNPJoLcw+be0b0bG5GbID2VMzb00EwJ+n K3cg== 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; bh=EZVtm0SvUeW5TzKWeVkn+QL0GZmVIRTePkK09k2LuDo=; b=H9qX+VZP+MYyqYKCARzBJj+TkNruC55wvTcqDnQLk8ndEzzcY8MmFLM9qlQ7B+lsmq g/y5zolQRIodRcPAiYUlGHTexDqdZIYQcuXQkvMUCTJuz0bWk7ES1ms8FESGyDsNvZGo OzYt0zQ7M17bUsY0oTBUQEn0SuAm0tlzy4E94xzdqQZNsArz01dKmqf1Fs38ORPRvs1Q eptB4aK/wOgZ3pTp2Qf64O6YtZh3olML4/wxc7ghgcyp/vvlQuaSQXwCN6Ei3wylETnz y/pRr1bHhajmW35eyQPRETYcXBUJYow1E2uCqkYOwlHg3WMYlaYguxJOchJwHabXvMqQ 4/+A== X-Gm-Message-State: ACgBeo2AZUs9T2AoB7D/Y4zi0kRiu27RLv4DYqeKONMbYXcZ8XLGWUVC ujPnJ0qj3cgXdGaYxurSbgKPH0mVDEY= X-Google-Smtp-Source: AA6agR5KyV54s6DsPFRoE58SNQ2NsWhlTYaIlHqJcYpxnDphITa6Sf6W+FId74ZmhmuvOta4x+8zsA== X-Received: by 2002:a17:902:9886:b0:172:bb36:70f1 with SMTP id s6-20020a170902988600b00172bb3670f1mr26829368plp.139.1661334077298; Wed, 24 Aug 2022 02:41:17 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 04/51] semihosting/arm-compat-semi: Avoid using hardcoded /tmp Date: Wed, 24 Aug 2022 17:39:42 +0800 Message-Id: <20220824094029.1634519-5-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x636.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661335090826100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Use g_get_tmp_dir() to get the directory to use for temporary files. Signed-off-by: Bin Meng --- semihosting/arm-compat-semi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index e741674238..d5e66cc298 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -503,7 +503,8 @@ void do_common_semihosting(CPUState *cs) GET_ARG(0); GET_ARG(1); GET_ARG(2); - len =3D asprintf(&s, "/tmp/qemu-%x%02x", getpid(), (int)arg1 & 0xf= f); + len =3D asprintf(&s, "%s/qemu-%x%02x", g_get_tmp_dir(), + getpid(), (int)arg1 & 0xff); if (len < 0) { common_semi_set_ret(cs, -1); break; --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661335842; cv=none; d=zohomail.com; s=zohoarc; b=n/ZIk0bo7K2np1PXP6VRtp7T6arJR+ccvdKzbYUKeFrC/sQy6qry7knRmsMosa6hj+5bV6KtpM9OI47j+7CIcoyVbgcn8+1JIxTSQRLmy3bEnbPsrarmt8YX+bo1ohbrfqLY6yW+HQaWr1AjHrAOKzYXYObzI8lPgXvRQt9I46Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661335842; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eT7i3FFQc8PKKRNmStJpuuvLEJ+xIi8cvZUWYereUgg=; b=gaAak73w5OeIZg3HGl3pjbmMTCbyD4ai9ZClVSD0AgfZxVY0TgfqifKPrsSnJda6KO1wtYxKi97xZqe+sipcBCvDHtFE4OqCKlnMesFj1MXfVotahxSEealITJk+0Y2qZto+kl0jV5hrImfgjCNyZuGrGdo0nBMLYPbSc7ebwh4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661335842923298.0307642367461; Wed, 24 Aug 2022 03:10:42 -0700 (PDT) Received: from localhost ([::1]:54668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnLN-0005im-Sc for importer@patchew.org; Wed, 24 Aug 2022 06:10:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmt4-0002Qg-MB for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:41:26 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:42702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmt2-0001MR-5F for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:41:26 -0400 Received: by mail-pg1-x534.google.com with SMTP id q63so307367pga.9 for ; Wed, 24 Aug 2022 02:41:23 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=eT7i3FFQc8PKKRNmStJpuuvLEJ+xIi8cvZUWYereUgg=; b=p47+6C9tssfPWv9BETDMsqh64W3+bu2N3xF/7dhXwCtmpD2GYRRWihXipD9l65BhXY PZhP3e128o5zbFiLLamo+7fuebF9fqmT+WxNiQQ3htiCyyN2XCR3vUaivlzAo0TNzRXI HCuSHw6spa9ZVD2Npl/3Jr+yphS4IanP7pLciB+srzCJuVmIye06wnZ5f53J+AF8R4p3 4QhIV34Kj8gnNUNDejsMkrKlZWNjsJXqJ4KroJQnxJFW7ldwn3+L4illeuXCC0A98x4V kC4eH0XZAnJe6nQrbM8zOLNTWGPP66WOyecwyvgf4t910HRjhMJw6xi6RRmAZT7Z0q1z dheQ== 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; bh=eT7i3FFQc8PKKRNmStJpuuvLEJ+xIi8cvZUWYereUgg=; b=IJYlL3ZJsh3hF3xAS1dvhirYxdp/H1+jN4t+HFHMokBLkARagVw4Pr2giy7VzTbxpV 40yoY2SbfGflfJAL425xxz0r5w6+1zvEnXxxKVioF8opFW3wYu90bAkNHbsJWgttBGLS Y2uR724gM+qnPVADAHoQzR7mmj9nFTCivrDJVidTEZjvjZ95y8qJ+4ZU45vl3cqua9Ig ZJTb6Q+/5T6vW4zhZ8p4lekyMTYICOncjaokbgD9mrbF0sDXEpxogioGfeHJbDZwAP4f /ylW2VIzaAYQ7Z2NXFAKXO8AnXB9JxUVUR79AlqKo0xCdwHfL/h6+TRHQSx8MmKP2Rb8 4auQ== X-Gm-Message-State: ACgBeo1pgBxvgevaH2ePCGBUSRGlXlzvH0mXcd1Y5yOAyLU8MahZKgGP /W8KYun71Hs28DYLMwp7N1/W8InHS3s= X-Google-Smtp-Source: AA6agR5Eb6m0IlugLrXcv5q6A/iKTNFX3dL0JP8rJloM3sVwsYvaXKMgNU+xwu+YXfbZtfQ0RIN3vw== X-Received: by 2002:a05:6a00:1687:b0:518:6c6b:6a9a with SMTP id k7-20020a056a00168700b005186c6b6a9amr29351167pfc.81.1661334082646; Wed, 24 Aug 2022 02:41:22 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Richard Henderson Subject: [PATCH 05/51] tcg: Avoid using hardcoded /tmp Date: Wed, 24 Aug 2022 17:39:43 +0800 Message-Id: <20220824094029.1634519-6-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x534.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661335845034100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Use g_get_tmp_dir() to get the directory to use for temporary files. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- tcg/tcg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 0f9cfe96f2..932156a352 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -4729,13 +4729,15 @@ static void tcg_register_jit_int(const void *buf_pt= r, size_t buf_size, /* Enable this block to be able to debug the ELF image file creation. One can use readelf, objdump, or other inspection utilities. */ { - FILE *f =3D fopen("/tmp/qemu.jit", "w+b"); + char *jit =3D g_strdup_printf("%s/qemu.jit", g_get_tmp_dir()); + FILE *f =3D fopen(jit, "w+b"); if (f) { if (fwrite(img, img_size, 1, f) !=3D img_size) { /* Avoid stupid unused return value warning for fwrite. */ } fclose(f); } + g_free(jit); } #endif =20 --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661335344; cv=none; d=zohomail.com; s=zohoarc; b=eORxrBkGGPU+wRViQ6GrlDNZ6tZk4B+iEe7QIWwvLmUpHSxo251DsdOPa76hFL/kv3RlCOm1R4PnC1qfiwAklrUm/e7ap/VmBXfedrDFXrs39KihJZSlOwoLjy3jwOzog0oSxTvYcKMIfFZW4nlEQQjQDaqyO24WpawD5ni2iyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661335344; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hjdri8IS0vHiKp8ufTWi8yEKyLd7PN9XXMLuAWqNzss=; b=dUDRpKtcbKRyg6sKfs0oYSZC0RYFKVJLTeHjpUWBuZHrEYKBEnWgiGvENoNmShqRXl6mRlpiGWA9LXdo+6oyIltjZeQhfLSFmX8eOQ73pIgf3rTnyaIk8CL5/myJiqdYIznbnaznfmGp6J7mMVjPzZQ9twYJIUPjAKELt5uZv7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661335344458188.6380195122772; Wed, 24 Aug 2022 03:02:24 -0700 (PDT) Received: from localhost ([::1]:49806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnDK-0006Zx-DZ for importer@patchew.org; Wed, 24 Aug 2022 06:02:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmtB-0002bB-RP for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:41:33 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:36580) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmt6-0001NS-3e for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:41:33 -0400 Received: by mail-pf1-x42b.google.com with SMTP id w29so10406521pfj.3 for ; Wed, 24 Aug 2022 02:41:27 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.41.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=hjdri8IS0vHiKp8ufTWi8yEKyLd7PN9XXMLuAWqNzss=; b=bwqtZfXir5VLsjLv0GMiUpHqv3oAUV1nlAmY308E+vai6ebHqLhC9WuYqiQPXn0luN 5Yd4g4dh8VHVUWvH4Ccbtm50D3jL7zc4SXBNwgauLd1Jgsu2tFsprtzqctDN/UMRPhKr 3gnAgnVCeHWjSydL2D1k/++b7Q5qI7K7U/SU3KTudS3zvEPaE8z7CY/VPvAlSnYUXal3 WICTlFHQGGGLDOAjEm3P6j87R8BTETt2tXSGnVnanpcVSzUmii+/62VOeQ1qVOMIur/9 l4j/3VRnjsXAogdJuGI8gKFwF8EnE8JGpRgW1ftqk9lFw+5tMrPNUO9+70ti1+LjohMp 9zeg== 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; bh=hjdri8IS0vHiKp8ufTWi8yEKyLd7PN9XXMLuAWqNzss=; b=dWypxDzpKN8z6uQ+48QMHf9L7+SQmc2D3/EeCjuV2SmLObXYdoQzP5CFwJug6lT85K U9xj+By4fADHCM/j2AJZrk2fUuK/f6mxBEXx+HnPOU0aim2jyrin6DkEFYfM4xJbbsRV d8ctBos1Nr3ArKaoejme4VYXA4zKsIoanOlO/S0ahdxu9PY7ukSLK0Y8xNNGOwuGcC89 Zu4MyxfmOFk1qy77pUa1kRm+Hgucqazn901rUdUXn0bvjN6oLoPvLburCgaSVL43tVMN +6bz4wv4O4kiV8OFBnjU77/yNsgvM7Sr6b6sBs1R/qxeF9yg+PEcQwGL2zqA5GjSCepn Vn2w== X-Gm-Message-State: ACgBeo2J6zG/8eG0oTsbxQtf3v/1UWtyaf5Ekd7zUfswZG2RbcQQdGbt mheKoDqoQitx1+uuSS2jlQqmRSNOzdE= X-Google-Smtp-Source: AA6agR5zXJev3TG/qw7WAroQsFZJCSwOK8iGF2Obq+9gByiqkFBmxxxes+Wdp6LOTa8Ea8PP4/6alw== X-Received: by 2002:a05:6a00:1ac8:b0:536:f09a:eecc with SMTP id f8-20020a056a001ac800b00536f09aeeccmr7794376pfv.50.1661334086448; Wed, 24 Aug 2022 02:41:26 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 06/51] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files Date: Wed, 24 Aug 2022 17:39:44 +0800 Message-Id: <20220824094029.1634519-7-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=bmeng.cn@gmail.com; helo=mail-pf1-x42b.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, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661335346144100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Replace the existing logic to get the directory for temporary files with g_get_tmp_dir(), which works for win32 too. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- util/qemu-sockets.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 83f4bd6fd2..0c41ca9e42 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -919,9 +919,8 @@ static int unix_listen_saddr(UnixSocketAddress *saddr, if (saddr->path[0] || abstract) { path =3D saddr->path; } else { - const char *tmpdir =3D getenv("TMPDIR"); - tmpdir =3D tmpdir ? tmpdir : "/tmp"; - path =3D pathbuf =3D g_strdup_printf("%s/qemu-socket-XXXXXX", tmpd= ir); + path =3D pathbuf =3D g_strdup_printf("%s/qemu-socket-XXXXXX", + g_get_tmp_dir()); } =20 pathlen =3D strlen(path); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661336118; cv=none; d=zohomail.com; s=zohoarc; b=oBTpbwoWdJjBcuVbwPEzm8LhTGIYG68yxncACsUaG4ZeMWpEpM6tWgNj+zYBEAFp04qqAzv+pnjH8JUFHdia10sqKYMy7SAl/zKxxk9RVw1gMYdcfN0pX3NDyijGN9MQVTodGwdIIhHVSYNZtngQd2ePMXU7FpvFDeQ0l8Curyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661336118; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=trWpCFmc885+Hbmydl7kHMuVBjh6162eTb0KUJVdu8M=; b=J+Iy7uNJggo7qhrgeXp9Q1xEFWZ5QAxkwGUYCoPGisdtsRFBX0qllMTWSs6HL9jufEWsVhrAhSAeDAQcjT4rZBegQeedt71i3b2ssQBP1BqFtWEL4YUbYdiO3MitIuThfXeW+bJFNYx9jluMt+U5QHAsgsAM5soiWfQ0hsh5nFU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336118629752.9208139182275; Wed, 24 Aug 2022 03:15:18 -0700 (PDT) Received: from localhost ([::1]:37542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnPp-00039Y-Dj for importer@patchew.org; Wed, 24 Aug 2022 06:15:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmte-0002ul-Jg; Wed, 24 Aug 2022 05:42:04 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:53904) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmtb-0001WD-BT; Wed, 24 Aug 2022 05:42:02 -0400 Received: by mail-pj1-x1030.google.com with SMTP id m15so8460677pjj.3; Wed, 24 Aug 2022 02:41:58 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=trWpCFmc885+Hbmydl7kHMuVBjh6162eTb0KUJVdu8M=; b=e0Yaknpcgf7hBFJYxusqzUm+qOvpcJiD8u/ZjdYt5t2m77MNIt9MJmkhQo1uvXbB8b pZmwqbNZd4s2n6+rnFvgbQDSnIWQHxWyc6JkyLm+NR/+OdQiTc/sIxpDKefmsGdtynr7 uFjOuhym6YYTDOvE+mv5gzgcBQuzEPvsemoJSEa/np63O6tqElukz2SAuzytK2o3BIlf xDbbQS/iEYd84GbYqDDKBdF7V45lClKOs6KZQMJeyz+Uzl0OOv/RS+gKgVchz6BzGB0m 5x2fufRzaPX3i7e6jgTXbKy/iv+/s78dFh3ldZ1BPi3yETgeA/BklUYNrEXeNzMg2sh4 /jTA== 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; bh=trWpCFmc885+Hbmydl7kHMuVBjh6162eTb0KUJVdu8M=; b=oA4w7fmXQgrTS1p89D3qSTfQ42glCHq3yWSyS945quHTW+7VNu6qUnQxg31L1JKil5 ReN+J+d3nOJFQfzdFBWVVkMFVB0KQPubRh+DMqGOCZ02ZAqofo2CWlOAtV787QvtxIWK 13bzMHxBYutbpUK3n6KsJdJNeVsKIdQtGnFfhqkaFX7DwlT9Oeije3lXoB/Q9Sho7sa2 FtDA9MH/MestvwwPY7h8wCRYwWOKiza47lrWQtqFciGDx/ppiUOqZg0q9BhqzvsuKoA3 WDjdMWBokvtFKLXBiLQmkrYz5j0icoeJEUH5CON52hZDbsM2/BVwV+nmVneBeRKovb6b cgRw== X-Gm-Message-State: ACgBeo1A3eG8xGuW6rVRKJSn3GLmTQbN+Z/vhz/CS+84LPrtpZS6eLy4 C0e7SP1BJ6/Tubv1pOq3YbiSXCYXuxA= X-Google-Smtp-Source: AA6agR5ZfEBiPtMraGoKOQIiglSQYZKltjyt4Ctsz31RHVPE07kuVgMYzkojKpeldWJhnZy4GQeGyQ== X-Received: by 2002:a17:902:8bc7:b0:172:c32f:7d30 with SMTP id r7-20020a1709028bc700b00172c32f7d30mr22188206plo.48.1661334116753; Wed, 24 Aug 2022 02:41:56 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Alexander Bulekov , Andrew Jeffery , Bandan Das , Coiby Xu , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Darren Kenny , "Dr. David Alan Gilbert" , Fam Zheng , Joel Stanley , John Snow , Juan Quintela , Konstantin Kostiuk , Laurent Vivier , Markus Armbruster , Michael Roth , Paolo Bonzini , Peter Maydell , Qiuhao Li , Stefan Hajnoczi , Thomas Huth , qemu-arm@nongnu.org, qemu-block@nongnu.org Subject: [PATCH 07/51] tests: Avoid using hardcoded /tmp in test cases Date: Wed, 24 Aug 2022 17:39:45 +0800 Message-Id: <20220824094029.1634519-8-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x1030.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661336119726100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Use g_get_tmp_dir() to get the directory to use for temporary files. Signed-off-by: Bin Meng --- tests/qtest/fuzz/generic_fuzz_configs.h | 6 ++++-- tests/qtest/ahci-test.c | 15 +++++++++++---- tests/qtest/aspeed_smc-test.c | 4 +++- tests/qtest/boot-serial-test.c | 8 ++++++-- tests/qtest/cxl-test.c | 9 ++++++--- tests/qtest/fdc-test.c | 4 +++- tests/qtest/fuzz/virtio_blk_fuzz.c | 2 +- tests/qtest/hd-geo-test.c | 8 ++++---- tests/qtest/ide-test.c | 8 ++++++-- tests/qtest/libqtest.c | 10 +++++++--- tests/qtest/migration-test.c | 4 +++- tests/qtest/pflash-cfi02-test.c | 7 +++++-- tests/qtest/qmp-test.c | 4 +++- tests/qtest/vhost-user-blk-test.c | 3 ++- tests/qtest/vhost-user-test.c | 3 ++- tests/qtest/virtio-blk-test.c | 2 +- tests/qtest/virtio-scsi-test.c | 3 ++- tests/unit/test-image-locking.c | 6 ++++-- tests/unit/test-qga.c | 2 +- tests/vhost-user-bridge.c | 3 ++- 20 files changed, 76 insertions(+), 35 deletions(-) diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/gen= eric_fuzz_configs.h index 0775e6702b..d0f9961187 100644 --- a/tests/qtest/fuzz/generic_fuzz_configs.h +++ b/tests/qtest/fuzz/generic_fuzz_configs.h @@ -20,13 +20,15 @@ typedef struct generic_fuzz_config { } generic_fuzz_config; =20 static inline gchar *generic_fuzzer_virtio_9p_args(void){ - char tmpdir[] =3D "/tmp/qemu-fuzz.XXXXXX"; + char *tmpdir =3D g_strdup_printf("%s/qemu-fuzz.XXXXXX", g_get_tmp_dir(= )); g_assert_nonnull(g_mkdtemp(tmpdir)); =20 - return g_strdup_printf("-machine q35 -nodefaults " + gchar *args =3D g_strdup_printf("-machine q35 -nodefaults " "-device virtio-9p,fsdev=3Dhshare,mount_tag=3Dhshare " "-fsdev local,id=3Dhshare,path=3D%s,security_model=3Dmapped-xattr," "writeout=3Dimmediate,fmode=3D0600,dmode=3D0700", tmpdir); + g_free(tmpdir); + return args; } =20 const generic_fuzz_config predefined_configs[] =3D { diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index f1e510b0ac..f26cd6f86f 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -44,9 +44,9 @@ #define TEST_IMAGE_SIZE_MB_SMALL 64 =20 /*** Globals ***/ -static char tmp_path[] =3D "/tmp/qtest.XXXXXX"; -static char debug_path[] =3D "/tmp/qtest-blkdebug.XXXXXX"; -static char mig_socket[] =3D "/tmp/qtest-migration.XXXXXX"; +static char *tmp_path; +static char *debug_path; +static char *mig_socket; static bool ahci_pedantic; static const char *imgfmt; static unsigned test_image_size_mb; @@ -1437,7 +1437,7 @@ static void test_ncq_simple(void) =20 static int prepare_iso(size_t size, unsigned char **buf, char **name) { - char cdrom_path[] =3D "/tmp/qtest.iso.XXXXXX"; + char *cdrom_path =3D g_strdup_printf("%s/qtest.iso.XXXXXX", g_get_tmp_= dir()); unsigned char *patt; ssize_t ret; int fd =3D mkstemp(cdrom_path); @@ -1454,6 +1454,7 @@ static int prepare_iso(size_t size, unsigned char **b= uf, char **name) =20 *name =3D g_strdup(cdrom_path); *buf =3D patt; + g_free(cdrom_path); return fd; } =20 @@ -1872,6 +1873,7 @@ int main(int argc, char **argv) } =20 /* Create a temporary image */ + tmp_path =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); fd =3D mkstemp(tmp_path); g_assert(fd >=3D 0); if (have_qemu_img()) { @@ -1889,11 +1891,13 @@ int main(int argc, char **argv) close(fd); =20 /* Create temporary blkdebug instructions */ + debug_path =3D g_strdup_printf("%s/qtest-blkdebug.XXXXXX", g_get_tmp_d= ir()); fd =3D mkstemp(debug_path); g_assert(fd >=3D 0); close(fd); =20 /* Reserve a hollow file to use as a socket for migration tests */ + mig_socket =3D g_strdup_printf("%s/qtest-migration.XXXXXX", g_get_tmp_= dir()); fd =3D mkstemp(mig_socket); g_assert(fd >=3D 0); close(fd); @@ -1947,8 +1951,11 @@ int main(int argc, char **argv) =20 /* Cleanup */ unlink(tmp_path); + g_free(tmp_path); unlink(debug_path); + g_free(debug_path); unlink(mig_socket); + g_free(mig_socket); =20 return ret; } diff --git a/tests/qtest/aspeed_smc-test.c b/tests/qtest/aspeed_smc-test.c index 05ce941566..cab769459c 100644 --- a/tests/qtest/aspeed_smc-test.c +++ b/tests/qtest/aspeed_smc-test.c @@ -608,7 +608,7 @@ static void test_write_block_protect_bottom_bit(void) flash_reset(); } =20 -static char tmp_path[] =3D "/tmp/qtest.m25p80.XXXXXX"; +static char *tmp_path; =20 int main(int argc, char **argv) { @@ -617,6 +617,7 @@ int main(int argc, char **argv) =20 g_test_init(&argc, &argv, NULL); =20 + tmp_path =3D g_strdup_printf("%s/qtest.m25p80.XXXXXX", g_get_tmp_dir()= ); fd =3D mkstemp(tmp_path); g_assert(fd >=3D 0); ret =3D ftruncate(fd, FLASH_SIZE); @@ -646,5 +647,6 @@ int main(int argc, char **argv) =20 qtest_quit(global_qtest); unlink(tmp_path); + g_free(tmp_path); return ret; } diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index 2f99d71cab..404adcfa20 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -224,8 +224,10 @@ static bool check_guest_output(QTestState *qts, const = testdef_t *test, int fd) static void test_machine(const void *data) { const testdef_t *test =3D data; - char serialtmp[] =3D "/tmp/qtest-boot-serial-sXXXXXX"; - char codetmp[] =3D "/tmp/qtest-boot-serial-cXXXXXX"; + char *serialtmp =3D g_strdup_printf("%s/qtest-boot-serial-sXXXXXX", + g_get_tmp_dir()); + char *codetmp =3D g_strdup_printf("%s/qtest-boot-serial-cXXXXXX", + g_get_tmp_dir()); const char *codeparam =3D ""; const uint8_t *code =3D NULL; QTestState *qts; @@ -264,6 +266,7 @@ static void test_machine(const void *data) serialtmp, test->extra); if (code) { unlink(codetmp); + g_free(codetmp); } =20 if (!check_guest_output(qts, test, ser_fd)) { @@ -271,6 +274,7 @@ static void test_machine(const void *data) serialtmp); } unlink(serialtmp); + g_free(serialtmp); =20 qtest_quit(qts); =20 diff --git a/tests/qtest/cxl-test.c b/tests/qtest/cxl-test.c index 4e6d285061..b3733cdb5f 100644 --- a/tests/qtest/cxl-test.c +++ b/tests/qtest/cxl-test.c @@ -92,12 +92,13 @@ static void cxl_2root_port(void) static void cxl_t3d(void) { g_autoptr(GString) cmdline =3D g_string_new(NULL); - char template[] =3D "/tmp/cxl-test-XXXXXX"; + char *template =3D g_strdup_printf("%s/cxl-test-XXXXXX", g_get_tmp_dir= ()); const char *tmpfs; =20 tmpfs =3D g_mkdtemp(template); =20 g_string_printf(cmdline, QEMU_PXB_CMD QEMU_RP QEMU_T3D, tmpfs, tmpfs); + g_free(template); =20 qtest_start(cmdline->str); qtest_end(); @@ -106,13 +107,14 @@ static void cxl_t3d(void) static void cxl_1pxb_2rp_2t3d(void) { g_autoptr(GString) cmdline =3D g_string_new(NULL); - char template[] =3D "/tmp/cxl-test-XXXXXX"; + char *template =3D g_strdup_printf("%s/cxl-test-XXXXXX", g_get_tmp_dir= ()); const char *tmpfs; =20 tmpfs =3D g_mkdtemp(template); =20 g_string_printf(cmdline, QEMU_PXB_CMD QEMU_2RP QEMU_2T3D, tmpfs, tmpfs, tmpfs, tmpfs); + g_free(template); =20 qtest_start(cmdline->str); qtest_end(); @@ -121,7 +123,7 @@ static void cxl_1pxb_2rp_2t3d(void) static void cxl_2pxb_4rp_4t3d(void) { g_autoptr(GString) cmdline =3D g_string_new(NULL); - char template[] =3D "/tmp/cxl-test-XXXXXX"; + char *template =3D g_strdup_printf("%s/cxl-test-XXXXXX", g_get_tmp_dir= ()); const char *tmpfs; =20 tmpfs =3D g_mkdtemp(template); @@ -129,6 +131,7 @@ static void cxl_2pxb_4rp_4t3d(void) g_string_printf(cmdline, QEMU_2PXB_CMD QEMU_4RP QEMU_4T3D, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs); + g_free(template); =20 qtest_start(cmdline->str); qtest_end(); diff --git a/tests/qtest/fdc-test.c b/tests/qtest/fdc-test.c index 52ade90a7d..8651100b05 100644 --- a/tests/qtest/fdc-test.c +++ b/tests/qtest/fdc-test.c @@ -68,7 +68,7 @@ enum { DSKCHG =3D 0x80, }; =20 -static char test_image[] =3D "/tmp/qtest.XXXXXX"; +static char *test_image; =20 #define assert_bit_set(data, mask) g_assert_cmphex((data) & (mask), =3D=3D= , (mask)) #define assert_bit_clear(data, mask) g_assert_cmphex((data) & (mask), =3D= =3D, 0) @@ -608,6 +608,7 @@ int main(int argc, char **argv) int ret; =20 /* Create a temporary raw image */ + test_image =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); fd =3D mkstemp(test_image); g_assert(fd >=3D 0); ret =3D ftruncate(fd, TEST_IMAGE_SIZE); @@ -640,6 +641,7 @@ int main(int argc, char **argv) /* Cleanup */ qtest_end(); unlink(test_image); + g_free(test_image); =20 return ret; } diff --git a/tests/qtest/fuzz/virtio_blk_fuzz.c b/tests/qtest/fuzz/virtio_b= lk_fuzz.c index 236d078cc8..3e9541a38a 100644 --- a/tests/qtest/fuzz/virtio_blk_fuzz.c +++ b/tests/qtest/fuzz/virtio_blk_fuzz.c @@ -181,7 +181,7 @@ static void drive_destroy(void *path) static char *drive_create(void) { int fd, ret; - char *t_path =3D g_strdup("/tmp/qtest.XXXXXX"); + char *t_path =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); =20 /* Create a temporary raw image */ fd =3D mkstemp(t_path); diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index 413cf964c0..dc5d8422ea 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -27,7 +27,7 @@ =20 static char *create_test_img(int secs) { - char *template =3D strdup("/tmp/qtest.XXXXXX"); + char *template =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); int fd, ret; =20 fd =3D mkstemp(template); @@ -36,7 +36,7 @@ static char *create_test_img(int secs) close(fd); =20 if (ret) { - free(template); + g_free(template); template =3D NULL; } =20 @@ -422,7 +422,7 @@ static MBRpartitions empty_mbr =3D { {false, 0, 0, 0, 0= , 0, 0, 0, 0}, =20 static char *create_qcow2_with_mbr(MBRpartitions mbr, uint64_t sectors) { - const char *template =3D "/tmp/qtest.XXXXXX"; + const char *template =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_= dir()); char *raw_path =3D strdup(template); char *qcow2_path =3D strdup(template); char cmd[100 + 2 * PATH_MAX]; @@ -987,7 +987,7 @@ test_add_done: for (i =3D 0; i < backend_last; i++) { if (img_file_name[i]) { unlink(img_file_name[i]); - free(img_file_name[i]); + g_free(img_file_name[i]); } } =20 diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index 5bcb75a7e5..ebbf8e0126 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -121,8 +121,8 @@ enum { static QPCIBus *pcibus =3D NULL; static QGuestAllocator guest_malloc; =20 -static char tmp_path[] =3D "/tmp/qtest.XXXXXX"; -static char debug_path[] =3D "/tmp/qtest-blkdebug.XXXXXX"; +static char *tmp_path; +static char *debug_path; =20 static QTestState *ide_test_start(const char *cmdline_fmt, ...) { @@ -1015,11 +1015,13 @@ int main(int argc, char **argv) int ret; =20 /* Create temporary blkdebug instructions */ + debug_path =3D g_strdup_printf("%s/qtest-blkdebug.XXXXXX", g_get_tmp_d= ir()); fd =3D mkstemp(debug_path); g_assert(fd >=3D 0); close(fd); =20 /* Create a temporary raw image */ + tmp_path =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); fd =3D mkstemp(tmp_path); g_assert(fd >=3D 0); ret =3D ftruncate(fd, TEST_IMAGE_SIZE); @@ -1049,7 +1051,9 @@ int main(int argc, char **argv) =20 /* Cleanup */ unlink(tmp_path); + g_free(tmp_path); unlink(debug_path); + g_free(debug_path); =20 return ret; } diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 7c9fc07de4..34744ace7c 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -265,8 +265,10 @@ QTestState *qtest_init_without_qmp_handshake(const cha= r *extra_args) =20 s =3D g_new(QTestState, 1); =20 - socket_path =3D g_strdup_printf("/tmp/qtest-%d.sock", getpid()); - qmp_socket_path =3D g_strdup_printf("/tmp/qtest-%d.qmp", getpid()); + socket_path =3D g_strdup_printf("%s/qtest-%d.sock", + g_get_tmp_dir(), getpid()); + qmp_socket_path =3D g_strdup_printf("%s/qtest-%d.qmp", + g_get_tmp_dir(), getpid()); =20 /* It's possible that if an earlier test run crashed it might * have left a stale unix socket lying around. Delete any @@ -390,9 +392,10 @@ QTestState *qtest_initf(const char *fmt, ...) QTestState *qtest_init_with_serial(const char *extra_args, int *sock_fd) { int sock_fd_init; - char *sock_path, sock_dir[] =3D "/tmp/qtest-serial-XXXXXX"; + char *sock_path, *sock_dir; QTestState *qts; =20 + sock_dir =3D g_strdup_printf("%s/qtest-serial-XXXXXX", g_get_tmp_dir()= ); g_assert_true(g_mkdtemp(sock_dir) !=3D NULL); sock_path =3D g_strdup_printf("%s/sock", sock_dir); =20 @@ -406,6 +409,7 @@ QTestState *qtest_init_with_serial(const char *extra_ar= gs, int *sock_fd) unlink(sock_path); g_free(sock_path); rmdir(sock_dir); + g_free(sock_dir); =20 g_assert_true(*sock_fd >=3D 0); =20 diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 52988b86eb..5fa4ffeff0 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2422,7 +2422,8 @@ static bool kvm_dirty_ring_supported(void) =20 int main(int argc, char **argv) { - char template[] =3D "/tmp/migration-test-XXXXXX"; + char *template =3D g_strdup_printf("%s/migration-test-XXXXXX", + g_get_tmp_dir()); const bool has_kvm =3D qtest_has_accel("kvm"); const bool has_uffd =3D ufd_version_check(); const char *arch =3D qtest_get_arch(); @@ -2576,6 +2577,7 @@ int main(int argc, char **argv) g_test_message("unable to rmdir: path (%s): %s", tmpfs, strerror(errno)); } + g_free(template); =20 return ret; } diff --git a/tests/qtest/pflash-cfi02-test.c b/tests/qtest/pflash-cfi02-tes= t.c index 7fce614b64..6de83717dd 100644 --- a/tests/qtest/pflash-cfi02-test.c +++ b/tests/qtest/pflash-cfi02-test.c @@ -56,7 +56,7 @@ typedef struct { QTestState *qtest; } FlashConfig; =20 -static char image_path[] =3D "/tmp/qtest.XXXXXX"; +static char *image_path; =20 /* * The pflash implementation allows some parameters to be unspecified. We = want @@ -608,6 +608,7 @@ static void test_cfi_in_autoselect(const void *opaque) static void cleanup(void *opaque) { unlink(image_path); + g_free(image_path); } =20 /* @@ -635,16 +636,18 @@ static const FlashConfig configuration[] =3D { =20 int main(int argc, char **argv) { + image_path =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); int fd =3D mkstemp(image_path); if (fd =3D=3D -1) { g_printerr("Failed to create temporary file %s: %s\n", image_path, strerror(errno)); + g_free(image_path); exit(EXIT_FAILURE); } if (ftruncate(fd, UNIFORM_FLASH_SIZE) < 0) { int error_code =3D errno; close(fd); - unlink(image_path); + cleanup(NULL); g_printerr("Failed to truncate file %s to %u MB: %s\n", image_path, UNIFORM_FLASH_SIZE, strerror(error_code)); exit(EXIT_FAILURE); diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c index bf7304c7dc..b950dbafaf 100644 --- a/tests/qtest/qmp-test.c +++ b/tests/qtest/qmp-test.c @@ -161,11 +161,12 @@ static void test_qmp_protocol(void) =20 /* Out-of-band tests */ =20 -char tmpdir[] =3D "/tmp/qmp-test-XXXXXX"; +char *tmpdir; char *fifo_name; =20 static void setup_blocking_cmd(void) { + tmpdir =3D g_strdup_printf("%s/qmp-test-XXXXXX", g_get_tmp_dir()); if (!g_mkdtemp(tmpdir)) { g_error("g_mkdtemp: %s", strerror(errno)); } @@ -179,6 +180,7 @@ static void cleanup_blocking_cmd(void) { unlink(fifo_name); rmdir(tmpdir); + g_free(tmpdir); } =20 static void send_cmd_that_blocks(QTestState *s, const char *id) diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk= -test.c index a81c2a2715..07a4c2d500 100644 --- a/tests/qtest/vhost-user-blk-test.c +++ b/tests/qtest/vhost-user-blk-test.c @@ -841,7 +841,8 @@ static char *create_listen_socket(int *fd) char *path; =20 /* No race because our pid makes the path unique */ - path =3D g_strdup_printf("/tmp/qtest-%d-sock.XXXXXX", getpid()); + path =3D g_strdup_printf("%s/qtest-%d-sock.XXXXXX", + g_get_tmp_dir(), getpid()); tmp_fd =3D mkstemp(path); g_assert_cmpint(tmp_fd, >=3D, 0); close(tmp_fd); diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index d7d6cfc9bd..a41168de25 100644 --- a/tests/qtest/vhost-user-test.c +++ b/tests/qtest/vhost-user-test.c @@ -482,7 +482,7 @@ static TestServer *test_server_new(const gchar *name, struct vhost_user_ops *ops) { TestServer *server =3D g_new0(TestServer, 1); - char template[] =3D "/tmp/vhost-test-XXXXXX"; + char *template =3D g_strdup_printf("%s/vhost-test-XXXXXX", g_get_tmp_d= ir()); const char *tmpfs; =20 server->context =3D g_main_context_new(); @@ -501,6 +501,7 @@ static TestServer *test_server_new(const gchar *name, server->socket_path =3D g_strdup_printf("%s/%s.sock", tmpfs, name); server->mig_path =3D g_strdup_printf("%s/%s.mig", tmpfs, name); server->chr_name =3D g_strdup_printf("chr-%s", name); + g_free(template); =20 g_mutex_init(&server->data_mutex); g_cond_init(&server->data_cond); diff --git a/tests/qtest/virtio-blk-test.c b/tests/qtest/virtio-blk-test.c index dc5eed31c8..8920ce7c46 100644 --- a/tests/qtest/virtio-blk-test.c +++ b/tests/qtest/virtio-blk-test.c @@ -49,7 +49,7 @@ static void drive_destroy(void *path) static char *drive_create(void) { int fd, ret; - char *t_path =3D g_strdup("/tmp/qtest.XXXXXX"); + char *t_path =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); =20 /* Create a temporary raw image */ fd =3D mkstemp(t_path); diff --git a/tests/qtest/virtio-scsi-test.c b/tests/qtest/virtio-scsi-test.c index 8ceb12aacd..33ab6ec685 100644 --- a/tests/qtest/virtio-scsi-test.c +++ b/tests/qtest/virtio-scsi-test.c @@ -268,7 +268,7 @@ static void test_iothread_attach_node(void *obj, void *= data, QVirtioSCSIPCI *scsi_pci =3D obj; QVirtioSCSI *scsi =3D &scsi_pci->scsi; QVirtioSCSIQueues *vs; - char tmp_path[] =3D "/tmp/qtest.XXXXXX"; + char *tmp_path =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); int fd; int ret; =20 @@ -309,6 +309,7 @@ static void test_iothread_attach_node(void *obj, void *= data, fail: qvirtio_scsi_pci_free(vs); unlink(tmp_path); + g_free(tmp_path); } =20 static void *virtio_scsi_hotplug_setup(GString *cmd_line, void *arg) diff --git a/tests/unit/test-image-locking.c b/tests/unit/test-image-lockin= g.c index ba057bd66c..795c602ff6 100644 --- a/tests/unit/test-image-locking.c +++ b/tests/unit/test-image-locking.c @@ -76,7 +76,7 @@ static void check_locked_bytes(int fd, uint64_t perm_lock= s, static void test_image_locking_basic(void) { BlockBackend *blk1, *blk2, *blk3; - char img_path[] =3D "/tmp/qtest.XXXXXX"; + char *img_path =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); uint64_t perm, shared_perm; =20 int fd =3D mkstemp(img_path); @@ -112,12 +112,13 @@ static void test_image_locking_basic(void) blk_unref(blk3); close(fd); unlink(img_path); + g_free(img_path); } =20 static void test_set_perm_abort(void) { BlockBackend *blk1, *blk2; - char img_path[] =3D "/tmp/qtest.XXXXXX"; + char *img_path =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); uint64_t perm, shared_perm; int r; int fd =3D mkstemp(img_path); @@ -140,6 +141,7 @@ static void test_set_perm_abort(void) check_locked_bytes(fd, perm, ~shared_perm); blk_unref(blk1); blk_unref(blk2); + g_free(img_path); } =20 int main(int argc, char **argv) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index a05a4628ed..b73d231cd5 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -59,7 +59,7 @@ fixture_setup(TestFixture *fixture, gconstpointer data, g= char **envp) =20 fixture->loop =3D g_main_loop_new(NULL, FALSE); =20 - fixture->test_dir =3D g_strdup("/tmp/qgatest.XXXXXX"); + fixture->test_dir =3D g_strdup_printf("%s/qgatest.XXXXXX", g_get_tmp_d= ir()); g_assert_nonnull(g_mkdtemp(fixture->test_dir)); =20 path =3D g_build_filename(fixture->test_dir, "sock", NULL); diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index 9b1dab2f28..0da6a6157f 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -631,7 +631,7 @@ static void *notifier_thread(void *arg) static void vubr_host_notifier_setup(VubrDev *dev) { - char template[] =3D "/tmp/vubr-XXXXXX"; + char *template =3D g_strdup_printf("%s/vubr-XXXXXX", g_get_tmp_dir()); pthread_t thread; size_t length; void *addr; @@ -640,6 +640,7 @@ vubr_host_notifier_setup(VubrDev *dev) length =3D qemu_real_host_page_size() * VHOST_USER_BRIDGE_MAX_QUEUES; =20 fd =3D mkstemp(template); + g_free(template); if (fd < 0) { vubr_die("mkstemp()"); } --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661336548; cv=none; d=zohomail.com; s=zohoarc; b=aHXD0sct7dwzY9FIQGLsEaYosrQIux9IuNtC1jsfgjeul9s6JkvFZVoRsvxKtyH9mkIumVBlbjHL/3LVZtNfSef/wYbeeSfCD9cq4vrZGDkY7DJVb+j4qC41umB7tminx3+Y5UfesnOZ4jYudqSo8/DMoaykzQcJk/KmobqvyTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661336548; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7LWxjzLiMjVy2izI9dRF2Sjpli2Wn10pIJc7DSpn6QU=; b=LAOPEMSzGxRhwVMhbpsQcXHV2QBUnuWD9u209CmNqLWy+8AuDWyFqW6uKoHw84sWt7hsyuAzrig6wthMc4X69hmpUamySkGvp/HhRBI252dA49DVuoR/LxUw6kLtHII5z1pJBf91iSZGkr/NT7OMBIAciLRND9MRwDW/RhjDvFw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336548835103.43449724331947; Wed, 24 Aug 2022 03:22:28 -0700 (PDT) Received: from localhost ([::1]:55704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnWk-0000cI-OH for importer@patchew.org; Wed, 24 Aug 2022 06:22:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmte-0002vj-L7; Wed, 24 Aug 2022 05:42:04 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:34581) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmtd-0001WL-44; Wed, 24 Aug 2022 05:42:02 -0400 Received: by mail-pf1-x42e.google.com with SMTP id x19so13186490pfq.1; Wed, 24 Aug 2022 02:42:00 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=7LWxjzLiMjVy2izI9dRF2Sjpli2Wn10pIJc7DSpn6QU=; b=brdxMJGzxUwCXxXL4kV2S6/E0Ku999Foeiqquf6mQi3/b3gHgiE6SXy5f+RlSqSsnz 0+mdtqrFDKmqeWGKEZecGnrz2sek+LRQM/pLpEHeF8OOmt7kkGQZuULr6hgmAOJ5q0bl 84rZ184Yxm020cPx1b7Hc2xdScQYWJqOqT5MTPoJ0RZmLWvqBwizoZOG5H46B0JPPTIM eP2V8gaPEoJ1hBbTjY/ejvgvMouDO5CDbSoa49Mjz91OS4NSy/BMgBzBA1cv2HOTRM9s vo+mzoYv0KS7l+ujdCfwmFLBMmCei+Hj27ksrNCYYt5oPr5/6m2dwcXYye1xYj+N0jL9 ZeTQ== 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; bh=7LWxjzLiMjVy2izI9dRF2Sjpli2Wn10pIJc7DSpn6QU=; b=yIaDef0FyHoE28sXMZWonTkZS3tTmgqdDUdBbNEiatL0mPVpsKBdDv2WGkFm7CzBSs 5PQ1AdckBVRbp4m95fdEBzO4A4d8jZy8dYzl+g2RPiXcUBnJTuYZYCAwBf0NeaEPwlD7 Gw1yfmuMilcax+cjW39HSlxkFFvS+j8uRbLQ0ivZ9R/pe3wUVN8OFyjbmWOML5lTWrm/ SFIq7mHiTQuPEqJJd6c15cnPJQZVRMzRY14Fh9dr33lPUNkglsu6lgW+BcUemTgkSubu kWmG/MVbdGC6qwFsoTimOh4yraZF422H7mVES+9+yYMOZkt3kNTxCMIECMLhfv2eCYyb lhKA== X-Gm-Message-State: ACgBeo2FwyGEU1DOPEpgN/9n03ZDiqxve0neL9i2+dtRsViM0B+Hsluz 26pZgHQ8PRbGQLESxxm3x8hpUuCVElE= X-Google-Smtp-Source: AA6agR5v/k8hr1mxNevhLJOqumg6Wn3LkoHhqDmQk7vcQw4U/bv+iHEsgxrihGpE0HpyeJOzfsoAjQ== X-Received: by 2002:a65:6c10:0:b0:429:4a5:a4d0 with SMTP id y16-20020a656c10000000b0042904a5a4d0mr24185074pgu.614.1661334119236; Wed, 24 Aug 2022 02:41:59 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Hanna Reitz , Kevin Wolf , qemu-block@nongnu.org Subject: [PATCH 08/51] block/vvfat: Unify the mkdir() call Date: Wed, 24 Aug 2022 17:39:46 +0800 Message-Id: <20220824094029.1634519-9-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=bmeng.cn@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661336550449100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng There is a difference in the mkdir() call for win32 and non-win32 platforms, and currently is handled in the codes with #ifdefs. glib provides a portable g_mkdir_with_parents() API and we can use it to unify the codes without #ifdefs. Signed-off-by: Bin Meng --- block/vvfat.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index d6dd919683..9c389ce5ea 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -2726,13 +2726,9 @@ static int handle_renames_and_mkdirs(BDRVVVFATState*= s) mapping_t* mapping; int j, parent_path_len; =20 -#ifdef __MINGW32__ - if (mkdir(commit->path)) + if (g_mkdir_with_parents(commit->path, 0755)) { return -5; -#else - if (mkdir(commit->path, 0755)) - return -5; -#endif + } =20 mapping =3D insert_mapping(s, commit->param.mkdir.cluster, commit->param.mkdir.cluster + 1); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661335761; cv=none; d=zohomail.com; s=zohoarc; b=Ml4MXsVIoT44ZtZQOibdY6rqdG6A9iEFjXu7oMlwJN0ir99qlg1xfTueQGkwGXbDxRM0M5r+38+sTtKAaEEX6/Q+PhkwfOK9KR6U+IPyws+b0i3CfPaZyoY/5YTeXJ21HnVYwGoksL562CvW6BbN0i+5efOOdLnRnK29F/4YryU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661335761; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uGLFIworI1xOFZhnwuk3wq/AntR+XkzGoiU2XFOTgo0=; b=JIX/kKYpaxz18xdPjODPpKHsJPpEUh/nT6sQYp06VUmKbQMBOxVKZ+9qJSoUkvIt2MgTk6YvxWDYux5X4XsaaobgoNU1VUIcgSbmii6tSKW0dpBgQN5GVc6JXek1Nw/UgevxpJAyJdytIcZZ+ZCq+Ir+fvsUXOzFggM86veBYe0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661335761939239.89077131980946; Wed, 24 Aug 2022 03:09:21 -0700 (PDT) Received: from localhost ([::1]:39746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnK4-00044Y-S8 for importer@patchew.org; Wed, 24 Aug 2022 06:09:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmtf-0002w5-Jy for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:04 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:36580) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmte-0001NS-3Q for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:03 -0400 Received: by mail-pf1-x42b.google.com with SMTP id w29so10407716pfj.3 for ; Wed, 24 Aug 2022 02:42:01 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=uGLFIworI1xOFZhnwuk3wq/AntR+XkzGoiU2XFOTgo0=; b=hK3zf2SdQjnuubDCuPzkm2tPHXZvcyonSeV/7cfAvKHhaTWgLvDrirR1wgCLudhaO9 EHyM5BUvxz0urxbDwRrsyvqGkF8nAwizB5HeZkxby0IFXTICcDoMgRcgOl1O5oAR+3Ud 52BPnhCaufzCWEIEWyMNjJTO8vtHOD/lqEXUKZtT3FcgbSr0BjXxy2ocxRzy7lbvgacR stlK8n6mAUySGE5hmmS91CF4bBNIP0Ei/LeNAlWqEoFZFCVmDtidOaYeCrPyJY0P/QjA 8MVPYDKiYYhiGQ3icK/ESlqomNAqN1zAHrXsRuW2TniGgTUilk6L64rnaYxip2sO3tP4 eJvQ== 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; bh=uGLFIworI1xOFZhnwuk3wq/AntR+XkzGoiU2XFOTgo0=; b=c615jSQIZjORRNlL2VJlpjYuMblGAUGcrOqLxd4XDDiIXorfoXoA1Cytq383m0nYnw 1Uuq4VydndeRdqPomMLcQOFFk9006S7GV+YxfWxuO3y5t7912MfNwTWyih+sv61s8Xmq G/KrsPz2U3X2gtYXVNIjgSTFFvgdrgHY9l2BbQ9/CWGS99AM1P1eckT5ZeHSS2s+udSW Eto0E0q6Y2SqZs08uoo7UryijTkwWLLgzbtYUxJpqCxGTLO4+hYzgMyWriMigcpJElLN PcDEoifzsrvVFJNf7Plhxb/++TZV7ipH40uM0vm6YM7y2JsKWytzm2k6/uqkRDwln3sT w9JQ== X-Gm-Message-State: ACgBeo1WlzvRONqxKnkQlJqneugyzNtwTwiLwk3q0haIfLAnmPjL9YtP y2FAnWEg/PHfp2UQCVE39tU1wr9jBk4= X-Google-Smtp-Source: AA6agR5HL6ux2y05GQJjqW4yDOr+iimfNi1fY83MnW1Vi0+bCpgTOtPZJTGNZnjWjx1t+FNgqzAM9Q== X-Received: by 2002:a63:18d:0:b0:42b:321e:b55 with SMTP id 135-20020a63018d000000b0042b321e0b55mr406888pgb.39.1661334121145; Wed, 24 Aug 2022 02:42:01 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Christian Schoenebeck , Greg Kurz Subject: [PATCH 09/51] fsdev/virtfs-proxy-helper: Use g_mkdir_with_parents() Date: Wed, 24 Aug 2022 17:39:47 +0800 Message-Id: <20220824094029.1634519-10-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=bmeng.cn@gmail.com; helo=mail-pf1-x42b.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661335762631100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Use the same g_mkdir_with_parents() call to create a directory on all platforms. Signed-off-by: Bin Meng --- fsdev/virtfs-proxy-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index 2dde27922f..d0cf76d6d1 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -639,7 +639,7 @@ static int do_create_others(int type, struct iovec *iov= ec) if (retval < 0) { goto err_out; } - retval =3D mkdir(path.data, mode); + retval =3D g_mkdir_with_parents(path.data, mode); break; case T_SYMLINK: retval =3D proxy_unmarshal(iovec, offset, "ss", &oldpath, &path); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661334823; cv=none; d=zohomail.com; s=zohoarc; b=MTlnN5bbxTTBGAqi4+R6Cgfv9Wx6GdyO7HAIEiCnKhMSDAbP2cisXBl9a0DKHe6gMWWW705IIHCVMvQA4/mCMOyb5qVAoAlWFaXMnCart4qG8Rqc8l1nalm2UZzCwDOrsoQpayIjmNCWu3xI/5IJyzKdnFPnn3mFWWnny6lgX2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661334823; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=okL54vu8KfmBMW82fUAkEZfCTjhZQ+qL9qNrcu24ZKE=; b=mt2F5p85ktyMH2cu3r6zZb4+otZZH1otUpIV+keGp6gFkgIIo1xdxI3YXSzKsFON6HH0+K7qpl4gVzGXxD/o28615cEpeJE9VchQKElWj+0sOc+sfCXsEO4BWrdFG4npF+JDnYPwjYfg8xIG7ew6SGESTvCZ171AziU/GkLctps= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661334823154927.8132409525684; Wed, 24 Aug 2022 02:53:43 -0700 (PDT) Received: from localhost ([::1]:41962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQn4w-0004So-5x for importer@patchew.org; Wed, 24 Aug 2022 05:53:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmtj-0002xG-RP for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:09 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:46997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmth-0001Wm-71 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:07 -0400 Received: by mail-pj1-x102f.google.com with SMTP id o14-20020a17090a0a0e00b001fabfd3369cso944536pjo.5 for ; Wed, 24 Aug 2022 02:42:04 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=okL54vu8KfmBMW82fUAkEZfCTjhZQ+qL9qNrcu24ZKE=; b=FULijv6JOJ5jD36MfgHbXDe1LFAZbDtmXhukncB6/emRjx4LoHOoscfoM47iKCm5p8 Zjjcyy8uaCSXcjMAPaphEAj2GrE5FLdouimrEu2Yjcb7cn/pDBUY1d7zo1/RSY8zmiam Ps/bfDefgd3YkjIycCwNhCyTREj+ltvLu9x8gttR8aG+AXhj5oEbqQqTwqCSnWQIHebx kDr2ycNn4H0C1UlGuhJghBicBRMtneiPfZmqC3GekAVCMPx3uqfOkwIZyPlxh5PCdg/0 xVuePhq/2GYfTuolfg9WiIVrWxouy8cx9N63s58PY4aUXWd6gK9mTWjPs7m8nO1vAgrD emvQ== 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; bh=okL54vu8KfmBMW82fUAkEZfCTjhZQ+qL9qNrcu24ZKE=; b=xMVOTa0BfscjQ25fRqxTNqi4e3D/erbI8UNy8Q064bB/wyZhi8/V9jZ5go4ivdVKeT 7jQyouGGSAcgNbD9ihBXVtJbXnFK/mqLgB6cjBbpwJuaNPBfArhvswFpiIVVlIgt2pOr Iu+Gug+GGS8exHiqgcqv0Nf4eFVEJHavIw/c8sTYfaSucpg1gn7lxo8yEtZkBBBE05lk 96KoorvAkhYwH3cnnyWnofpaXxw3NO8bmsVQt5Plsa3NEvqZEnn0sOfuWWM6Dqhw/nEu YruuJVoZ9JDqPJ0dzvi2KKnLSJfVeLBR4f0Tp8lq5YeKgYdhej4ipJF4b2hawwCR6+TE FbiA== X-Gm-Message-State: ACgBeo0hebUeGZEbsfoDoo439+6UuqqeQ6FAb8ZHjKKkfxqRavbAe8FJ 11bQuEXFyrzUGuy1eyE0XNs/k5FxtNE= X-Google-Smtp-Source: AA6agR78K0zd6IKnw/srvkSGYqPCa3h6gsk1dDJ8TQSAdKdFECekouX+FjYs0eaKDvn+JaJvj7r1JA== X-Received: by 2002:a17:90a:640c:b0:1f7:6ecf:33b6 with SMTP id g12-20020a17090a640c00b001f76ecf33b6mr7430107pjj.3.1661334122960; Wed, 24 Aug 2022 02:42:02 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Gerd Hoffmann Subject: [PATCH 10/51] hw/usb: dev-mtp: Use g_mkdir_with_parents() Date: Wed, 24 Aug 2022 17:39:48 +0800 Message-Id: <20220824094029.1634519-11-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x102f.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661334825170100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Use the same g_mkdir_with_parents() call to create a directory on all platforms. Signed-off-by: Bin Meng --- hw/usb/dev-mtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 5831395cef..97c894f231 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -1622,7 +1622,7 @@ static void usb_mtp_write_data(MTPState *s, uint32_t = handle) if (s->dataset.filename) { path =3D g_strdup_printf("%s/%s", parent->path, s->dataset.fil= ename); if (s->dataset.format =3D=3D FMT_ASSOCIATION) { - ret =3D mkdir(path, mask); + ret =3D g_mkdir_with_parents(path, mask); if (!ret) { usb_mtp_queue_result(s, RES_OK, d->trans, 3, QEMU_STORAGE_ID, --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661334950; cv=none; d=zohomail.com; s=zohoarc; b=k6LN3KLlaeiZQS58GGdPdO4vuIzJQhIMOG3U2NpvWUvg1bwScLmCNOdnPmssUQj2vVaXYaSEmVOWx0v/nUXAJ8+ggVtv1jsf9q7NYMUvCS5eTev2fE4HwI9ZvUqNZsh8sq3RiZFpRyD1YmycSR07+80RlIilSO5ToKl3VXa5A/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661334950; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SN2ceznSVxwoPTz/GsOpvn+I87JiMhfV5WRmzyHm7SU=; b=ZVI9tVMeAX1FRJ6bk7YVm0fsWsmtEhUgFT0w1SRx4Nik5sok04+kqOq2+PMrdvt8WlSdPtB3j1NmXybjLbG8qmVKdr9WdqYoBaqnpznVqncCaN1+Q99Iqh+eYYk7o40t44U9Mu4VdRWpMU0B675QiJpgkWxhLEM8lNb97rK2Jyk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166133495021944.23062332723464; Wed, 24 Aug 2022 02:55:50 -0700 (PDT) Received: from localhost ([::1]:46866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQn6z-0006Hl-5a for importer@patchew.org; Wed, 24 Aug 2022 05:55:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmtk-0002xI-Gl for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:09 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:34742) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmtj-0001Ww-1V for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:08 -0400 Received: by mail-pg1-x529.google.com with SMTP id 12so14557690pga.1 for ; Wed, 24 Aug 2022 02:42:06 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=SN2ceznSVxwoPTz/GsOpvn+I87JiMhfV5WRmzyHm7SU=; b=euH1A8kw3PSGPH/748aMxpJ3UvnjdLxXSmTRJXdLMbJb9g+3IbiwQzI64ILAiSdwNN 54vo9PevczcGqX6rfGJuiHYI5J+MFgTWYYczpDrehWIGYm/upFtjA3d4MSCpBrg0b5Cj 0ucCrSu75IbahCpqq4PYP6ZMY5x7UQZoDSmSBZ1Vo+uxLNKUlhlJOHI+dU5ls1VrNruQ bh712Sp6QKB4S2k9U1hauovu79vgjhxcw4wbyyHTDpMUQdQuLH2bTWxuvWewmtUGFWSu TwTalVjmxsPzzh1fHPvGhRZxYd8vyeygUH4G2PGE3ZBWPCfx0n4LHskt8416kCfu8JPq cWOA== 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; bh=SN2ceznSVxwoPTz/GsOpvn+I87JiMhfV5WRmzyHm7SU=; b=WHyLhUtK6AZTPGHatkcoxs/qopc67RUZEIBq7wPRWGStxPHP09NOA2fO5hMq6eY+gJ xjidBsNy95D+pvSyktXW6cPZcRcV3x6hRMA9qTgPu3OStKqZpfNhHWf9G6O1owBhf8ls YHLmlgzC+EZag8kjhe80tWnggmFbJ2lDMQzkipgR4apjNgNXfsM2djdUMytJztnC9bd6 Rgmvf4jIxngnPFhp2BxWy1QRLPoyAaXUOg23fL5DA7uv1ipWDPpkaoLUpOioYO8koQBB VlBJhDH+HLRyUgoXZZLm4U8n9C2YCEndBWbD3PoIlME3qPgMgg68gkxSBZ4Wd8jhNaam XpQg== X-Gm-Message-State: ACgBeo2iE7dGkX/6BJd1HlWlY0hET+Zt1HjPkFqzK5okJUjmKEcCnzdw L4l2nGuPq8J7CUYX+AlC9PQKKq4ldCo= X-Google-Smtp-Source: AA6agR78wfyQrmvdUm2ADf0XWO+XOecbi91ZQpIrMp0ueeij7sZ4uSEHdZouuCujGBoZxF5UZ3H7rQ== X-Received: by 2002:a65:6bca:0:b0:420:712f:ab98 with SMTP id e10-20020a656bca000000b00420712fab98mr23709916pgw.350.1661334124925; Wed, 24 Aug 2022 02:42:04 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Konstantin Kostiuk , Michael Roth Subject: [PATCH 11/51] qga/commands-posix-ssh: Use g_mkdir_with_parents() Date: Wed, 24 Aug 2022 17:39:49 +0800 Message-Id: <20220824094029.1634519-12-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x529.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661334951974100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng g_mkdir() is a deprecated API and newer codes should use g_mkdir_with_parents(). Signed-off-by: Bin Meng Reviewed-by: Konstantin Kostiuk --- qga/commands-posix-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/commands-posix-ssh.c b/qga/commands-posix-ssh.c index f3a580b8cc..2460112a38 100644 --- a/qga/commands-posix-ssh.c +++ b/qga/commands-posix-ssh.c @@ -59,7 +59,7 @@ static bool mkdir_for_user(const char *path, const struct passwd *p, mode_t mode, Error **errp) { - if (g_mkdir(path, mode) =3D=3D -1) { + if (g_mkdir_with_parents(path, mode) =3D=3D -1) { error_setg(errp, "failed to create directory '%s': %s", path, g_strerror(errno)); return false; --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661336076; cv=none; d=zohomail.com; s=zohoarc; b=Wy7gA1DveOHjpMwqZrjYgAGigdWiEfBNN05/uFNbtuRQl8ZBCYvXOMPANZAbSgZFVTGg5t/lWZu0cznpex3lo2LQlo3MvfFALSPUq6RNcsxiMXri4EmxU58VAg19BzGT/tkvYT4GwAfnJ4Rtkjr1mju+ccgUdMkYnoGio37muKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661336076; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PVY8h/tTrArd5DSKz6bRlz61yqGVT8tU2bwvHb4Unqc=; b=juXJcxHL74kdFwhbVAVFJqmkXpIn2nm1EjKvr4UyCdEdvwOgRXWsMA7x7hzVdb3qwjQ+0iO3MPf5j9S9FIpAOFxHGadwVDfyeUNNshqUZleb3dRHPHBm5OyVoupnJus33st7nmNeq76IfIQ5AxWJpUJydnKQqioGBE1dMHGZFwY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166133607645083.31661176445152; Wed, 24 Aug 2022 03:14:36 -0700 (PDT) Received: from localhost ([::1]:33694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnP9-0001pm-8B for importer@patchew.org; Wed, 24 Aug 2022 06:14:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmtp-0002zl-KK for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:14 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:45001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmtn-0001XG-Pg for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:13 -0400 Received: by mail-pj1-x102c.google.com with SMTP id r15-20020a17090a1bcf00b001fabf42a11cso948658pjr.3 for ; Wed, 24 Aug 2022 02:42:09 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=PVY8h/tTrArd5DSKz6bRlz61yqGVT8tU2bwvHb4Unqc=; b=WxF1douoWH8KazljzpJ5yLjNHi0hLOKo9lyYLRBSQrWBJM3WGtNE/AaQTx0xGx7Do+ JGGci4dx32MP3bfFdLQBi4XxfYilHUjdihe17B8h+CKkoQcpLW0lI3Lk88PJWvEaWaHH 4djOkyDQBwtjOD7zktx78NF8oj8FYdrunvOOV6yp5wgqk2sN3oov7RYeFBOZqHo7n1oM WcMVBvF9y9fRMj1a8eH9v7iF748+TIL3bXrwHUKZGRl2Kn0myHWz5nA5YZ0s5vyWbjAa +awnweay1AJ7Hln8GX5DyeucdSXKDAMip6+pGuusxZJuOXvythjlN2NjfD/llNeKLnlo P3Mg== 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; bh=PVY8h/tTrArd5DSKz6bRlz61yqGVT8tU2bwvHb4Unqc=; b=QNEIyUm1WLjQQ8tku1pdRTqKGC7IvLkUG/Dgs7azGHW75W9509Rn08r2Lnkts5PMWD Oh8NAnX1lZ5nBE22HupTcTdkvmJcouzoOnsJoxa9ixmlRjMIHNAZBxj0M9jT/p6gis46 5kH8xd7fixdzz1yN0PP6U4QxqmD9TvPm4sr2aC3WarLufDBGy3I/Hu/dVLlc4MBIOL0T HTWs7qBakKBF4u22tEkm7wN5UjoGy18W/3MMNK3mQIB16jrPD83swFNo+2brNZe4gwls +18xdDVghmTw4m5nGLr8+iAHkGZtvAagoFUABXis7Z6UKgDPWJzKV/rPArwJl4f7Xgmh YIkw== X-Gm-Message-State: ACgBeo1j0P7Z8+2n67DuOk5Q+xh+pXh4tLHbjY6xlUFPDwHyzQxZn9cs YnQEuoxqo64gj4ls+aDwnekzq/xH2Yo= X-Google-Smtp-Source: AA6agR5qiODdXLnZnXyZiVGECY1Dw3npyrjo9fPV63p4ULNYkJCXUUXCl9kEmSve0I+880unBC7z2Q== X-Received: by 2002:a17:90a:ee88:b0:1fa:aac3:6fb7 with SMTP id i8-20020a17090aee8800b001faaac36fb7mr7379816pjz.62.1661334127901; Wed, 24 Aug 2022 02:42:07 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Dr. David Alan Gilbert" , Juan Quintela , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 12/51] tests: Use g_mkdir_with_parents() Date: Wed, 24 Aug 2022 17:39:50 +0800 Message-Id: <20220824094029.1634519-13-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x102c.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661336077076100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Use the same g_mkdir_with_parents() call to create a directory on all platforms. Signed-off-by: Bin Meng Reviewed-by: Dr. David Alan Gilbert --- tests/migration/stress.c | 2 +- tests/qtest/migration-test.c | 6 +++--- tests/unit/test-crypto-tlscredsx509.c | 4 ++-- tests/unit/test-crypto-tlssession.c | 6 +++--- tests/unit/test-io-channel-tls.c | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/migration/stress.c b/tests/migration/stress.c index b7240a15c8..88acf8dc25 100644 --- a/tests/migration/stress.c +++ b/tests/migration/stress.c @@ -232,7 +232,7 @@ static void stress(unsigned long long ramsizeGB, int nc= pus) =20 static int mount_misc(const char *fstype, const char *dir) { - if (mkdir(dir, 0755) < 0 && errno !=3D EEXIST) { + if (g_mkdir_with_parents(dir, 0755) < 0 && errno !=3D EEXIST) { fprintf(stderr, "%s (%05d): ERROR: cannot create %s: %s\n", argv0, gettid(), dir, strerror(errno)); return -1; diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 5fa4ffeff0..38356d4aba 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -761,14 +761,14 @@ test_migrate_tls_psk_start_common(QTestState *from, data->workdir =3D g_strdup_printf("%s/tlscredspsk0", tmpfs); data->pskfile =3D g_strdup_printf("%s/%s", data->workdir, QCRYPTO_TLS_CREDS_PSKFILE); - mkdir(data->workdir, 0700); + g_mkdir_with_parents(data->workdir, 0700); test_tls_psk_init(data->pskfile); =20 if (mismatch) { data->workdiralt =3D g_strdup_printf("%s/tlscredspskalt0", tmpfs); data->pskfilealt =3D g_strdup_printf("%s/%s", data->workdiralt, QCRYPTO_TLS_CREDS_PSKFILE); - mkdir(data->workdiralt, 0700); + g_mkdir_with_parents(data->workdiralt, 0700); test_tls_psk_init_alt(data->pskfilealt); } =20 @@ -873,7 +873,7 @@ test_migrate_tls_x509_start_common(QTestState *from, data->clientcert =3D g_strdup_printf("%s/client-cert.pem", data->w= orkdir); } =20 - mkdir(data->workdir, 0700); + g_mkdir_with_parents(data->workdir, 0700); =20 test_tls_init(data->keyfile); g_assert(link(data->keyfile, data->serverkey) =3D=3D 0); diff --git a/tests/unit/test-crypto-tlscredsx509.c b/tests/unit/test-crypto= -tlscredsx509.c index aab4149b56..3c25d75ca1 100644 --- a/tests/unit/test-crypto-tlscredsx509.c +++ b/tests/unit/test-crypto-tlscredsx509.c @@ -75,7 +75,7 @@ static void test_tls_creds(const void *opaque) QCryptoTLSCreds *creds; =20 #define CERT_DIR "tests/test-crypto-tlscredsx509-certs/" - mkdir(CERT_DIR, 0700); + g_mkdir_with_parents(CERT_DIR, 0700); =20 unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); if (data->isServer) { @@ -141,7 +141,7 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); =20 - mkdir(WORKDIR, 0700); + g_mkdir_with_parents(WORKDIR, 0700); =20 test_tls_init(KEYFILE); =20 diff --git a/tests/unit/test-crypto-tlssession.c b/tests/unit/test-crypto-t= lssession.c index f222959d36..615a1344b4 100644 --- a/tests/unit/test-crypto-tlssession.c +++ b/tests/unit/test-crypto-tlssession.c @@ -249,8 +249,8 @@ static void test_crypto_tls_session_x509(const void *op= aque) =20 #define CLIENT_CERT_DIR "tests/test-crypto-tlssession-client/" #define SERVER_CERT_DIR "tests/test-crypto-tlssession-server/" - mkdir(CLIENT_CERT_DIR, 0700); - mkdir(SERVER_CERT_DIR, 0700); + g_mkdir_with_parents(CLIENT_CERT_DIR, 0700); + g_mkdir_with_parents(SERVER_CERT_DIR, 0700); =20 unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); @@ -398,7 +398,7 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); =20 - mkdir(WORKDIR, 0700); + g_mkdir_with_parents(WORKDIR, 0700); =20 test_tls_init(KEYFILE); test_tls_psk_init(PSKFILE); diff --git a/tests/unit/test-io-channel-tls.c b/tests/unit/test-io-channel-= tls.c index f6fb988c01..cc39247556 100644 --- a/tests/unit/test-io-channel-tls.c +++ b/tests/unit/test-io-channel-tls.c @@ -125,8 +125,8 @@ static void test_io_channel_tls(const void *opaque) =20 #define CLIENT_CERT_DIR "tests/test-io-channel-tls-client/" #define SERVER_CERT_DIR "tests/test-io-channel-tls-server/" - mkdir(CLIENT_CERT_DIR, 0700); - mkdir(SERVER_CERT_DIR, 0700); + g_mkdir_with_parents(CLIENT_CERT_DIR, 0700); + g_mkdir_with_parents(SERVER_CERT_DIR, 0700); =20 unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); @@ -273,7 +273,7 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); =20 - mkdir(WORKDIR, 0700); + g_mkdir_with_parents(WORKDIR, 0700); =20 test_tls_init(KEYFILE); =20 --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661336448; cv=none; d=zohomail.com; s=zohoarc; b=JUQ0BDRN/OWDXFkr7nsUWNhAGYIDW1RwgIokCzRcTyhh/MxXSGPVPHkepc/bcfW9fKWIyoD/RwsJcbRnWFYdzmMwlGqG9+g+LAnfXWL+UJR89K7r5/WmgZxiHsLI/3yj1eLrrpdiBcsEr+asEwtyAZhsu1TtU6NFoIurGi8iopo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661336448; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=W9655HKzuq1+51j74aBikX9dYDW+xgLkZuf/6fT2hgM=; b=mqmdSThdvEW/QwIF2T9OcrhQjanEqKbrvri45uhu52RMD+TeuQwmIFH/khjYiCKaiTFCjIHNuPyudFm8mSKDRDd9mHHTNxon/+OxWBgb/pez9n6pC5Z5jNec586rPIUOK26SaW8ROD8LpG8q71SVY7Hn2NN50oLaqdXKKPYOVLI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336448191191.0244769656332; Wed, 24 Aug 2022 03:20:48 -0700 (PDT) Received: from localhost ([::1]:43148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnV8-0007kS-4S for importer@patchew.org; Wed, 24 Aug 2022 06:20:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmtp-0002zk-Es for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:14 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:42698) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmtn-0001XS-VP for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:13 -0400 Received: by mail-pg1-x52b.google.com with SMTP id q63so308900pga.9 for ; Wed, 24 Aug 2022 02:42:11 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=W9655HKzuq1+51j74aBikX9dYDW+xgLkZuf/6fT2hgM=; b=LZ9T9xLYEDIxRmLrG3Z7caIqTnkKVucJaTIwdnqgRI/rNSwVne+Fh72ubSqCSFhn2B wuRns4mpJjX9lUQZikwgTmzTJIpzKmdAycv7DYJp3C2lcrK/6qXJ4qX4jzgcj02KO3Ur axb1Y7YVfrhiuCeFyT1U0GX1E4xh4W14vPlhvxgK487CNk+RkC4hN9LkVhO4E/a6TxUD hBUYaVAz8kB6mSKmq5E0W3y/38IbogIQOBSEwsn/cL6xyUsESHMg45y2xPxz2bEoc5Yn CMpw6rWI/C8kIghPoMNFwvzgpMf+VBfkaKe8GNiMGBUeuEe6j5qv6yo2SBLlmVGrtTV7 dcnA== 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; bh=W9655HKzuq1+51j74aBikX9dYDW+xgLkZuf/6fT2hgM=; b=VPU07YZGN03kYYnHGWub+T3O5zuqgHew3C8uYW9K5o15BjIi8aFZgWu6PJpJaiI2Dr 1X7xcudo482GZ09mYOYoIIBdiLgdkdSeucpQ0CYy4d12lkYUNo4IuN+Wu9/VwWIjFk3u eXGEWon1X34MlplsNhOQu6PHmmQ6gJJvq6t+BArUUou8c0tuSn0nBNxOOs7Bnka7C9Ma gMhlycttNt+v8Xsb2vqsroXbCZ15rn2ukeVfbr15EPyTXbCMtgW0xe4tdURguCu+vce1 o8u1PlzXmc9QKjd2Msjoh5kOirEx1n0ZITg/YZl0lyYy/whsMNIH8d21hpYTfyKbfh/r Juzw== X-Gm-Message-State: ACgBeo13Vh5nYHCxPwc/dYdaQfB+EkUWwhQsbPXxHf0A6gQx2RRorUAB FmuEg8p0vTq00IsKQeLIZiA8lAQrX5Y= X-Google-Smtp-Source: AA6agR4SM2xNBCe3ylE4R19QBJfDEEq6QBITiQSsCCr2necm9ff4/U1il/2Qt/bPhz+KUh5aL9GWyA== X-Received: by 2002:a62:be0e:0:b0:536:76fe:ee96 with SMTP id l14-20020a62be0e000000b0053676feee96mr14546120pff.44.1661334130469; Wed, 24 Aug 2022 02:42:10 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , "Dr. David Alan Gilbert" , Juan Quintela , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 13/51] tests/qtest: migration-test: Handle link() for win32 Date: Wed, 24 Aug 2022 17:39:51 +0800 Message-Id: <20220824094029.1634519-14-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x52b.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661336449847100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Windows does not provide a link() API like POSIX. Instead it provides a similar API CreateHardLink() that does the same thing, but with different argument order and return value. Signed-off-by: Bin Meng Reviewed-by: Dr. David Alan Gilbert --- tests/qtest/migration-test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 38356d4aba..af9250750b 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -876,9 +876,17 @@ test_migrate_tls_x509_start_common(QTestState *from, g_mkdir_with_parents(data->workdir, 0700); =20 test_tls_init(data->keyfile); +#ifndef _WIN32 g_assert(link(data->keyfile, data->serverkey) =3D=3D 0); +#else + g_assert(CreateHardLink(data->serverkey, data->keyfile, NULL) !=3D 0); +#endif if (args->clientcert) { +#ifndef _WIN32 g_assert(link(data->keyfile, data->clientkey) =3D=3D 0); +#else + g_assert(CreateHardLink(data->clientkey, data->keyfile, NULL) !=3D= 0); +#endif } =20 TLS_ROOT_REQ_SIMPLE(cacertreq, data->cacert); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661336817; cv=none; d=zohomail.com; s=zohoarc; b=YssIkdlxbaQ8Q3Fpp54N3+LCsO7Updxh6AsYfx67qejzmHme6rri3NFjvUCt4QXZSAAWKIuKJmPIynvKg2/lG5fPV5n/cj1A93Qy9oISFIoC29nKoGpu7U8g43lohu32CBOmK4kbRWz/7fTKwRGxhUXIuWqTWKKfA01CnsZU8yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661336817; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3b8VL5TpGtN7dWhCerIisYEccmQt7giekuIGaaaF6O8=; b=WUf3BXO6qUXNH1luYOKeB3Z37nVSyWwP2uxjARy4rBBVsRjWHRo8RnE2BTRioOKV+SJm/AijI6Wp5b6wYYav6pKjLtyGbRzoFrpWXu6KN9mSEKUZaZmSifGSf04jOjsXu+wMGkpb3u4OzLhc1WSQyAruSHSouj8yPWFfFPXi3oA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336817863917.1300813797957; Wed, 24 Aug 2022 03:26:57 -0700 (PDT) Received: from localhost ([::1]:37028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnb2-0005CR-LK for importer@patchew.org; Wed, 24 Aug 2022 06:26:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmtr-00031p-Vp for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:15 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:34553) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmtp-0001Xc-HY for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:14 -0400 Received: by mail-pl1-x635.google.com with SMTP id io24so1898118plb.1 for ; Wed, 24 Aug 2022 02:42:13 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=3b8VL5TpGtN7dWhCerIisYEccmQt7giekuIGaaaF6O8=; b=qjaaqfAWuFwFCJHnVsNpJJ4gN1ZDvHmCZyVyO4SqM97cld8qBtRn0kZg6ii5eWL4mQ 4AI1pqRO7A1G6V85mw18rNARWTtZgxG54oPSuhyDplklrcoa3sPoToZv60SHmGzqznp7 RCXAiGvk9Dczt2OPMbctu7lNYMCrQ9VTgXmeO2UFijR6sMbrHlw81TJ+zw2fZmS8SfkF pt6hqMjnehG6SHtCfnQV9GlSjGovSzRH9wsNOo7PkISsBv8C66soAKI6OkGtQ7JV68Ed qdp6QyNBUY7kBFo/NFE0eu1yZFVpe/ETKUxUEurFPC/r1qWcSuAeiQVbsoGtBOhkPD3J W3Wg== 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; bh=3b8VL5TpGtN7dWhCerIisYEccmQt7giekuIGaaaF6O8=; b=uai9jVRGSynNRRNuHcIB7OBstjVIhRGG87/n78ve26FCinJJuKePYG43kwj+asjwnU /PSgQzxdDN6bp3IVdLrgwGqTqkPsCaNV6kRX+Ti6DV8HU/a4e5TwLy3qqgfJIFQ54I7d /o/khIQDrAPT24l7Hievr8PmZC899zXjAfMgaJtbZ40l4EAgvF+5RTIDe+buiTBk//ny 5zzE0E5BGBU8q2ZUe58EWIZyQHWjPs4yHHIQ0thc65saIUfz7OrXwiLke133Htz/AeKu KhphO+LHnfmLiGpYAzJMfkLwaDYG8lXiQXds4YevEZjNd3AW4ybBd/xZAlwSBO3KW4NY G9IQ== X-Gm-Message-State: ACgBeo26Hwu2ep+EAbTIcmPNqcErKh2sOyXIkNI1NfkFblCEZ9FnF/64 C2IZWPJuLPHXC9BuTvxskNaP2UOV2Xw= X-Google-Smtp-Source: AA6agR5TBeQk+xNJ/7wJcR3S3X6PS/Fvdo+awDk7uXMldiZ9G0Do5uNda7Y3iC5uEX0W7ux4dY1GSg== X-Received: by 2002:a17:90b:4a51:b0:1f5:8308:6ed7 with SMTP id lb17-20020a17090b4a5100b001f583086ed7mr7374559pjb.177.1661334132149; Wed, 24 Aug 2022 02:42:12 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Stefan Berger Subject: [PATCH 14/51] backends/tpm: Exclude headers and macros that don't exist on win32 Date: Wed, 24 Aug 2022 17:39:52 +0800 Message-Id: <20220824094029.1634519-15-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x635.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661336820339100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng These headers and macros do not exist on Windows. Exclude them. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Berger --- backends/tpm/tpm_ioctl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h index bd6c12cb86..d67bf0283b 100644 --- a/backends/tpm/tpm_ioctl.h +++ b/backends/tpm/tpm_ioctl.h @@ -9,8 +9,10 @@ #ifndef TPM_IOCTL_H #define TPM_IOCTL_H =20 +#ifndef _WIN32 #include #include +#endif =20 #ifdef HAVE_SYS_IOCCOM_H #include @@ -222,6 +224,7 @@ typedef struct ptm_setbuffersize ptm_setbuffersize; #define PTM_CAP_SET_DATAFD (1 << 12) #define PTM_CAP_SET_BUFFERSIZE (1 << 13) =20 +#ifndef _WIN32 enum { PTM_GET_CAPABILITY =3D _IOR('P', 0, ptm_cap), PTM_INIT =3D _IOWR('P', 1, ptm_init), @@ -241,6 +244,7 @@ enum { PTM_SET_DATAFD =3D _IOR('P', 15, ptm_res), PTM_SET_BUFFERSIZE =3D _IOWR('P', 16, ptm_setbuffersize), }; +#endif =20 /* * Commands used by the non-CUSE TPMs --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661335297; cv=none; d=zohomail.com; s=zohoarc; b=igtNIkPiacZwRi9l1AQErPTYZgMOQ7l61eGms+0LZOFKcSTqYqRSvPn2+t/DmjW2y4umKdMzaCqL8yi7X7OB1L1UJgz+8gIh9dSh0bZIYVZQWReTyFWg5EW/u9RgwEEAf4a9bK/RUv6PkuCdtHfAozS1GbWTDVnxeuLUh/otYjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661335297; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hgOj9FjN0Z4iHtZUWCA3zZlRYozZrWgeApjdLVSDtro=; b=PNdJGSXBgPw9ctyhZOpNIt6K3W8zIm1vnDFC7bU9VL1ACQtxeL9FYahK62WSovGCdFm/Mu/+dGliz/NJ07H84N9fIu1qTCnV+P3uSQIYSxNKJeXQmrDpdkM8mvnNUHRETeq73zu5SZxv6jXarWcbABRVFE1HDHYtEIav9bZ4Skk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661335297338688.2435978663083; Wed, 24 Aug 2022 03:01:37 -0700 (PDT) Received: from localhost ([::1]:35042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnCZ-0004ss-57 for importer@patchew.org; Wed, 24 Aug 2022 06:01:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmtt-00033f-E3 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:19 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:40744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmtr-0001Y0-SW for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:17 -0400 Received: by mail-pj1-x1034.google.com with SMTP id t11-20020a17090a510b00b001fac77e9d1fso999675pjh.5 for ; Wed, 24 Aug 2022 02:42:15 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=hgOj9FjN0Z4iHtZUWCA3zZlRYozZrWgeApjdLVSDtro=; b=Hs3oV/eG9UUNQsyok72N5M4Xj5fnLk9ESMEmuiII03ti3QEg9QQe7tDAPnpN7FsIv6 PuLMW/sbLNua8LfW0p4hVWGbhngxkw/7AcLPBwEp01RUKfwabF4AhrtTzJLiz9wcw+37 iSuBZV3GQ+1nz6JlLO8YOPR+e7oze770qgQ1PKeykiBI5XURyEVs60Z3hwmtom5DYGiQ EOu0iTraXg9pazVJCTq+o6jLC6d6MN8RXLxNZd8rCcRbus3KKe0VKHav6LNNLmWTraum KR8qagi83zbkG9Wt7k1JlmfUFKZmj0IjGTTeCCahEmabSl2UigNHw48sqbN/4XC5sJY6 4IVg== 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; bh=hgOj9FjN0Z4iHtZUWCA3zZlRYozZrWgeApjdLVSDtro=; b=dDakH25aBtta/IIMH5gn1AywuiYW1mumpMknA8+IDw2cEvIhr5uOSbP117otNO5elQ l6inslchnGDbzdFKrw6d/wJ0griCWZ3JTZ2gHmZ0kF+GeRJPPMHwK7SKepFtlTq5DCmw oy0H0dm9fMHmiHDsvvRJNiUSy6sOxdqIDEl0xpx6jhEPlrvJv8il3gD7nEuoMZsnAzVq C9/dVsbiW3Z1+P6yfU1L1rP6Rmj1cays+4jEhnvER54bPwrVaU1qt3BaN7OuU6nI8xXA 7g+Wvss0vFcQVDsP3egozR31GCwy1uCLmp+E8GlbyqEfvZJtZAS07gB9HuxqJoDqWunp x+KA== X-Gm-Message-State: ACgBeo2w0YJE8v3nL1S32cEsxP1HpUCgW6nRB1UUx+9RXDEWMf47hDiy YuZyvryJPvAN5pV8QKlAKeoLPju4o1Y= X-Google-Smtp-Source: AA6agR613Q0tucCxEj4eWjptogZOl/Ts5u43bz7w9ldVLr0zFr5XDG936ObpcvmxJezpG0aLJcJFPg== X-Received: by 2002:a17:90a:6b0d:b0:1fa:c6fe:db6 with SMTP id v13-20020a17090a6b0d00b001fac6fe0db6mr7428055pjj.99.1661334134386; Wed, 24 Aug 2022 02:42:14 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 15/51] tests/qtest: Adapt {m48t59,rtc}-test cases for win32 Date: Wed, 24 Aug 2022 17:39:53 +0800 Message-Id: <20220824094029.1634519-16-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x1034.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661335297898100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng There is no tm_gmtoff member in 'struct tm' on Windows. Update rtc-test.c and m48t59-test.c accordingly. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- tests/qtest/m48t59-test.c | 2 +- tests/qtest/rtc-test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/m48t59-test.c b/tests/qtest/m48t59-test.c index b94a1230f7..843d2ced8e 100644 --- a/tests/qtest/m48t59-test.c +++ b/tests/qtest/m48t59-test.c @@ -137,7 +137,7 @@ static void cmos_get_date_time(QTestState *s, struct tm= *date) date->tm_mday =3D mday; date->tm_mon =3D mon - 1; date->tm_year =3D base_year + year - 1900; -#ifndef __sun__ +#if !defined(__sun__) && !defined(_WIN32) date->tm_gmtoff =3D 0; #endif =20 diff --git a/tests/qtest/rtc-test.c b/tests/qtest/rtc-test.c index 8126ab1bdb..02ed4e1238 100644 --- a/tests/qtest/rtc-test.c +++ b/tests/qtest/rtc-test.c @@ -111,7 +111,7 @@ static void cmos_get_date_time(struct tm *date) date->tm_mday =3D mday; date->tm_mon =3D mon - 1; date->tm_year =3D base_year + year - 1900; -#ifndef __sun__ +#if !defined(__sun__) && !defined(_WIN32) date->tm_gmtoff =3D 0; #endif =20 --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661335646; cv=none; d=zohomail.com; s=zohoarc; b=iE/Kb+cOXRMDpw9h8jCOOPLALbXmW3mGwStiv2cZpVtaTa66O0x/JxaIvGncw7ronNPmdd0jDxaOhLtponclV5fgV2aJUc1wWtNyWw7u12VpFlDBSMhnmdWVxs1kWpt4IMEYRyq5QMEAIbP5v/FE0iGcl+OJNJDj4ozoDAaD//s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661335646; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=I101fY0zL7gfjmjMvi0/DEXFe1fki2ZjtkZJncbRgy4=; b=FTU17nu1K2cOBHEIOLbgbBO8nvUQDYOfnz7gDL9G3JZSW+6ky7Z+p4VwPMb4N8Rf3iHyjWwbDXDKTpbnEON9Nxz7BDgQ7Ma2AoQr3daTEUtiDDOj1NkvgMOSwS3daBc4ApzEEbvJOrZa+SzIkJiOM7ZJFzE7s443sFQ4an1Ky04= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661335646480361.45846444489644; Wed, 24 Aug 2022 03:07:26 -0700 (PDT) Received: from localhost ([::1]:33092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnIA-0002mD-VM for importer@patchew.org; Wed, 24 Aug 2022 06:07:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmtu-00033q-Rm for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:19 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:34553) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmtt-0001Xc-At for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:18 -0400 Received: by mail-pl1-x635.google.com with SMTP id io24so1898254plb.1 for ; Wed, 24 Aug 2022 02:42:16 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=I101fY0zL7gfjmjMvi0/DEXFe1fki2ZjtkZJncbRgy4=; b=aX2TUiM6ZvCN6gi+QHlW0SMzkdq6x3JWRI51+KGX0SorWyt9KF/VA5AJbFAnODK8Oq KI2IJPTdwu1J0hVuV18B0ZVlXULMPP4Zq6//HlaOH6+3ET4MTK2vgauIoiS30IGatYxA jmOAsh0tEXNi+zcSdIOOfMT7dLahpZicQUMFmHsyqEAxGQWjo//Ou6EuZZhOJeeFxUZb N3IzsoKWR5yxHiuXc8a/2i+gJh7MphnfhatP7/v/nICCGWVF2wMYo5XOoA4FXE76xUm8 TOpPK7ty4P6Gd6cDsyzsNY6kHRei3r3PmVvDjXkHhYXD52//M5TT4gEgmJO4VySOkOEs 588A== 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; bh=I101fY0zL7gfjmjMvi0/DEXFe1fki2ZjtkZJncbRgy4=; b=EaVQYGXBNW4AnrzIX+j632Vl2ZAc/GcmKoGeHGpfYoj02HuHxE87a1ZPA6NQ9Zq8Sc EOy89uPG7I135zZyBUQvi1UP8JRa6wSK74XALad4/JDN11Oq95e7w8EGi9svx7ex7gFO zkqtyfQD1useV7yG1buDolTu2DSpkEVb3x5WGd8d+whtGEffEK5bzoO7AXI9SQetV3TI h0Fh+ttyBcxWKJ+GZtqU9RxzMKuToMWSekQcvvQPM404I2ABISTAFC+OpaeQNj2mu7E8 28qcAmRT1KKKrD1iOGF4EuHvBcGXX2i3SuZ+MIJx+IpI9gOMIn92vXjGfz+uz9+VS7M0 Y0Ag== X-Gm-Message-State: ACgBeo1MWifLEAjwVr/FK/VjEOkHTXITAonsa6VXGXpfvTrI7E0F3nG1 GAlOMr/XiD4GTU5YtXUlPvKDsfrkp5k= X-Google-Smtp-Source: AA6agR7S6SmhP2v1S0VLmCZGnwWF8Moc0TZj0F7jbXTzZ8fHjZ2FE4nv1bHR5hJ7bKZYPP0ny5VhzA== X-Received: by 2002:a17:903:2450:b0:173:9fe:70e5 with SMTP id l16-20020a170903245000b0017309fe70e5mr4859801pls.148.1661334136437; Wed, 24 Aug 2022 02:42:16 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 16/51] tests/qtest: Build e1000e-test for posix only Date: Wed, 24 Aug 2022 17:39:54 +0800 Message-Id: <20220824094029.1634519-17-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x635.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661335648029100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng The whole e1000e-test test case relies on socketpair() which does not exist on win32. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- tests/qtest/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index be4b30dea2..9d0f82bf1c 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -239,7 +239,6 @@ qos_test_ss.add( 'adm1272-test.c', 'ds1338-test.c', 'e1000-test.c', - 'e1000e-test.c', 'eepro100-test.c', 'es1370-test.c', 'ipoctal232-test.c', @@ -267,6 +266,9 @@ qos_test_ss.add( 'virtio-iommu-test.c', 'vmxnet3-test.c', ) +if config_host.has_key('CONFIG_POSIX') + qos_test_ss.add(files('e1000e-test.c')) +endif if have_virtfs qos_test_ss.add(files('virtio-9p-test.c')) endif --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661336898; cv=none; d=zohomail.com; s=zohoarc; b=idCWOvwjKmULyzRVl4FqkZWEPsZo+sp7IN/H4QnsG1dApkY/aBrkcx9gV2ag527DpZUYIyHGjokoBN+pvtpOvV95dCGiKAtxtcsHn+KKCB5zoaU9fAG3VB0jxfnaGjGNEjsd/gAoKYefb6zin9pWoLfpJbZUc/G49Sr5h7oXoPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661336898; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vUeT/wlv8A0+FPAxIWhpLkds8vbnKER1tCflKpvf5G8=; b=SU+9ap0DGwgnldZxwkdUHaq9oKFY9Lg1LQn6Q6knVr1KHoro5xXVx40hyGOSIlrV+kwQdV07rLTsMWvQlgAP5m5q3/RGpBYBYMrRMKXOQYF9GiqXN/lAY4wnt110Mzg1HS+1J6Qcu1MJDf9FBZpnC1Gqj0QXck0QHTcqSR5iFIo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336898021103.49371946040253; Wed, 24 Aug 2022 03:28:18 -0700 (PDT) Received: from localhost ([::1]:55480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQncP-0006ZC-1i for importer@patchew.org; Wed, 24 Aug 2022 06:28:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmtx-000368-75 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:21 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:46997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmtv-0001Wm-IV for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:20 -0400 Received: by mail-pj1-x102f.google.com with SMTP id o14-20020a17090a0a0e00b001fabfd3369cso945030pjo.5 for ; Wed, 24 Aug 2022 02:42:19 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=vUeT/wlv8A0+FPAxIWhpLkds8vbnKER1tCflKpvf5G8=; b=PzRlwJvazkZj7n12AdnMyBlG7ks/Us4ip1yPTEujxhiiE5Aow3Nm1peAUmyG4GqjGp N4SfZ6v+haLM8Tk19j6rYZXOs892pk/yL7eGyXBRUs9X1XiTlo+JlJB8ODtOhY8tsejz jekGTi0w82h9M4iMcLRBkIbHEemCOp9lhuL1ZcknFZAkNk9o/MaRncpC/lNqQuRI4ZoA pT6I1cN0peG2GcxHHZjH8Shrjap+KWQxTFA2agA1WFSUsG44WMVnMt8WftzlkMaGXYbW m0WQ9k5FW0vyrcf6//QeagDypiRznPvbeaaqlBy/kGTCKSy7d0URYWPhFgr/GBoiXw/5 kEWg== 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; bh=vUeT/wlv8A0+FPAxIWhpLkds8vbnKER1tCflKpvf5G8=; b=12woY32CJ15ibXlyY19WHEJ2bUAALWXdz5WAimIzIOLcDgWx3TDBGSocsTddn3j7J6 aFD7K96JAe2BwE0+W+hpuVUTK+6beZOrQU5dB1x3IjJY3qFVGWQ3dHYHEMZFnGKvo2Dr ccQ78SrZ63lxmLrUUApRqo8O711MCtFOrIYl1yQFGgyHMQzuuicPZWUH+jT68OzMzsBp HbjSAsICtAfZlmmaTM5gAKrgx5Ce1j2Kh+uOjJlLsn6gjjQMHgWigom03BoNkm6K8Nkx 3OF5ctxA+COHhgcOGJ6WESpjv34x5BLeqG3o7Vxfnh06gfQWfwQf/gsDONmNBW1yNofs AVrQ== X-Gm-Message-State: ACgBeo06y8CHVB1Cm4XX/02AckdQvkBButC83Kc+ipU9hsY/yuUc7gUB rAKcZARKo5s84SarwCj+qtoJay2Cmak= X-Google-Smtp-Source: AA6agR6WXSxdG5oVI2obxQdYSftfWrLhPr2fpJtSaHZf6l3g0vJutOD/Iq2EgIbEEZkNc27ddnNaTg== X-Received: by 2002:a17:902:f542:b0:173:a8a:d7bf with SMTP id h2-20020a170902f54200b001730a8ad7bfmr4806063plf.134.1661334138698; Wed, 24 Aug 2022 02:42:18 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Jason Wang , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 17/51] tests/qtest: Build virtio-net-test for posix only Date: Wed, 24 Aug 2022 17:39:55 +0800 Message-Id: <20220824094029.1634519-18-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x102f.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661336898551100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng All of the virtio-net-test test cases require socketpair() to do the test setup. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/virtio-net-test.c | 6 ------ tests/qtest/meson.build | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/qtest/virtio-net-test.c b/tests/qtest/virtio-net-test.c index 6ded252901..d44c3d9666 100644 --- a/tests/qtest/virtio-net-test.c +++ b/tests/qtest/virtio-net-test.c @@ -26,8 +26,6 @@ #define QVIRTIO_NET_TIMEOUT_US (30 * 1000 * 1000) #define VNET_HDR_SIZE sizeof(struct virtio_net_hdr_mrg_rxbuf) =20 -#ifndef _WIN32 - static void rx_test(QVirtioDevice *dev, QGuestAllocator *alloc, QVirtQueue *vq, int socket) @@ -165,8 +163,6 @@ static void stop_cont_test(void *obj, void *data, QGues= tAllocator *t_alloc) rx_stop_cont_test(dev, t_alloc, rx, sv[0]); } =20 -#endif - static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc) { QVirtioPCIDevice *dev =3D obj; @@ -324,10 +320,8 @@ static void register_virtio_net_test(void) }; =20 qos_add_test("hotplug", "virtio-net-pci", hotplug, &opts); -#ifndef _WIN32 qos_add_test("basic", "virtio-net", send_recv_test, &opts); qos_add_test("rx_stop_cont", "virtio-net", stop_cont_test, &opts); -#endif qos_add_test("announce-self", "virtio-net", announce_self, &opts); =20 /* These tests do not need a loopback backend. */ diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 9d0f82bf1c..72bb9e21f3 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -259,7 +259,6 @@ qos_test_ss.add( 'usb-hcd-ohci-test.c', 'virtio-test.c', 'virtio-blk-test.c', - 'virtio-net-test.c', 'virtio-rng-test.c', 'virtio-scsi-test.c', 'virtio-serial-test.c', @@ -267,7 +266,7 @@ qos_test_ss.add( 'vmxnet3-test.c', ) if config_host.has_key('CONFIG_POSIX') - qos_test_ss.add(files('e1000e-test.c')) + qos_test_ss.add(files('e1000e-test.c', 'virtio-net-test.c')) endif if have_virtfs qos_test_ss.add(files('virtio-9p-test.c')) --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661335308; cv=none; d=zohomail.com; s=zohoarc; b=XSybgvbjBjUCAJot5FGrvcB8T8zcPkQIM72R5oR4WpDt3P7Dhm6k4gIKjeX2LLvedFULy0EiegW2qMUfxXZuuqNLZG/fbuSGj/94PLzur/mh5fYMCeuVfMzCCRFXuGuZvnsn056mo7EM+6K2uxiddt0K3mNHd0cVDSAcDxz5ClE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661335308; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=egPBjLFOzH2BItTwAJOAYvxF5nntobkrM7llqKrjcSw=; b=RqLey1wS+ef12K5OA+DrtV3Hzv93EjLCR67lNa6UqJq3eBumjCqqPJ3/D2zfWW2dbMeAoddxmKI/Acj+xPUIS8RrlojtTCW+BC340isYqWd5vLqzuBJFa99pIbrRT7jYSvcQmoREwreTPvriPhcDHSihXtkYjvw9kCUXjrSq0jU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661335308517268.6412266295158; Wed, 24 Aug 2022 03:01:48 -0700 (PDT) Received: from localhost ([::1]:60524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnCl-00059Y-Bh for importer@patchew.org; Wed, 24 Aug 2022 06:01:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmu0-0003Gk-TW for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:24 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:33627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmtz-0001Ys-3P for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:24 -0400 Received: by mail-pl1-x62d.google.com with SMTP id 2so15220372pll.0 for ; Wed, 24 Aug 2022 02:42:22 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=egPBjLFOzH2BItTwAJOAYvxF5nntobkrM7llqKrjcSw=; b=qsjs9EA6ub7htysYKqy/NANvhT3OwOgQ59U4XURNx2QZzpERT8m5LN+HWxWMDU3H/F RVoi3EI/eZsgq5SGtHg4m4AtzB8aEggXXg6weuhAths1lF47Lm6ax/Mq3ywWEG7asgXg +BC7hccB26Uwwqv6f5SM8cxFqyHahDiLsQhMnzI3PgLw8K7qq9/xOnmp56sr3QCtoME8 OwA2jL5FvceL2XzQD2Eb0vKUwOvem0LTJyQDHkl1XzOMJE9f29tHugyS6emiN/n1CQ53 XTPxYjr42aK/3/DwJlDw1vcfaolTyILgJN1R3S1n/ZA3+/Sq61Qou2lL0KhfwRZIKPmp O7Cg== 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; bh=egPBjLFOzH2BItTwAJOAYvxF5nntobkrM7llqKrjcSw=; b=g7Iseaq5/aujHfUhX9qEQMXUbMznYDZ+upmBpFTFVe25MKLuKHxC1TO2o8aMQ/Cji+ t1xgo831Oqum04LvahlUeLHk29PAPfwcIMnj9y9eB+KQBd+xqgDcJMcyh+8xjDOQtL97 IgpEcDZyw77PNHwQmnjjtGbiTyJXqxCxSM5wPB8DAatVw4WkEqf7XDaouP2OubALRCM8 HYgqeb6Khv92z2z5Zr1H32Kv5daQvC/+EfARm71zRkji83Y2gCWVjH7D6P8/L0U8VAoF ktI719nsyQbd2wdiiXrloCVKFfcR9jiJdQfp+zm7OA663qYzFcMjMulYAzHfEf6ImOy7 WKqA== X-Gm-Message-State: ACgBeo3txPtTA4CTux673hcxOC3E2QGSXibl07M9WJdUarjQL+l1bPKo mdG1o72lPWzEfni1MfMl3qCuSA8Dx/o= X-Google-Smtp-Source: AA6agR6z5b2+kRc4XbBwlBXAV222dfFFZjXEltEwrHIgx29Wa2A3eKmmZIax1+OleQzltVijzWRYTw== X-Received: by 2002:a17:90b:3b8a:b0:1f5:1df2:1fff with SMTP id pc10-20020a17090b3b8a00b001f51df21fffmr7554690pjb.169.1661334141453; Wed, 24 Aug 2022 02:42:21 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Ani Sinha , Igor Mammedov , Laurent Vivier , "Michael S. Tsirkin" , Paolo Bonzini , Thomas Huth Subject: [PATCH 18/51] tests/qtest: Build cases that use memory-backend-file for posix only Date: Wed, 24 Aug 2022 17:39:56 +0800 Message-Id: <20220824094029.1634519-19-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x62d.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661335309918100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng As backends/meson.build tells us, hostmem-file.c is only supported on POSIX platforms, hence any test case that utilizes the memory backend file should be guarded by CONFIG_POSIX too. Signed-off-by: Bin Meng Acked-by: Thomas Huth --- tests/qtest/bios-tables-test.c | 10 ++++++++++ tests/qtest/cxl-test.c | 4 ++++ tests/qtest/meson.build | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 7c5f736b51..36783966b0 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1461,6 +1461,7 @@ static void test_acpi_piix4_tcg_acpi_hmat(void) test_acpi_tcg_acpi_hmat(MACHINE_PC); } =20 +#ifdef CONFIG_POSIX static void test_acpi_erst(const char *machine) { gchar *tmp_path =3D g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL); @@ -1511,6 +1512,7 @@ static void test_acpi_microvm_acpi_erst(void) g_free(tmp_path); free_test_data(&data); } +#endif /* CONFIG_POSIX */ =20 static void test_acpi_virt_tcg(void) { @@ -1551,6 +1553,7 @@ static void test_acpi_q35_viot(void) free_test_data(&data); } =20 +#ifdef CONFIG_POSIX static void test_acpi_q35_cxl(void) { gchar *tmp_path =3D g_dir_make_tmp("qemu-test-cxl.XXXXXX", NULL); @@ -1593,6 +1596,7 @@ static void test_acpi_q35_cxl(void) g_free(tmp_path); free_test_data(&data); } +#endif /* CONFIG_POSIX */ =20 static void test_acpi_virt_viot(void) { @@ -1805,8 +1809,10 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm); qtest_add_func("acpi/piix4/acpihmat", test_acpi_piix4_tcg_acpi_hma= t); qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat); +#ifdef CONFIG_POSIX qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_acpi_erst); qtest_add_func("acpi/q35/acpierst", test_acpi_q35_acpi_erst); +#endif qtest_add_func("acpi/q35/applesmc", test_acpi_q35_applesmc); qtest_add_func("acpi/q35/pvpanic-isa", test_acpi_q35_pvpanic_isa); qtest_add_func("acpi/microvm", test_acpi_microvm_tcg); @@ -1818,7 +1824,9 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/ivrs", test_acpi_q35_tcg_ivrs); if (strcmp(arch, "x86_64") =3D=3D 0) { qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie= _tcg); +#ifdef CONFIG_POSIX qtest_add_func("acpi/microvm/acpierst", test_acpi_microvm_= acpi_erst); +#endif } } if (has_kvm) { @@ -1826,7 +1834,9 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar); } qtest_add_func("acpi/q35/viot", test_acpi_q35_viot); +#ifdef CONFIG_POSIX qtest_add_func("acpi/q35/cxl", test_acpi_q35_cxl); +#endif qtest_add_func("acpi/q35/slic", test_acpi_q35_slic); } else if (strcmp(arch, "aarch64") =3D=3D 0) { if (has_tcg) { diff --git a/tests/qtest/cxl-test.c b/tests/qtest/cxl-test.c index b3733cdb5f..4b4e7e5088 100644 --- a/tests/qtest/cxl-test.c +++ b/tests/qtest/cxl-test.c @@ -89,6 +89,7 @@ static void cxl_2root_port(void) qtest_end(); } =20 +#ifdef CONFIG_POSIX static void cxl_t3d(void) { g_autoptr(GString) cmdline =3D g_string_new(NULL); @@ -136,6 +137,7 @@ static void cxl_2pxb_4rp_4t3d(void) qtest_start(cmdline->str); qtest_end(); } +#endif /* CONFIG_POSIX */ =20 int main(int argc, char **argv) { @@ -147,8 +149,10 @@ int main(int argc, char **argv) qtest_add_func("/pci/cxl/pxb_x2_with_window", cxl_2pxb_with_window); qtest_add_func("/pci/cxl/rp", cxl_root_port); qtest_add_func("/pci/cxl/rp_x2", cxl_2root_port); +#ifdef CONFIG_POSIX qtest_add_func("/pci/cxl/type3_device", cxl_t3d); qtest_add_func("/pci/cxl/rp_x2_type3_x2", cxl_1pxb_2rp_2t3d); qtest_add_func("/pci/cxl/pxb_x2_root_port_x4_type3_x4", cxl_2pxb_4rp_4= t3d); +#endif return g_test_run(); } diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 72bb9e21f3..9e484e60ba 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -71,7 +71,8 @@ qtests_i386 =3D \ (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + = \ (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] := []) + \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) = + \ - (config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + = \ + (config_host.has_key('CONFIG_POSIX') and = \ + config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + = \ (config_all_devices.has_key('CONFIG_VIRTIO_NET') and = \ config_all_devices.has_key('CONFIG_Q35') and = \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and = \ --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336004346736.0530122984558; Wed, 24 Aug 2022 03:13:24 -0700 (PDT) Received: from localhost ([::1]:52654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnNz-0000Kt-9b for importer@patchew.org; Wed, 24 Aug 2022 06:13:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmu3-0003Nc-1U for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:27 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:51133) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmu1-0001Yy-8n for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:26 -0400 Received: by mail-pj1-x102b.google.com with SMTP id g18so16539640pju.0 for ; Wed, 24 Aug 2022 02:42:24 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=5lVamr0P85d3jCGn5N3zgxP8+z+BcFBCgzNisZd7pVc=; b=EwftjWsxSFoONCsCgawmZBUtodhh88DibzYCIpi5E4w6fFyKxGuj5MvWzQhMjYpH6N pEfXJLFpuMje4BinTZcSVOotlwptzY+Nq3K8bUiGu0743uJBBGWPn/ltiFkF4QxiCqHS kSQDKoyHENoid5f0+DpgHbdVHzcWS9hm/GG89/2d9YBdWbeeq0FtT4NfTsavLgOhzcPP rtPa6zyg6/vOmo32qLiF6FO/KxmLs4xdE3bxvi3uNjQnEYBusJrCgqAKACNsplKE6pJd 6kJnpY9qNcfyVH6NO/gH3ksjeLu39ppHmme5qxBs1DSfsQPq5fQATEdlDriiF5xQtZF1 gMoA== 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; bh=5lVamr0P85d3jCGn5N3zgxP8+z+BcFBCgzNisZd7pVc=; b=BwKVKOxKsQedrZy73uiq/CkJ7yKW5Yi6fcYlTK7n6zU5hJjXbwE1YtdlsRa6jU20j4 bTL5BSfidfD+Pc3BKHrR8CFWpQtf+dXsblQSWdvHN10oYARnq+G+12lUkGaZAjJcnjcf fZuXV/o4FUq+rbN0IxvN/PjTtVK++1E7pd3OU0RTVtSSVQzAxYswn6KgeJ8zktmSXwzG KWgBVwoYkb+xykaSvJLUYGnhoaGsQ15jm/36d1+78Z2rmvYj6xmXVX9qndfKLEny6oRG VzaUpkxQDKrqZG6qHL18kSGZ4OcdRBDpSgrHNrvYtKwD4RrIKps3mmnyIZX50DDioIVv TGoQ== X-Gm-Message-State: ACgBeo3QpOcJNFZ7ySjd3dQQ0YCrw233p2pftUyNCvFgAjWiOKcqZ23B N2l1ivy4SExv7km8o1TzeZMawzyitnw= X-Google-Smtp-Source: AA6agR5RBHhXC1wjezFv+dNPzH4vOPdvLLIgW5x6dveS9GcLAZM98WB4VYKZ5tFiZy75v9XSsD47cg== X-Received: by 2002:a17:90a:f0c9:b0:1fa:e017:7d13 with SMTP id fa9-20020a17090af0c900b001fae0177d13mr7491493pjb.128.1661334143559; Wed, 24 Aug 2022 02:42:23 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 19/51] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only Date: Wed, 24 Aug 2022 17:39:57 +0800 Message-Id: <20220824094029.1634519-20-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x102b.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1661336006327100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng The test-filter-{mirror,redirector} cases use socketpair() API that is only available on POSIX and should only be built for POSIX. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/meson.build | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 9e484e60ba..c97da5a062 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -42,6 +42,7 @@ qtests_cxl =3D \ qtests_i386 =3D \ (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \ (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + = \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) = + \ (have_tools ? ['ahci-test'] : []) + = \ (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] = : []) + \ (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) += \ @@ -95,8 +96,7 @@ qtests_i386 =3D \ 'vmgenid-test', 'migration-test', 'test-x86-cpuid-compat', - 'numa-test', - 'test-filter-redirector' + 'numa-test' ] =20 if dbus_display @@ -120,29 +120,34 @@ endif qtests_x86_64 =3D qtests_i386 =20 qtests_alpha =3D ['boot-serial-test'] + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + = \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) = + \ (slirp.found() ? ['test-netfilter'] : []) + \ (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) =20 qtests_avr =3D [ 'boot-serial-test' ] =20 qtests_hppa =3D ['boot-serial-test'] + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + = \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) = + \ (slirp.found() ? ['test-netfilter'] : []) + \ (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) =20 qtests_m68k =3D ['boot-serial-test'] + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + = \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) = + \ (slirp.found() ? ['test-netfilter'] : []) =20 qtests_microblaze =3D ['boot-serial-test'] + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + = \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) = + \ (slirp.found() ? ['test-netfilter'] : []) =20 qtests_microblazeel =3D qtests_microblaze =20 qtests_mips =3D \ - ['test-filter-mirror', 'test-filter-redirector'] + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + = \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) = + \ (slirp.found() ? ['test-netfilter'] : []) + \ (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] = : []) + \ (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) @@ -152,7 +157,8 @@ qtests_mips64 =3D qtests_mips qtests_mips64el =3D qtests_mips =20 qtests_ppc =3D \ - ['test-filter-mirror', 'test-filter-redirector'] + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + = \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) = + \ (slirp.found() ? ['test-netfilter'] : []) + \ (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] = : []) + \ (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + = \ @@ -174,13 +180,15 @@ qtests_sh4 =3D (config_all_devices.has_key('CONFIG_IS= A_TESTDEV') ? ['endianness-te qtests_sh4eb =3D (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['end= ianness-test'] : []) =20 qtests_sparc =3D ['prom-env-test', 'm48t59-test', 'boot-serial-test'] + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + = \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) = + \ (slirp.found() ? ['test-netfilter'] : []) =20 qtests_sparc64 =3D \ (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] = : []) + \ (slirp.found() ? ['test-netfilter'] : []) + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + = \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) = + \ ['prom-env-test', 'boot-serial-test'] =20 qtests_npcm7xx =3D \ --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336358545350.3157418108781; Wed, 24 Aug 2022 03:19:18 -0700 (PDT) Received: from localhost ([::1]:40498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnTh-000659-4h for importer@patchew.org; Wed, 24 Aug 2022 06:19:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmu5-0003S2-Ny for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:29 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:52737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmu3-0001Z8-8T for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:28 -0400 Received: by mail-pj1-x102e.google.com with SMTP id f21so16511204pjt.2 for ; Wed, 24 Aug 2022 02:42:26 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=o/vNmGGWktBgN2DDen09I7Im1S9JADF0xZI5Ri8LXOA=; b=JfPa2gw0RpTDfNi7CXk9AiSRSEHycE2Ui2elHgCAASoH2CTOVeekl8r9bI5oSFSRBU rqYu6Ax/COVtVZPStLKuY2lIQsej574khAyJPGw5LyIswH2I63DXSADPdcblNEM7+UVd 1si3fTa1j9UY5gZzkBeBE3G5uJ6O9/c9NEpwfy6xXPrwi+9t8HZWGbUGUNBz7QK4Syzk 1FGal5INJKP6i0S9YGJhHwvZxsoNIUv2V7bjrdUgnSEHHTdVU7l13Hz9crYsyp44JozI DDEh3CYva3WkEBwicPtzBp6T0uZ7U5VFthBMc66NzRzYv2ODmkN4ogjf6S2QiTMkprh3 6WBQ== 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; bh=o/vNmGGWktBgN2DDen09I7Im1S9JADF0xZI5Ri8LXOA=; b=MjxFIXcEVeOow4VP1Wi6Ky5Gsp4kH/Yr+6SXpBHBYxa+saZRgjwkHGaCuj7Z3WTFHV QAMJWo1VxAl8N9zFJeIs1psjII5w4s2HkvY+T6oAMa3i8kjEWrcyu6ztPIKUKcnRjrTW BlXvjO2m1lG6aIdMXWN5XXqnKA7jefZevff9FgRT+6Xo2d6O/SVSTaJe61bBMhTYqKo+ WdQSJsPoDjrKat5S0TsjKq/dvEEmPbt1r+XvUW1+74OuRzb7zGRkukl9LX4YqV9pFZMY tW7rBbKoDbvltTjZH3bNbt+4KkD/xIYeDoJWzxgEsYjG3oGF9dnK2u/B7Toc0BG6VQey 598Q== X-Gm-Message-State: ACgBeo1RVrBYOOgejdqYXZul9UoNuYaPL2rW93pMFj3PBJtANrJaO3Dk bgGW9XQ5lj0h55uYB20Nn2PGWASgbLw= X-Google-Smtp-Source: AA6agR5A9QOVfTfpygKeicp+08FdUArPB+j5VWE9g6tmMVc+3a4NsMPnxvbnHoYGNAYAkgbt2n3p4A== X-Received: by 2002:a17:902:ab8d:b0:172:9382:4d1e with SMTP id f13-20020a170902ab8d00b0017293824d1emr27914872plr.133.1661334145658; Wed, 24 Aug 2022 02:42:25 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 20/51] tests/qtest: i440fx-test: Skip running request_{bios, pflash} for win32 Date: Wed, 24 Aug 2022 17:39:58 +0800 Message-Id: <20220824094029.1634519-21-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x102e.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1661336359850100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng The request_{bios,pflash} test cases call mmap() which does not exist on win32. Exclude them. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- tests/qtest/i440fx-test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/qtest/i440fx-test.c b/tests/qtest/i440fx-test.c index 6d7d4d8d8f..3890f1237c 100644 --- a/tests/qtest/i440fx-test.c +++ b/tests/qtest/i440fx-test.c @@ -278,6 +278,8 @@ static void test_i440fx_pam(gconstpointer opaque) qtest_end(); } =20 +#ifndef _WIN32 + #define BLOB_SIZE ((size_t)65536) #define ISA_BIOS_MAXSZ ((size_t)(128 * 1024)) =20 @@ -396,6 +398,8 @@ static void request_pflash(FirmwareTestFixture *fixture, fixture->is_bios =3D false; } =20 +#endif /* _WIN32 */ + int main(int argc, char **argv) { TestData data; @@ -406,8 +410,10 @@ int main(int argc, char **argv) =20 qtest_add_data_func("i440fx/defaults", &data, test_i440fx_defaults); qtest_add_data_func("i440fx/pam", &data, test_i440fx_pam); +#ifndef _WIN32 add_firmware_test("i440fx/firmware/bios", request_bios); add_firmware_test("i440fx/firmware/pflash", request_pflash); +#endif =20 return g_test_run(); } --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661337294; cv=none; d=zohomail.com; s=zohoarc; b=oKjQhd8UInN/CgKUkDpJOCdiBCtKiuFOGLFABmvplTkrvAlVFupiFFxxmpWxNl0en3nkwf8bnBhmoyzdCSBSbaePeS8BNcR0YEhhJXUzwv2CPTLCk3t+XIo15ebYFCraJlwqixEZ2HGz45t1u7OY9w+iwZ+2mYOKogdOXys4PJU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661337294; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Q1LOr75ldxNy4JPk8mGR6OHZijSnHEDxgtXAj7RfZ6w=; b=O5NmNE/umasYIX8tREOOnshpOdcEJsaQ993F+Z8tlb/WEamPnJMcvWIQJpOB7uwc6EBhzUMut2NrWvFJQdyjj2Ii9iij3nrIaaQwWlZc9adgoddeqLUF/7IpLje+WE9I428NHwbcyWkpgkXYweyjem+gyjCVXYVf5TinP/wIZLQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661337294773694.1335667967312; Wed, 24 Aug 2022 03:34:54 -0700 (PDT) Received: from localhost ([::1]:55880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnil-0003BE-PO for importer@patchew.org; Wed, 24 Aug 2022 06:34:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmu7-0003UL-PH for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:31 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:51133) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmu6-0001Yy-0v for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:31 -0400 Received: by mail-pj1-x102b.google.com with SMTP id g18so16539816pju.0 for ; Wed, 24 Aug 2022 02:42:28 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Q1LOr75ldxNy4JPk8mGR6OHZijSnHEDxgtXAj7RfZ6w=; b=Z8jIb21aeRsix3mRDGDGTUEmGiO246Be/3Rh10eg3xB4Z5WMJ+3xpoKubcUfcv+se+ QTmCEnbtqSP2SH6vm4xR3yX6o7NtPbOvxKls7c2j32Q9Xz1aYEzQc1nw4VUcBBEaV+Xs 45+Ycz7mQE/1Dy41Qghn9PXMi4cTes7oAW1k8FsfKfdfRMGQTkGQoGavWHBmjC8TrSjK j3/yzf8snLFK3lIDMGGlg7X+oXQy6L52soZR0sC5r0TfMgpZGR09k2Bu3VlMiYNfMy+Z pmnEcfNr2JXcnT4B9DVmdLjGVw6DBxXzeIBF8zMOYhsF5t7pJJ5ujK9Gk/Tq+h4wEY5S ta8w== 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; bh=Q1LOr75ldxNy4JPk8mGR6OHZijSnHEDxgtXAj7RfZ6w=; b=KVOribmIIZzeCJQUxd1hK/UuK9Y5lJLV6ObWg1tQxMBNjqwNYhcKEJNFQKWMSHpFz2 KzabOoeXd8fWqtPq1Tqi8emoi9bR75Rr8eBIcGpCVQTLbr29B78R8RpbZW8CLuDTT//5 IzhUOgHKu3Dpgk0LORGbK8KI4FdJpFx8Xh8P8KgKPqrurB0N9TAAvqTUowzrYbsegCOs 2eTCYKOhir0l9TA/CYtkeEBS9asZGvacmPVvnqdFhLTqDJScLc5hEM0uzcRrNkF0SCqm 2FLnj8JAiZJ7ukAQ750gnBPSVttcZPHc3JC/GqVU/MD9TDklCqQ7kNz83odbkQZDujNe wrmg== X-Gm-Message-State: ACgBeo2G+IGO0pMN4z4HJP3OLKoXCiwx4WhQo4cHmJpbpCE8/rK6mCdC WczcIo3Gr8bpcH2ZqYb0yCz9kLjmCVM= X-Google-Smtp-Source: AA6agR7Y0Q3wZwz9P+7kz5MoKZKUgdeceSrbqcZM6ENNrp+jCQDWj3QawsxqA1lWG7SyW2SaLRSmfA== X-Received: by 2002:a17:902:864c:b0:172:bc0d:c769 with SMTP id y12-20020a170902864c00b00172bc0dc769mr25910815plt.146.1661334148133; Wed, 24 Aug 2022 02:42:28 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , "Dr. David Alan Gilbert" , Juan Quintela , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 21/51] tests/qtest: migration-test: Skip running test_migrate_fd_proto on win32 Date: Wed, 24 Aug 2022 17:39:59 +0800 Message-Id: <20220824094029.1634519-22-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x102b.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661337296238100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng The test case 'test_migrate_fd_proto' calls socketpair() which does not exist on win32. Exclude it. The helper function wait_command_fd() is not needed anymore, hence exclude it too. Signed-off-by: Bin Meng Reviewed-by: Dr. David Alan Gilbert --- tests/qtest/migration-helpers.h | 2 ++ tests/qtest/migration-helpers.c | 2 ++ tests/qtest/migration-test.c | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helper= s.h index 59561898d0..db0684de48 100644 --- a/tests/qtest/migration-helpers.h +++ b/tests/qtest/migration-helpers.h @@ -17,8 +17,10 @@ =20 extern bool got_stop; =20 +#ifndef _WIN32 G_GNUC_PRINTF(3, 4) QDict *wait_command_fd(QTestState *who, int fd, const char *command, ...); +#endif =20 G_GNUC_PRINTF(2, 3) QDict *wait_command(QTestState *who, const char *command, ...); diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helper= s.c index c6fbeb3974..f6f3c6680f 100644 --- a/tests/qtest/migration-helpers.c +++ b/tests/qtest/migration-helpers.c @@ -34,6 +34,7 @@ static void check_stop_event(QTestState *who) } } =20 +#ifndef _WIN32 /* * Events can get in the way of responses we are actually waiting for. */ @@ -58,6 +59,7 @@ QDict *wait_command_fd(QTestState *who, int fd, const cha= r *command, ...) =20 return ret; } +#endif =20 /* * Events can get in the way of responses we are actually waiting for. diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index af9250750b..2ae7498d5d 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1629,6 +1629,7 @@ static void test_precopy_tcp_tls_x509_reject_anon_cli= ent(void) #endif /* CONFIG_TASN1 */ #endif /* CONFIG_GNUTLS */ =20 +#ifndef _WIN32 static void *test_migrate_fd_start_hook(QTestState *from, QTestState *to) { @@ -1697,6 +1698,7 @@ static void test_migrate_fd_proto(void) }; test_precopy_common(&args); } +#endif /* _WIN32 */ =20 static void do_test_validate_uuid(MigrateStart *args, bool should_fail) { @@ -2531,7 +2533,9 @@ int main(int argc, char **argv) #endif /* CONFIG_GNUTLS */ =20 /* qtest_add_func("/migration/ignore_shared", test_ignore_shared); */ +#ifndef _WIN32 qtest_add_func("/migration/fd_proto", test_migrate_fd_proto); +#endif qtest_add_func("/migration/validate_uuid", test_validate_uuid); qtest_add_func("/migration/validate_uuid_error", test_validate_uuid_er= ror); qtest_add_func("/migration/validate_uuid_src_not_set", --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661337653; cv=none; d=zohomail.com; s=zohoarc; b=BAzSSxD6Aa8DCtDTmf+lS6qXDHvdhunBhXRDx3tp6HB1M8EpwaOGHOz10IcVWTYL6IqeZr9ACJFW+jY7avnM3xDIITIp/pY2hJMVOeSVKo8foWW1UNzHvDVuUEpWlTCmErGNyXttiNj/Gp/UWHb3O/E3u9L5rRXOx/3PAqxutOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661337653; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/pjgCB/qOD1l65Q+5L6mduAGMNDgz5QBySrXjGl7kz0=; b=YUE8LwSnqfA2KN9wuiCN57a/fmpLOENJGewL3GXv5Dh20sVZTtYRkciACoViULppIkB60NdXYaSLfV8KpYfKvdyAa1nRJR2bj73xfHk4Uv9pVNqwsBw2HCNK3bt53Lb2GIv4MOwd6y5YnFfqOGKcQOZ4A6qZWyfE8Fd3ZuGkFUs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661337653984750.9850364185567; Wed, 24 Aug 2022 03:40:53 -0700 (PDT) Received: from localhost ([::1]:32932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnob-0001BG-08 for importer@patchew.org; Wed, 24 Aug 2022 06:40:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmu9-0003Z4-Bi for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:33 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:34557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmu7-0001Zi-Qi for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:33 -0400 Received: by mail-pj1-x1030.google.com with SMTP id c16-20020a17090aa61000b001fb3286d9f7so3048980pjq.1 for ; Wed, 24 Aug 2022 02:42:31 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=/pjgCB/qOD1l65Q+5L6mduAGMNDgz5QBySrXjGl7kz0=; b=qIw0rgLIhEI4J0m9ccBvOoNw6Kfwgf9lyJZ+qz5FocUdXKJR/WnaPc9N1bgtMucesV 0H/I1EflYtWDiT3jwlWydSuAy+pL5H6FhGcqRhRRWLL9Ovgum+0jOdyYUSl8zy+YZcEn MH7vvHvO/KyKie8WmHRcZFI7dPDb727E2Hs2a4lgP53Z/5mmR9fgsMH7QIBCwoMdtRUi HqXR3AqsPm1yUDPq3GHEBMiYrq/c/oqSOqq1Xv2HNOur1BtXsazuTG/znnnTT7tARyOj +sxeYU1WM01RXgQyyqs7s0gHTU+uQP/Qi3Cy4OsjLXyUaLHL3i5W5qdkOzh8VGzgaC8L dixg== 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; bh=/pjgCB/qOD1l65Q+5L6mduAGMNDgz5QBySrXjGl7kz0=; b=AZkzoXyHAIVQsiIJE9eEy0AGEfxxv6NGZmCoQhxbvtv/QETNyjeVrr3aVtH6ra+u7s hW8CD3nTRI2I41ESsRp+IRVZwtUQja8jitSJTSGKSAcatg9NQ0IzikxdCcBPtCYlEpzq 3AMom9iXQAGjby3D5xNSRTX54LnSNMkJl3G0Wur+T7o6SyZ6LEucWVV+EDebXDa9MFhc GjPFzkZHNR5JM417TM1eGiMAzwnFMgF3gEGXX7zX/InT6W/0RQkddA8OpzsuU8atkxR9 qi+0h4wqEs+KgWKq3FpLxCP8AkXS9JRsZ3ZIKgF5Bh9KxBkbBry0z7kIoZWoJjdjP9S3 1wzw== X-Gm-Message-State: ACgBeo2usxUz08hACsQZROBAtGM9uz60Bc9h0KA2SXHxhv4xh1El4FRp XXaKAsoJ1XAM62bzm37tjw4sRcRmF64= X-Google-Smtp-Source: AA6agR4MrX3OtOxW5UbAff9oJ8SUzKudGTCJJ2mbyQc3D59xdTJDndmYGd/Y3udEtiR3YDvy1I0Z8A== X-Received: by 2002:a17:90a:a097:b0:1fb:5bc:7778 with SMTP id r23-20020a17090aa09700b001fb05bc7778mr7448887pjp.209.1661334150455; Wed, 24 Aug 2022 02:42:30 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Markus Armbruster , Paolo Bonzini , Thomas Huth Subject: [PATCH 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32 Date: Wed, 24 Aug 2022 17:40:00 +0800 Message-Id: <20220824094029.1634519-23-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x1030.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661337655655100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng The test_qmp_oob test case calls mkfifo() which does not exist on win32. Exclude it. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- tests/qtest/qmp-test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c index b950dbafaf..4a165447f8 100644 --- a/tests/qtest/qmp-test.c +++ b/tests/qtest/qmp-test.c @@ -159,6 +159,8 @@ static void test_qmp_protocol(void) qtest_quit(qts); } =20 +#ifndef _WIN32 + /* Out-of-band tests */ =20 char *tmpdir; @@ -279,6 +281,8 @@ static void test_qmp_oob(void) qtest_quit(qts); } =20 +#endif /* _WIN32 */ + /* Preconfig tests */ =20 static void test_qmp_preconfig(void) @@ -338,7 +342,9 @@ int main(int argc, char *argv[]) g_test_init(&argc, &argv, NULL); =20 qtest_add_func("qmp/protocol", test_qmp_protocol); +#ifndef _WIN32 qtest_add_func("qmp/oob", test_qmp_oob); +#endif qtest_add_func("qmp/preconfig", test_qmp_preconfig); qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg); =20 --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661337406; cv=none; d=zohomail.com; s=zohoarc; b=J4HH3nj+B6jFVXJAkTpjoZV7n8f8UV8qc5G7RWJPTwC3Y45cR84oVEgBWT7yyezNzTfEhU2fQBivPyFRzIRDbNyxF6UFBuN/c604OR/D+EFSAcYFS4QmDJuiSj8NiqHQ1GSR/EylLD1D4fwfbVTUT+G/K69hqXB8h0yGnPx0IK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661337406; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hdtxjLMnNVU1rKYleO313NZ7D82NDLkpXwsAYvVj3S0=; b=K7649UkOqxE6YqYzZo6qhMHcQrK2fggOqMiYiP9rVZr899FIH155QczN2Kiwhig2WKiNoTGftMfrQr09SvjyahZupl20nMQ5AuzLiytcGEa4Eh+hJFydthTcTFRkPE3cG1vXwHqpjsGUmLuKhlUdZYipnBMqBr8O43QeJhd9ZS4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661337406051658.1967093561684; Wed, 24 Aug 2022 03:36:46 -0700 (PDT) Received: from localhost ([::1]:49206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnka-0004SM-Re for importer@patchew.org; Wed, 24 Aug 2022 06:36:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuD-0003iy-9A for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:37 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:35402) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuB-0001aF-H0 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:36 -0400 Received: by mail-pg1-x535.google.com with SMTP id r69so14557081pgr.2 for ; Wed, 24 Aug 2022 02:42:35 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=hdtxjLMnNVU1rKYleO313NZ7D82NDLkpXwsAYvVj3S0=; b=mVqbC3O/frS8lRjN7/wJv4EuqSVn9CFQWeOfEI9WVWNXIfCBXkaj/gllYvuDo4l2iH d8Ocp0GW2jkwn7Lseoy9DAfZsR/2dcIcAJ3qZEB0kyQez0yOyd/7voACySdajC/JGpni gAbCB364XJ/zB9K934O590g7FYSFrhkqsut0zkp/iJU13wFGzO79IdyLpyc0oovcBn/G E+WQWYAbefRm8Qc6INVRtf6lnldEwiFyLEu6HAqYkS2kBlIX+pbB8gSUwvNAusNMYEhw Ngc3JOgag6sYiEUsUzJ0cGBM2IxUL//iECRECtSex0pLmZHcEDArwt7BpvTzkZTiXQR2 8czQ== 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; bh=hdtxjLMnNVU1rKYleO313NZ7D82NDLkpXwsAYvVj3S0=; b=p6oaWPYYriCaWFhahn2eKyd3cRuWIXM4wZyBg5mgwodnD3e80h3bTwmc0TfAHXGvRn 3y/jZvIFKKpxDlHwEzSeKZyjTAX6f0kO3o0/UvuKwx3PjefnMOaoSXZV6ho669PevkgI UfKkyDOm+H2trAk3PNRLt2ig0G+Om11yPNicu4TFOdnfATVcEQ0AAiywcTIpPijW6rY9 XH9Y1LdLKWILRkO3g2cNYySWQr+cd94foWhZCit71UC7Qv2KAG0QcpkSc0WHZeTtJhMe ffEkH7s6BrkBPipYcJgGA6r8yjMoaICEdKVEBDdO7NoCgowwQQ24uvZ6p1LaVlbwQ4lG IUYg== X-Gm-Message-State: ACgBeo1hyZKrNO2uxtphQ2esWH5dm1yDKDvAk8Zpw5WrBt8nuElF2EZm nIm2vvilAglANUcTVlWrc6OXHlTwKaY= X-Google-Smtp-Source: AA6agR7lo9wbggC3jooao5yYq3psZ6ceOVwNBVBisI5RnYyxfZmwOBeHPZ6gzh1+RWKKLYxLsguefg== X-Received: by 2002:a65:6d19:0:b0:42a:37d7:90da with SMTP id bf25-20020a656d19000000b0042a37d790damr20688393pgb.16.1661334153909; Wed, 24 Aug 2022 02:42:33 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , Eduardo Habkost , Laurent Vivier , Marcel Apfelbaum , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Thomas Huth , Yanan Wang Subject: [PATCH 23/51] accel/qtest: Support qtest accelerator for Windows Date: Wed, 24 Aug 2022 17:40:01 +0800 Message-Id: <20220824094029.1634519-24-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x535.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661337408411100001 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng Currently signal SIGIPI [=3DSIGUSR1] is used to kick the dummy CPU when qtest accelerator is used. However SIGUSR1 is unsupported on Windows. To support Windows, we add a QemuSemaphore CPUState::sem to kick the dummy CPU instead for Windows. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/hw/core/cpu.h | 1 + accel/dummy-cpus.c | 14 ++++++++++++-- softmmu/cpus.c | 9 +++++---- accel/meson.build | 1 + accel/qtest/meson.build | 1 + 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 500503da13..c564108877 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -325,6 +325,7 @@ struct CPUState { struct QemuThread *thread; #ifdef _WIN32 HANDLE hThread; + QemuSemaphore sem; #endif int thread_id; bool running, has_waiter; diff --git a/accel/dummy-cpus.c b/accel/dummy-cpus.c index 10429fdfb2..d6a1b8d0a2 100644 --- a/accel/dummy-cpus.c +++ b/accel/dummy-cpus.c @@ -21,8 +21,6 @@ static void *dummy_cpu_thread_fn(void *arg) { CPUState *cpu =3D arg; - sigset_t waitset; - int r; =20 rcu_register_thread(); =20 @@ -32,8 +30,13 @@ static void *dummy_cpu_thread_fn(void *arg) cpu->can_do_io =3D 1; current_cpu =3D cpu; =20 +#ifndef _WIN32 + sigset_t waitset; + int r; + sigemptyset(&waitset); sigaddset(&waitset, SIG_IPI); +#endif =20 /* signal CPU creation */ cpu_thread_signal_created(cpu); @@ -41,6 +44,7 @@ static void *dummy_cpu_thread_fn(void *arg) =20 do { qemu_mutex_unlock_iothread(); +#ifndef _WIN32 do { int sig; r =3D sigwait(&waitset, &sig); @@ -49,6 +53,9 @@ static void *dummy_cpu_thread_fn(void *arg) perror("sigwait"); exit(1); } +#else + qemu_sem_wait(&cpu->sem); +#endif qemu_mutex_lock_iothread(); qemu_wait_io_event(cpu); } while (!cpu->unplug); @@ -69,4 +76,7 @@ void dummy_start_vcpu_thread(CPUState *cpu) cpu->cpu_index); qemu_thread_create(cpu->thread, thread_name, dummy_cpu_thread_fn, cpu, QEMU_THREAD_JOINABLE); +#ifdef _WIN32 + qemu_sem_init(&cpu->sem, 0); +#endif } diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 23b30484b2..fd10db927a 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -437,18 +437,19 @@ void qemu_wait_io_event(CPUState *cpu) =20 void cpus_kick_thread(CPUState *cpu) { -#ifndef _WIN32 - int err; - if (cpu->thread_kicked) { return; } cpu->thread_kicked =3D true; - err =3D pthread_kill(cpu->thread->thread, SIG_IPI); + +#ifndef _WIN32 + int err =3D pthread_kill(cpu->thread->thread, SIG_IPI); if (err && err !=3D ESRCH) { fprintf(stderr, "qemu:%s: %s", __func__, strerror(err)); exit(1); } +#else + qemu_sem_post(&cpu->sem); #endif } =20 diff --git a/accel/meson.build b/accel/meson.build index b9a963cf80..b21c85dc0a 100644 --- a/accel/meson.build +++ b/accel/meson.build @@ -17,4 +17,5 @@ dummy_ss.add(files( )) =20 specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: dum= my_ss) +specific_ss.add_all(when: ['CONFIG_WIN32'], if_true: dummy_ss) specific_ss.add_all(when: ['CONFIG_XEN'], if_true: dummy_ss) diff --git a/accel/qtest/meson.build b/accel/qtest/meson.build index 4c65600293..a4876fc0f2 100644 --- a/accel/qtest/meson.build +++ b/accel/qtest/meson.build @@ -1,2 +1,3 @@ qtest_module_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: files('qtest.c')) +qtest_module_ss.add(when: ['CONFIG_WIN32'], if_true: files('qtest.c')) --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661337905; cv=none; d=zohomail.com; s=zohoarc; b=fyv/HRP4098yjJVRRpOiKdV4MOrZwPCzJX2IGRCyKD9RF3zSclPqWLtPO0FBiIqJ4ysPBbWn9yfebZUZZxISZgVW9a/X+2FZ9OLd3s1+WN29w5iZPQpCmNEFCOsdAbSpVFGG2Gi9ihUIKpu9e+2GLXHlQmKRnbkWCm17oK+Aoe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661337905; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MdKeSTbLm3PS0opC2HpSIBVAL/dC7LQ0XETPzs3c6S0=; b=IwLVZoHaUhXiKOBddFyQ3QCWoODqCj8CDQ8aqR/MWHEL3NfXk9X9gIVnKyqU1t6KRkQtAsuVxlsx1w3mHVAPY3n9KlE/CNj29Bf1KDKYInLb/5cqSwvlF3o4jmh24I1+dV8lAuNR01mAvcLWxgvpTDR9WwXLJgFPFEd8yRlMmRo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661337905466445.22914669333306; Wed, 24 Aug 2022 03:45:05 -0700 (PDT) Received: from localhost ([::1]:35874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnsa-000868-Ux for importer@patchew.org; Wed, 24 Aug 2022 06:45:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuO-00043B-ED for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:48 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:37610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuD-0001aY-W9 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:48 -0400 Received: by mail-pf1-x42f.google.com with SMTP id x15so15076276pfp.4 for ; Wed, 24 Aug 2022 02:42:37 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=MdKeSTbLm3PS0opC2HpSIBVAL/dC7LQ0XETPzs3c6S0=; b=boEs1TbeHauz9OftzSqMwRTzDCoO9q9S29lEWsea9vxDgu2ajlbn4z1BAS/c6wv/8/ QJ5HcaTNuxt/Xzxca42gOTih7McIkjVzVNZ+8XKixZFROUd8rLsmX9D2qi3I+9yeMyyn 1mKEOdhSyQ+tqSzqYVCy/FsO/XwWjavMlF/rzNJXbGfnehLQXdFaY+qC8dkFXNZC6Hp7 DwHeVkmSAHLFViieg9O4SJkZLe94QhRT5N9qvfsdrStgxtp52WY8kBc0L8gkQb3E3hZ4 ypgIeHPA1owJFhfzDrhZLtEtLRjJYfMHUqcTiVXM4skTDUtVOheHDT16n+UcwuW0OF/Z 7bZg== 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; bh=MdKeSTbLm3PS0opC2HpSIBVAL/dC7LQ0XETPzs3c6S0=; b=WvY+Srg/V70fuRgrdGmhmU0RP3vJMTf4QxjHGz6ufMSdB+wPbGQVbX3JKGQPs5gUYi 8+UjGG2Bstwyk17OcVK4bxxa1B9CXQBe+l9Xc3OfYgoLdS8ZDCdhsFZl/VWM2aKMcXOl 1fnpBxhhA96ng4dFpKE9LbYQrCoog0kVECadkWTI5ovp1RDCZ5JUhxaYjzPupAirrW5p hLkpLsu9AhVp34i+zed0CM05SmIAz2nKwjCeb4pU4DwjsmbKfSjJfEXNWRgrfFHA42SA W8X7T8WZc26rwLgqU9IlGGwf9aE/D6UpP0oWD2MO6TnhnmEyQhFv92jP6OmjtHXAfApm wcuA== X-Gm-Message-State: ACgBeo2kx6WsrhSbtFeux3BtKUVZzSSLrxeVf4kijMV/FMwbEyiE4zc+ wzTxSU6uCsGlI7EdQKdAlahePNJISsM= X-Google-Smtp-Source: AA6agR437Al04JiYuVOLRO+sqrXxjpJazG7NQeDvzYhm3KD+wRpwotEbrRmRAGPdTQ5fbnS5sMx+5A== X-Received: by 2002:a05:6a00:813:b0:536:e993:731b with SMTP id m19-20020a056a00081300b00536e993731bmr8396022pfk.34.1661334156527; Wed, 24 Aug 2022 02:42:36 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 24/51] tests/qtest: libqos: Drop inclusion of Date: Wed, 24 Aug 2022 17:40:02 +0800 Message-Id: <20220824094029.1634519-25-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=bmeng.cn@gmail.com; helo=mail-pf1-x42f.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, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661337907337100001 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng There is no in the Windows build environment. Actually this is not needed in the non-win32 builds too. Drop it. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Tested-by: Thomas Huth --- tests/qtest/libqos/libqos.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/qtest/libqos/libqos.c b/tests/qtest/libqos/libqos.c index 85c7641add..5ffda080ec 100644 --- a/tests/qtest/libqos/libqos.c +++ b/tests/qtest/libqos/libqos.c @@ -1,6 +1,4 @@ #include "qemu/osdep.h" -#include - #include "../libqtest.h" #include "libqos.h" #include "pci.h" --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661336694; cv=none; d=zohomail.com; s=zohoarc; b=gR6RQFkBJesIq28LOMl9TJf8ORdpfMH7CPUPATzWSCjW4dbqfMKtLC/V56ZubM0mQAORdU4q5oo22ugZ6om5gLGU6HadsnkXsvlfF1sb/1En3qPnoZ6A0teZ3GLjHVNac+A98h5fv3Sbh9HzJaVdWmLgXoaoq22HImFC/36ljoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661336694; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8cdvfFR41bNG20qDmhS/eM1yLaADTlT1CXePgdiY3RA=; b=nYdjMbfbB/udv6zZ6HtUgc/C3iNnZysDdYO3zToj4Hirq8yE54mGQ0w0eD6SsfOMpaNT6uBkqc0ydRQ+q+B02MYhH5zI419osLc+BcV2kacYcXvMbDvuwvwlt8KXi/rNx7nbNNzgQS9FNpXaMaZIa05yX3unJi9X+n1akJlbgCM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336694119703.7270748631684; Wed, 24 Aug 2022 03:24:54 -0700 (PDT) Received: from localhost ([::1]:39600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnZ6-0003c7-UM for importer@patchew.org; Wed, 24 Aug 2022 06:24:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuM-0003zQ-Ld; Wed, 24 Aug 2022 05:42:46 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:36456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuJ-0001ar-9t; Wed, 24 Aug 2022 05:42:46 -0400 Received: by mail-pl1-x636.google.com with SMTP id c2so15204130plo.3; Wed, 24 Aug 2022 02:42:42 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=8cdvfFR41bNG20qDmhS/eM1yLaADTlT1CXePgdiY3RA=; b=p1viruIfLlnSonmUePXWWlgTgxuADqVRqGQPl4piM7ddJj4ez6OAPWKU1+nr9xXryn 0LYM78u8f59yMYnEUAM58Wu9yRNZKq6jK0FVnFMeN4kMHJZBREgs6KwUJpeM/M3TttWd RHNH68tw80UnN8tpjGCVR616f0KWwY1RSAheIKzGKYZzoNafY+is0cayCNHWvvV9xkJk IKjJF++gHmRgLB359eu5jOSuzLVF2kt019nH7sYCEBr4/o5ZdQsqF2q/yo9nbOou47CA 4i3css5q/ciCgocEOcWCmRLOmPnJSZ+VYlzQ6bNtyvuVi7Q4rswPizCJk0Ab6/GILzT4 wgWA== 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; bh=8cdvfFR41bNG20qDmhS/eM1yLaADTlT1CXePgdiY3RA=; b=u0E4ICRGZ2OyUoTv9rO76jutkqAQRFduLgMf6fM0+Hxq6OuMER4pvpQGo9OXPDgsKk yDWLWhVy8xOeIw5L4l/mBQCoYPYlbhQMmrXuNF3EtSu7PSDSN16qh5kqw234/bdQQMNU B1/Jf2D+IiVtr4ZYrDSULT8BdVCxXzlx/6pwAlMmUbGsyRqstf6kIFQz1i8znNhjB9VH fLPp+N3Sjz4SUKY7Ffb/XKcQuqD7Bl1KzVf/TT3WQKfr2UbZHSpDqmhKMX30pHBQBHF7 p9S+wp27lFhVovdm8BwDBXefuZQf4AdqbDyB2ITK6vEWC9gCs0aMT00ZTwUbZqO2rfOv 9rnQ== X-Gm-Message-State: ACgBeo1E5E8BHuCe2v4tCrvxxyPZrpwVpwSUAIQVnHI/Wxu/o0fl58i4 2+FrBTHmPdybcwvwmsXyvkecbk9/k3s= X-Google-Smtp-Source: AA6agR6PZP203B+5K55eEac5EKeL7Rl0ZEfkE41ZS89EILVSFq9krLKz7cOjTZOmHeZD2RL43Ilm2Q== X-Received: by 2002:a17:90b:30cb:b0:1fa:d69e:b581 with SMTP id hi11-20020a17090b30cb00b001fad69eb581mr7508763pjb.103.1661334161472; Wed, 24 Aug 2022 02:42:41 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , Alexander Bulekov , Bandan Das , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , Darren Kenny , David Gibson , Greg Kurz , Laurent Vivier , Paolo Bonzini , Qiuhao Li , Stefan Hajnoczi , Thomas Huth , qemu-ppc@nongnu.org Subject: [PATCH 25/51] tests/qtest: libqos: Rename malloc.h to libqos-malloc.h Date: Wed, 24 Aug 2022 17:40:03 +0800 Message-Id: <20220824094029.1634519-26-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x636.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661336696540100001 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng The qtest/libqos directory is included via the "-I" option to search for header files when building qtest. Unfortunately the malloc.h has a name conflict with the standard libc header, leading to a build failure on the Windows host, due to the MinGW libc stdlib.h header file includes malloc.h and it now gets wrongly pointed to the one in the qtest/libqos directory. Rename "qtest/libqos/malloc.h" to "qtest/libqos/libqos-malloc.h" to avoid the namespace pollution. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth --- tests/qtest/libqos/generic-pcihost.h | 2 +- tests/qtest/libqos/{malloc.h =3D> libqos-malloc.h} | 0 tests/qtest/libqos/libqos.h | 2 +- tests/qtest/libqos/malloc-pc.h | 2 +- tests/qtest/libqos/malloc-spapr.h | 2 +- tests/qtest/libqos/pci-pc.h | 2 +- tests/qtest/libqos/pci-spapr.h | 2 +- tests/qtest/libqos/qgraph.h | 2 +- tests/qtest/libqos/qos_external.h | 2 +- tests/qtest/libqos/rtas.h | 2 +- tests/qtest/libqos/virtio.h | 2 +- tests/qtest/e1000e-test.c | 2 +- tests/qtest/fuzz/qos_fuzz.c | 2 +- tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c | 2 +- tests/qtest/libqos/arm-imx25-pdk-machine.c | 2 +- tests/qtest/libqos/arm-n800-machine.c | 2 +- tests/qtest/libqos/arm-raspi2-machine.c | 2 +- tests/qtest/libqos/arm-sabrelite-machine.c | 2 +- tests/qtest/libqos/arm-smdkc210-machine.c | 2 +- tests/qtest/libqos/arm-virt-machine.c | 2 +- tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c | 2 +- tests/qtest/libqos/e1000e.c | 2 +- tests/qtest/libqos/{malloc.c =3D> libqos-malloc.c} | 2 +- tests/qtest/libqos/qos_external.c | 2 +- tests/qtest/libqos/virtio-mmio.c | 2 +- tests/qtest/libqos/virtio-pci.c | 2 +- tests/qtest/qos-test.c | 2 +- tests/qtest/libqos/meson.build | 2 +- 28 files changed, 27 insertions(+), 27 deletions(-) rename tests/qtest/libqos/{malloc.h =3D> libqos-malloc.h} (100%) rename tests/qtest/libqos/{malloc.c =3D> libqos-malloc.c} (99%) diff --git a/tests/qtest/libqos/generic-pcihost.h b/tests/qtest/libqos/gene= ric-pcihost.h index c693c769df..6493a8712a 100644 --- a/tests/qtest/libqos/generic-pcihost.h +++ b/tests/qtest/libqos/generic-pcihost.h @@ -14,7 +14,7 @@ #define LIBQOS_GENERIC_PCIHOST_H =20 #include "pci.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" =20 typedef struct QGenericPCIBus { diff --git a/tests/qtest/libqos/malloc.h b/tests/qtest/libqos/libqos-malloc= .h similarity index 100% rename from tests/qtest/libqos/malloc.h rename to tests/qtest/libqos/libqos-malloc.h diff --git a/tests/qtest/libqos/libqos.h b/tests/qtest/libqos/libqos.h index ba7df448ca..9b4dd509f0 100644 --- a/tests/qtest/libqos/libqos.h +++ b/tests/qtest/libqos/libqos.h @@ -3,7 +3,7 @@ =20 #include "../libqtest.h" #include "pci.h" -#include "malloc.h" +#include "libqos-malloc.h" =20 typedef struct QOSState QOSState; =20 diff --git a/tests/qtest/libqos/malloc-pc.h b/tests/qtest/libqos/malloc-pc.h index d8d79853c8..e531473601 100644 --- a/tests/qtest/libqos/malloc-pc.h +++ b/tests/qtest/libqos/malloc-pc.h @@ -13,7 +13,7 @@ #ifndef LIBQOS_MALLOC_PC_H #define LIBQOS_MALLOC_PC_H =20 -#include "malloc.h" +#include "libqos-malloc.h" =20 void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags); =20 diff --git a/tests/qtest/libqos/malloc-spapr.h b/tests/qtest/libqos/malloc-= spapr.h index f99572fd71..f544c0d611 100644 --- a/tests/qtest/libqos/malloc-spapr.h +++ b/tests/qtest/libqos/malloc-spapr.h @@ -8,7 +8,7 @@ #ifndef LIBQOS_MALLOC_SPAPR_H #define LIBQOS_MALLOC_SPAPR_H =20 -#include "malloc.h" +#include "libqos-malloc.h" =20 void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flag= s); =20 diff --git a/tests/qtest/libqos/pci-pc.h b/tests/qtest/libqos/pci-pc.h index 49ec9507f2..849bd493de 100644 --- a/tests/qtest/libqos/pci-pc.h +++ b/tests/qtest/libqos/pci-pc.h @@ -14,7 +14,7 @@ #define LIBQOS_PCI_PC_H =20 #include "pci.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" =20 typedef struct QPCIBusPC { diff --git a/tests/qtest/libqos/pci-spapr.h b/tests/qtest/libqos/pci-spapr.h index 20a43718b7..3dbf1e58ae 100644 --- a/tests/qtest/libqos/pci-spapr.h +++ b/tests/qtest/libqos/pci-spapr.h @@ -8,7 +8,7 @@ #ifndef LIBQOS_PCI_SPAPR_H #define LIBQOS_PCI_SPAPR_H =20 -#include "malloc.h" +#include "libqos-malloc.h" #include "pci.h" #include "qgraph.h" =20 diff --git a/tests/qtest/libqos/qgraph.h b/tests/qtest/libqos/qgraph.h index 871740c0dc..6e94824d09 100644 --- a/tests/qtest/libqos/qgraph.h +++ b/tests/qtest/libqos/qgraph.h @@ -21,7 +21,7 @@ =20 #include #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" =20 /* maximum path length */ #define QOS_PATH_MAX_ELEMENT_SIZE 50 diff --git a/tests/qtest/libqos/qos_external.h b/tests/qtest/libqos/qos_ext= ernal.h index 8446e3df0b..ea37364887 100644 --- a/tests/qtest/libqos/qos_external.h +++ b/tests/qtest/libqos/qos_external.h @@ -21,7 +21,7 @@ =20 #include "qgraph.h" =20 -#include "malloc.h" +#include "libqos-malloc.h" #include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-qom.h" =20 diff --git a/tests/qtest/libqos/rtas.h b/tests/qtest/libqos/rtas.h index f38f99dfab..be8353d505 100644 --- a/tests/qtest/libqos/rtas.h +++ b/tests/qtest/libqos/rtas.h @@ -5,7 +5,7 @@ =20 #ifndef LIBQOS_RTAS_H #define LIBQOS_RTAS_H -#include "malloc.h" +#include "libqos-malloc.h" =20 int qrtas_get_time_of_day(QTestState *qts, QGuestAllocator *alloc, struct tm *tm, uint32_t *ns); diff --git a/tests/qtest/libqos/virtio.h b/tests/qtest/libqos/virtio.h index b8bd06e1b8..7adc7cbd10 100644 --- a/tests/qtest/libqos/virtio.h +++ b/tests/qtest/libqos/virtio.h @@ -10,7 +10,7 @@ #ifndef LIBQOS_VIRTIO_H #define LIBQOS_VIRTIO_H =20 -#include "malloc.h" +#include "libqos-malloc.h" #include "standard-headers/linux/virtio_ring.h" =20 #define QVIRTIO_F_BAD_FEATURE 0x40000000ull diff --git a/tests/qtest/e1000e-test.c b/tests/qtest/e1000e-test.c index c98779c7c0..4cdd8238f2 100644 --- a/tests/qtest/e1000e-test.c +++ b/tests/qtest/e1000e-test.c @@ -31,7 +31,7 @@ #include "qemu/iov.h" #include "qemu/module.h" #include "qemu/bitops.h" -#include "libqos/malloc.h" +#include "libqos/libqos-malloc.h" #include "libqos/e1000e.h" =20 static void e1000e_send_verify(QE1000E *d, int *test_sockets, QGuestAlloca= tor *alloc) diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c index c856d3d500..3a3d9c16dd 100644 --- a/tests/qtest/fuzz/qos_fuzz.c +++ b/tests/qtest/fuzz/qos_fuzz.c @@ -23,7 +23,7 @@ #include "qemu/main-loop.h" =20 #include "tests/qtest/libqtest.h" -#include "tests/qtest/libqos/malloc.h" +#include "tests/qtest/libqos/libqos-malloc.h" #include "tests/qtest/libqos/qgraph.h" #include "tests/qtest/libqos/qgraph_internal.h" #include "tests/qtest/libqos/qos_external.h" diff --git a/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c b/tests/qtest= /libqos/aarch64-xlnx-zcu102-machine.c index c8a3ea11eb..ab24add8eb 100644 --- a/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c +++ b/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c @@ -19,7 +19,7 @@ #include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "sdhci.h" =20 diff --git a/tests/qtest/libqos/arm-imx25-pdk-machine.c b/tests/qtest/libqo= s/arm-imx25-pdk-machine.c index 54d0c95330..8fe128fae8 100644 --- a/tests/qtest/libqos/arm-imx25-pdk-machine.c +++ b/tests/qtest/libqos/arm-imx25-pdk-machine.c @@ -20,7 +20,7 @@ =20 #include "qemu/osdep.h" #include "../libqtest.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "i2c.h" =20 diff --git a/tests/qtest/libqos/arm-n800-machine.c b/tests/qtest/libqos/arm= -n800-machine.c index ecd46b1daf..4e5afe0164 100644 --- a/tests/qtest/libqos/arm-n800-machine.c +++ b/tests/qtest/libqos/arm-n800-machine.c @@ -20,7 +20,7 @@ =20 #include "qemu/osdep.h" #include "../libqtest.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "i2c.h" =20 diff --git a/tests/qtest/libqos/arm-raspi2-machine.c b/tests/qtest/libqos/a= rm-raspi2-machine.c index 0a2943440b..367c6c17a5 100644 --- a/tests/qtest/libqos/arm-raspi2-machine.c +++ b/tests/qtest/libqos/arm-raspi2-machine.c @@ -19,7 +19,7 @@ #include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "sdhci.h" =20 diff --git a/tests/qtest/libqos/arm-sabrelite-machine.c b/tests/qtest/libqo= s/arm-sabrelite-machine.c index ec19a01660..94f6a20fc7 100644 --- a/tests/qtest/libqos/arm-sabrelite-machine.c +++ b/tests/qtest/libqos/arm-sabrelite-machine.c @@ -19,7 +19,7 @@ #include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "sdhci.h" =20 diff --git a/tests/qtest/libqos/arm-smdkc210-machine.c b/tests/qtest/libqos= /arm-smdkc210-machine.c index 4bff249ee8..9bbce924ea 100644 --- a/tests/qtest/libqos/arm-smdkc210-machine.c +++ b/tests/qtest/libqos/arm-smdkc210-machine.c @@ -19,7 +19,7 @@ #include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "sdhci.h" =20 diff --git a/tests/qtest/libqos/arm-virt-machine.c b/tests/qtest/libqos/arm= -virt-machine.c index 139eaba142..4e87405b58 100644 --- a/tests/qtest/libqos/arm-virt-machine.c +++ b/tests/qtest/libqos/arm-virt-machine.c @@ -19,7 +19,7 @@ #include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "virtio-mmio.h" #include "generic-pcihost.h" diff --git a/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c b/tests/qtest/= libqos/arm-xilinx-zynq-a9-machine.c index 3be80020a6..daac762a06 100644 --- a/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c +++ b/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c @@ -19,7 +19,7 @@ #include "qemu/osdep.h" #include "../libqtest.h" #include "qemu/module.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "sdhci.h" =20 diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c index f87e0e84b2..fc14b07884 100644 --- a/tests/qtest/libqos/e1000e.c +++ b/tests/qtest/libqos/e1000e.c @@ -23,7 +23,7 @@ #include "qemu/iov.h" #include "qemu/module.h" #include "qemu/bitops.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "e1000e.h" =20 diff --git a/tests/qtest/libqos/malloc.c b/tests/qtest/libqos/libqos-malloc= .c similarity index 99% rename from tests/qtest/libqos/malloc.c rename to tests/qtest/libqos/libqos-malloc.c index f0c8f950c8..d7566972c4 100644 --- a/tests/qtest/libqos/malloc.c +++ b/tests/qtest/libqos/libqos-malloc.c @@ -11,7 +11,7 @@ */ =20 #include "qemu/osdep.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qemu/host-utils.h" =20 typedef struct MemBlock { diff --git a/tests/qtest/libqos/qos_external.c b/tests/qtest/libqos/qos_ext= ernal.c index b7a0b873a3..c6bb8bff09 100644 --- a/tests/qtest/libqos/qos_external.c +++ b/tests/qtest/libqos/qos_external.c @@ -24,7 +24,7 @@ #include "qapi/qmp/qstring.h" #include "qemu/module.h" #include "qapi/qmp/qlist.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "qgraph_internal.h" #include "qos_external.h" diff --git a/tests/qtest/libqos/virtio-mmio.c b/tests/qtest/libqos/virtio-m= mio.c index a6cca8613b..bd0b1d890b 100644 --- a/tests/qtest/libqos/virtio-mmio.c +++ b/tests/qtest/libqos/virtio-mmio.c @@ -12,7 +12,7 @@ #include "qemu/module.h" #include "virtio.h" #include "virtio-mmio.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "qgraph.h" #include "standard-headers/linux/virtio_ring.h" =20 diff --git a/tests/qtest/libqos/virtio-pci.c b/tests/qtest/libqos/virtio-pc= i.c index 67c2498c84..485b8f6b7e 100644 --- a/tests/qtest/libqos/virtio-pci.c +++ b/tests/qtest/libqos/virtio-pci.c @@ -13,7 +13,7 @@ #include "virtio-pci.h" #include "pci.h" #include "pci-pc.h" -#include "malloc.h" +#include "libqos-malloc.h" #include "malloc-pc.h" #include "qgraph.h" #include "standard-headers/linux/virtio_ring.h" diff --git a/tests/qtest/qos-test.c b/tests/qtest/qos-test.c index f97d0a08fd..831db5cf2a 100644 --- a/tests/qtest/qos-test.c +++ b/tests/qtest/qos-test.c @@ -25,7 +25,7 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/qapi-visit-machine.h" #include "qapi/qapi-visit-qom.h" -#include "libqos/malloc.h" +#include "libqos/libqos-malloc.h" #include "libqos/qgraph.h" #include "libqos/qgraph_internal.h" #include "libqos/qos_external.h" diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build index fd5d6e5ae1..cff83c86d9 100644 --- a/tests/qtest/libqos/meson.build +++ b/tests/qtest/libqos/meson.build @@ -6,7 +6,7 @@ libqos_srcs =3D files( 'qos_external.c', 'pci.c', 'fw_cfg.c', - 'malloc.c', + 'libqos-malloc.c', 'libqos.c', 'sdhci-cmd.c', =20 --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661337777; cv=none; d=zohomail.com; s=zohoarc; b=GzTT/kWBjORzDzn+0asGQmGVnu4JcK/15O3+ikgm4BhJ6Zr9yqNZo9LUunLVRXDKTDc1fGJ70O4iWt9NBgvk+eJ5YDZ7TzAH9oADyxbGkIdQ/w3fTogiPYBEuxCBAKmoixl3SqaDfshyXICh3KVQkoWCgGqSxK8qzPi4DlO0fvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661337777; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZMTvAyZuMin22FzdWCyxbO3Nu5c2nRBEHD5FUVRQ7yc=; b=Uq8amYfJ/PkW+FfR8nmMfsRqP5/4WHscWGaav5AymvfTiPcVzJiPDlVYpSfpWeyxMy7lTtXacIRhozelSswcefGXQZIqrCgHnCwGhRdBK34K8p84q5p/5JzdhRTC5PlLZvMzq1+AMvnYx4B740dqoCJXwHGD1JOxdaBK8S8UI3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661337777851243.937800487736; Wed, 24 Aug 2022 03:42:57 -0700 (PDT) Received: from localhost ([::1]:57738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnqZ-000468-Ky for importer@patchew.org; Wed, 24 Aug 2022 06:42:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuN-00040m-5O for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:47 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:52737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuL-0001Z8-I1 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:46 -0400 Received: by mail-pj1-x102e.google.com with SMTP id f21so16511832pjt.2 for ; Wed, 24 Aug 2022 02:42:44 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=ZMTvAyZuMin22FzdWCyxbO3Nu5c2nRBEHD5FUVRQ7yc=; b=Y01zgjERpQES6bO6YeaIYqLerOel2Luq/wOKifwLKj70Fzj/fwLs+4HFsvoyaY1F5r UaxOEl8bYlJSK2o2AyULTuON9ethgWmP8PYG6n+8orAw2wWLTvkq+GcNaT3V/4lCh98k qmNKSVPryPBZbeKD2lDtxkA0uN15p/oWvYH61i343EbUhlEOZ9SzMEZL9YTwKELcjasY E52ujwxgnF+tefJZ1ZMXXdkSvqzqDW61dOOEdguQ84GtYZDy/rNy+4jjUrb3OQKN6skK KxI/XZeRqlvY2pwUq3/CYR0PQ6unO8MNBCCvtRO5Y+q0DD9bYMuQ67NzVz7UE7ZYGoL9 5iOA== 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; bh=ZMTvAyZuMin22FzdWCyxbO3Nu5c2nRBEHD5FUVRQ7yc=; b=kHeAbBVAkNziuS81iLYlucwRnA3c4zQSORo7HkRtLPaxHVg3omRl8cIbg8tq67vUfI xvM2EsHtgeFyI38vWpSCl4rOiR4nvEVEAIBh6r+1X4+ed1LngEknLKaysTx5LcPz8yQ8 Zl1t91E3Eq9TctUIF0sZfWqZTtoLjgM765W46/3nyg75KhSJQ5fb9QNlJ134uJx3l7DG 6ONLm5bGwQPTtopri0k1kNUh7SFOE0k6DZlUkmFS2rwYOhfENydVhmCXRueTQgs0zeCe jklWAQljEl6r5cYrq2QHeSC0NqSIipZabLdTbrdtsMIdNxOwiUVUoX1TcsE7dSzxFonE FRhw== X-Gm-Message-State: ACgBeo1KW/duWGcwjSfmtgp1kje6IPcX+kIEt7G8zC6YfHf93jGJxI5Y I4btZjw5vBaJUZVtRG/K05WfdhIR6eI= X-Google-Smtp-Source: AA6agR5JY7gv4+4mKWYWp2YARd9r4xpdqubJztnuKLZdTxq5H6A3di7v7WAz8bRgrt4ggvsrJQzD+A== X-Received: by 2002:a17:90a:17e1:b0:1f2:2ff2:6cae with SMTP id q88-20020a17090a17e100b001f22ff26caemr7495766pja.196.1661334164143; Wed, 24 Aug 2022 02:42:44 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 26/51] tests/qtest: libqtest: Move global_qtest definition back to libqtest.c Date: Wed, 24 Aug 2022 17:40:04 +0800 Message-Id: <20220824094029.1634519-27-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x102e.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661337778572100001 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng Commit dd2107497275 ("tests/libqtest: Use libqtest-single.h in tests that r= equire global_qtest") moved global_qtest to libqtest-single.h, by declaring global_qtest attribute to be common and weak. This trick unfortunately does not work on Windows, and building qtest test cases results in multiple definition errors of the weak symbol global_qtest, as Windows PE does not have the concept of the so-called weak symbol like ELF in the *nix world. Let's move the definition of global_qtest back to libqtest.c. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- tests/qtest/libqtest-single.h | 2 +- tests/qtest/libqtest.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/libqtest-single.h b/tests/qtest/libqtest-single.h index 4e7d0ae1dc..3294985d7b 100644 --- a/tests/qtest/libqtest-single.h +++ b/tests/qtest/libqtest-single.h @@ -13,7 +13,7 @@ =20 #include "libqtest.h" =20 -QTestState *global_qtest __attribute__((common, weak)); +extern QTestState *global_qtest; =20 /** * qtest_start: diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 34744ace7c..909583dad3 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -65,6 +65,8 @@ struct QTestState GList *pending_events; }; =20 +QTestState *global_qtest; + static GHookList abrt_hooks; static struct sigaction sigact_old; =20 --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661337118; cv=none; d=zohomail.com; s=zohoarc; b=O5PDh3jtaaR9rsONjlrC4qV+p0xlQHJsdhUI8s3iUNzxA1hwUbz+pAcNS6FlqMoPhhoMdhk108qqt8ifEhO4eu+1uT+kiTq2s9Mn3cQR0MJpLdLxdQxTzZuKrXFigA1FfYKC7c8J8yG3NMmi92smYxjqPQHZCno7RGCZRbctNuA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661337118; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IfI/qWhUWiZQhG5XwWjV6xjarmHg12V73Blb6zZFpuQ=; b=a8LTmOA/AXjEOnoVG8DbfsT1rY4fYnhjeXaYi3z7QT/8G8FSg0ekVKQsRt/fLD9BgtrIdMo8tQ7isHMQB8CTEZUBvbPtztkd3zaMTfNfxm7EUU2VlL2OiBmn3SbTAtGBq08M/W/iP/bin4dFPSpqAHZzYrl5XjQQuHAnrwTETt8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661337118437614.7787399792603; Wed, 24 Aug 2022 03:31:58 -0700 (PDT) Received: from localhost ([::1]:56818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnfo-0001HW-AQ for importer@patchew.org; Wed, 24 Aug 2022 06:31:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuP-00046t-O0 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:50 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:41956) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuO-0001bT-0Y for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:49 -0400 Received: by mail-pg1-x533.google.com with SMTP id 202so14542886pgc.8 for ; Wed, 24 Aug 2022 02:42:47 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=IfI/qWhUWiZQhG5XwWjV6xjarmHg12V73Blb6zZFpuQ=; b=lgIvNYS2uxagdXZauE9C99i9XdDYqd8KPAc1aWEHEl3QH9uGAj8wgzNykpP7DX0YqY 2dE5eJBC9O5CBWv7EJpLMcAVgqCbzQ8bz3m4MEiqbBr1KnkOwxT3sz8Yw70UJ7WNtsSz 31CuFlzqfgxQkQ6jdHUxfZhQmwkGiLyBdnezlzyDeJoNIwFRQHoyUd3zfAbwPmyqcEjJ D+dAeGva2CA5hZ54wRfOunVGapRIkhtNzrzB8QgAE+tQu2/SPMk9R1fR4hfB0uGFBw2t lAndgigtdIBo24kYN/5FxUZQpu/VAXhH1/lLRswBCZTFuy0fgFUAf4hXiuBk2X77xKTn j3Iw== 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; bh=IfI/qWhUWiZQhG5XwWjV6xjarmHg12V73Blb6zZFpuQ=; b=kP4xGPpnuDqoy3H3j1rpXPV49UrjfS/rjeaLbi9HGv31ehdDKfi/pGrqy+yJBvy2Cn 0AqPha+yZ2RZ9SFnpACRxpPXzptitilGJLns+qk3T5D7mi9YNBd1kcCNBXkNx0E9YVKf b7LR4DgrIbKyvHJ/J4p2Yd5eFhD11s/5VcT8pQnp24py/pOFGf1NgFp3tSa3QlSUARvm ili3KJQ6ZZkK/qryVHjyCalVXA1lZuXoTwgGnwez1u/7rUM/yQuA4o3nISRkgWvqJ7/J Z7yHKkWGaqUnAtiDUHDPe0ut2oFyMVLgo1a316IsButDkMOcHSIlbZkPapxIpLhmHmXF 0Odg== X-Gm-Message-State: ACgBeo0O4eFTyluYeXR9Om9vTZR78TaLZB32yovel4Y6O6GcLeduztxN 0uGCRyE+fWPoB/B86bKBbWOgmrLfBVM= X-Google-Smtp-Source: AA6agR5sJ9C0HFPuKJAG/c6z7BkLhItFVTK2K80PhDjyHaoJLFMEwWfHP7cOEBwuVq2W0Jw+keLmNw== X-Received: by 2002:a05:6a00:1410:b0:528:5a5a:d846 with SMTP id l16-20020a056a00141000b005285a5ad846mr29523999pfu.9.1661334166406; Wed, 24 Aug 2022 02:42:46 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 27/51] tests/qtest: Use send/recv for socket communication Date: Wed, 24 Aug 2022 17:40:05 +0800 Message-Id: <20220824094029.1634519-28-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x533.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661337119765100001 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng Socket communication in the libqtest and libqmp codes uses read() and write() which work on any file descriptor on *nix, and sockets in *nix are an example of a file descriptor. However sockets on Windows do not use *nix-style file descriptors, so read() and write() cannot be used on sockets on Windows. Switch over to use send() and recv() instead which work on both Windows and *nix. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- tests/qtest/libqmp.c | 4 ++-- tests/qtest/libqtest.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qtest/libqmp.c b/tests/qtest/libqmp.c index ade26c15f0..995a39c1f8 100644 --- a/tests/qtest/libqmp.c +++ b/tests/qtest/libqmp.c @@ -36,7 +36,7 @@ typedef struct { =20 static void socket_send(int fd, const char *buf, size_t size) { - size_t res =3D qemu_write_full(fd, buf, size); + ssize_t res =3D send(fd, buf, size, 0); =20 assert(res =3D=3D size); } @@ -69,7 +69,7 @@ QDict *qmp_fd_receive(int fd) ssize_t len; char c; =20 - len =3D read(fd, &c, 1); + len =3D recv(fd, &c, 1, 0); if (len =3D=3D -1 && errno =3D=3D EINTR) { continue; } diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 909583dad3..b7b7c9c541 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -438,7 +438,7 @@ void qtest_quit(QTestState *s) =20 static void socket_send(int fd, const char *buf, size_t size) { - size_t res =3D qemu_write_full(fd, buf, size); + ssize_t res =3D send(fd, buf, size, 0); =20 assert(res =3D=3D size); } @@ -470,7 +470,7 @@ static GString *qtest_client_socket_recv_line(QTestStat= e *s) ssize_t len; char buffer[1024]; =20 - len =3D read(s->fd, buffer, sizeof(buffer)); + len =3D recv(s->fd, buffer, sizeof(buffer), 0); if (len =3D=3D -1 && errno =3D=3D EINTR) { continue; } --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661337579; cv=none; d=zohomail.com; s=zohoarc; b=ml8Rz1yhOgbHe3Q65QDQ/wR9j5+Gy/UQsSKt4XHl1vdOHLIkfJEnMWf6HtNADpw9LZhtfB2WeQK1oKtx6xCGssJmSLVyVpqrfb/aMCRjL/3MCDZuvkN/9lHF7G+facjW/5RzlqqKZgM6yOyFi1U25HZgODK8nKBV6oF4Io0ueGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661337579; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KoPI4eXuTPrxafT3ECcIZJJvMLwXtdkRP59ne1WxHZs=; b=And0PsjN+AR5ihi7Uzx18vqhBUINc94YSEvwxd/f14I+E6NHHRuwksnOL5kZ7bA89gdAcxtxUCy6Qf+5PZo+vndyfU7uLbkDIc3JCediZqRLKfKbt6GxK8cgm/MUNkLIIGxmfs4YcEnFPz7XVHWpe1SnlbXCUh8V7QLUahov4BI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661337579111967.9301572721791; Wed, 24 Aug 2022 03:39:39 -0700 (PDT) Received: from localhost ([::1]:56834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnnN-0007g7-U2 for importer@patchew.org; Wed, 24 Aug 2022 06:39:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuR-0004AW-LD for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:51 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:36369) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuP-0001br-Vs for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:51 -0400 Received: by mail-pg1-x534.google.com with SMTP id s206so14562245pgs.3 for ; Wed, 24 Aug 2022 02:42:49 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=KoPI4eXuTPrxafT3ECcIZJJvMLwXtdkRP59ne1WxHZs=; b=HpR6r7lFNgVnv5TTgYMTT85ojDH9R5bGU8TzcUviZNPTDLbQmqUOtVqT8wJZbThJTN q+kipI5ERspKLaZNFz+I+s1p86MKuEWJuHQ4jcwhw+5jeDDBp4o6VXsLoZegZP3w52Bp nhF31De5ews9lUm+Sql4IrNQ6iB4DjXKPXsHvfNmneTKz6KUhUyg2JBRHY8reviUon6/ xdfxr0d+zumf+PwdUktkgegcBA6D0HyTSFMRQY4eftCftyCtnKqfrWC3H5SLN7l6n7Rp eMllUuekKQByaKI1/6eTl6Z1aCic9BXYxCOeZ/rpDqQ9mIWLjd+00FRE2UaCmM0DXqSB riow== 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; bh=KoPI4eXuTPrxafT3ECcIZJJvMLwXtdkRP59ne1WxHZs=; b=L+RS7CpNdE9vkraAv2kp79adtN3bmfJ4IboA//AzOl4TaVSllCxmKeOliLU0SpWpb0 Id2VoSuuMP4j4AAGZFCSSDmq3biu4xnbZ0wI2P3L939/dAdLUV5fAmrcCYPEVT+ikTxn VKVzZpaGzK5jRov2pgPV/J9nDPRiqf1ebiufd9K8YGuRSAVms9Y1NTrwIbfJML9HKzFF KCzX7n5FAtnwIengb3mLFydazO/gbq2fFVokAvBmozBb0j53Pf8Jtu5oop1CyTjy6BuL lIntO25wBWEzYC0l5Nx4bQjyssIW4ycGuG1wU+dDNdcgXb5oFsKPDz2fBS6ju2Um8w/2 siIQ== X-Gm-Message-State: ACgBeo1HHhbU8lPVrJV/NMEHEPKMbIDlgnBf40xWaA5aJYPlfmOLxolt rJXUtWHhBIZ6xLUAyHPrwBZfZekNN8s= X-Google-Smtp-Source: AA6agR6WysJXSwpm6X+LW2edpDXbbPpHLrV3NVja2kl0R7CZoKaPsKsstR/e56wxnxm/6B6qvF/heA== X-Received: by 2002:a65:6755:0:b0:41d:70c1:be0 with SMTP id c21-20020a656755000000b0041d70c10be0mr24234622pgu.99.1661334168420; Wed, 24 Aug 2022 02:42:48 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 28/51] tests/qtest: libqtest: Exclude the *_fds APIs for win32 Date: Wed, 24 Aug 2022 17:40:06 +0800 Message-Id: <20220824094029.1634519-29-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x534.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661337581506100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng libqmp.c::qmp_fd_vsend_fds() is not available on Windows, hence any APIs in libqtest that call libqmp.c::qmp_fd_vsend_fds() should be excluded for win32 too. This includes the following: * qtest_qmp_vsend_fds() * qtest_vqmp_fds() * qtest_qmp_fds() * qtest_qmp_add_client() Note qtest_qmp_vsend() was wrongly written to call qmp_fd_vsend_fds() previously, but it should call the non fds version API qmp_fd_vsend(). Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/libqtest.h | 8 ++++++++ tests/qtest/libqtest.c | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h index 94b187837d..3abc75964d 100644 --- a/tests/qtest/libqtest.h +++ b/tests/qtest/libqtest.h @@ -94,6 +94,7 @@ void qtest_kill_qemu(QTestState *s); */ void qtest_quit(QTestState *s); =20 +#ifndef _WIN32 /** * qtest_qmp_fds: * @s: #QTestState instance to operate on. @@ -108,6 +109,7 @@ void qtest_quit(QTestState *s); QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, ...) G_GNUC_PRINTF(4, 5); +#endif /* _WIN32 */ =20 /** * qtest_qmp: @@ -152,6 +154,7 @@ void qtest_qmp_send_raw(QTestState *s, const char *fmt,= ...) */ int qtest_socket_server(const char *socket_path); =20 +#ifndef _WIN32 /** * qtest_vqmp_fds: * @s: #QTestState instance to operate on. @@ -167,6 +170,7 @@ int qtest_socket_server(const char *socket_path); QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0); +#endif /* _WIN32 */ =20 /** * qtest_vqmp: @@ -181,6 +185,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t f= ds_num, QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0); =20 +#ifndef _WIN32 /** * qtest_qmp_vsend_fds: * @s: #QTestState instance to operate on. @@ -196,6 +201,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_li= st ap) void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0); +#endif /* _WIN32 */ =20 /** * qtest_qmp_vsend: @@ -743,6 +749,7 @@ void qtest_qmp_device_add_qdict(QTestState *qts, const = char *drv, void qtest_qmp_device_add(QTestState *qts, const char *driver, const char = *id, const char *fmt, ...) G_GNUC_PRINTF(4, 5); =20 +#ifndef _WIN32 /** * qtest_qmp_add_client: * @qts: QTestState instance to operate on @@ -752,6 +759,7 @@ void qtest_qmp_device_add(QTestState *qts, const char *= driver, const char *id, * Call QMP ``getfd`` followed by ``add_client`` with the given @fd. */ void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd); +#endif /* _WIN32 */ =20 /** * qtest_qmp_device_del: diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index b7b7c9c541..1b24a4f1f7 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -594,17 +594,20 @@ int qtest_socket_server(const char *socket_path) return sock; } =20 +#ifndef _WIN32 void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) { qmp_fd_vsend_fds(s->qmp_fd, fds, fds_num, fmt, ap); } +#endif =20 void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap) { - qmp_fd_vsend_fds(s->qmp_fd, NULL, 0, fmt, ap); + qmp_fd_vsend(s->qmp_fd, fmt, ap); } =20 +#ifndef _WIN32 QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) { @@ -613,6 +616,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t f= ds_num, /* Receive reply */ return qtest_qmp_receive(s); } +#endif =20 QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap) { @@ -622,6 +626,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_li= st ap) return qtest_qmp_receive(s); } =20 +#ifndef _WIN32 QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, ...) { @@ -633,6 +638,7 @@ QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fd= s_num, va_end(ap); return response; } +#endif =20 QDict *qtest_qmp(QTestState *s, const char *fmt, ...) { @@ -1329,6 +1335,7 @@ void qtest_qmp_device_add(QTestState *qts, const char= *driver, const char *id, qobject_unref(args); } =20 +#ifndef _WIN32 void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd) { QDict *resp; @@ -1348,6 +1355,7 @@ void qtest_qmp_add_client(QTestState *qts, const char= *protocol, int fd) g_assert(!qdict_haskey(resp, "error")); qobject_unref(resp); } +#endif =20 /* * Generic hot-unplugging test via the device_del QMP command. --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661338237; cv=none; d=zohomail.com; s=zohoarc; b=K5gRIu71G8DF9mfe1b0IjQx9qaiudEJ5h2XsLL0fYpsnJiYtycIYgoouTF4iggyx4YJllG3bmv6OwSOOo4KbGMDXkX6Vvhsywt0awojBoLVhgmwiXEPKQahJ3AVr+h6dQeDHQ9wy4R5umjL0x1TD/3z6Gx7H9Qti+u6PNzQmPy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661338237; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7B//sRlwmvr0NqRVKAmxDWMajm9GtHuIKBPMgzMp1rQ=; b=N04wGrwj5Ynp66gNiSTYIJ8O3iV/6Zm/sEFVahVk26QapMe/BJckV9UkENGOeM/ztNYfJK4AiqYP4iKxA9xUGf/EUBxpJb/bwiVKVDAy5LroYXsIoj2Mda1+Kxj08nxNVDquAyPz5tyYyo052vReSX29oXGoW7VDHUVvxdwtadU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166133823714432.288944046756455; Wed, 24 Aug 2022 03:50:37 -0700 (PDT) Received: from localhost ([::1]:45482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnxy-0005aH-TL for importer@patchew.org; Wed, 24 Aug 2022 06:50:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuT-0004GG-Kl for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:56 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:40815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuS-0001cB-0V for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:53 -0400 Received: by mail-pf1-x42e.google.com with SMTP id y141so15966782pfb.7 for ; Wed, 24 Aug 2022 02:42:51 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=7B//sRlwmvr0NqRVKAmxDWMajm9GtHuIKBPMgzMp1rQ=; b=S0LDz4mgG3iVYKSUqh8+rhpHR5eUZY1VYYnZPoaOrsumn1PE0EmZFMyKx3NxhW8ihB 1Can46UqFVM8RkPuA2tvnc5mTmGc6IAFRzhY6ShJv8JMOniVCBAluv2isa6xcyeBSKfp CwKz5zTrFfIvn/bNJQAKoWap/Ry7bEjV49UqABNRiAqxsj1KWIxovDo+Popu8UYagqu7 gSsb6BiZRShy90Vu5klhmTOckoQBL557N674mwRio3GfhLsaMzWjREKnPl1TFLlfeo70 b4LdBZ+eBArYgNav2tl8AcmYXEaIwvniP5uu5O+c5u87hUFTbYEcKK0oC7OVmN/T5R4B 4VlA== 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; bh=7B//sRlwmvr0NqRVKAmxDWMajm9GtHuIKBPMgzMp1rQ=; b=B9Dy/NfvtVnGHEWmrpWZxd9cGaipk0gW8Z/LhbCBkb8/iIZqrVBzD3LtwXm2uxhTTy aO0bcP6V2TdbkrMZvM36SspkTsYI14t9Nu2U2gydwIpqumuEMjTANmdqcQwlP0raw/g/ 1fuzPvK5XSl7pvWqxH/WB4EtW0HHuTd6L2pWD5xRCeWXTuO7YGxbsHGiwgDDa2Nfjcnq a24XO1XFSBtE8IFaP6g2bdrhQolJ62CB2hqnr0iRAwQYqfjNIOILidqV1ogrilTXIcXj 71E+43FN5IsekRimT874Mo0xUcHFahIuVYggielAwSZo1QeQJzr7ka7j0UlC4ts9vM6r 94ug== X-Gm-Message-State: ACgBeo20A1Ioh39LrNCWTXfL2NuY4ACZ51C4NF36BR3w60zWkbPDNk2L mE3G2BTlebbrVuHbQiLPW22veqAoK1M= X-Google-Smtp-Source: AA6agR4FJgKJn/DcSXVToENvx6SagYVahEUG2h4MSpz7/d7gAm+L+eYsxlbRl0QKf+xIESTfrBdUpg== X-Received: by 2002:a05:6a00:24d1:b0:537:2916:e1d with SMTP id d17-20020a056a0024d100b0053729160e1dmr3537906pfv.66.1661334170485; Wed, 24 Aug 2022 02:42:50 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 29/51] tests/qtest: libqtest: Install signal handler via signal() Date: Wed, 24 Aug 2022 17:40:07 +0800 Message-Id: <20220824094029.1634519-30-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=bmeng.cn@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661338237400100003 Content-Type: text/plain; charset="utf-8" From: Bin Meng At present the codes uses sigaction() to install signal handler with a flag SA_RESETHAND. Such usage can be covered by the signal() API that is a simplified interface to the general sigaction() facility. Update to use signal() to install the signal handler, as it is avaiable on Windows which we are going to support. Signed-off-by: Bin Meng --- tests/qtest/libqtest.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 1b24a4f1f7..70d7578740 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -68,7 +68,7 @@ struct QTestState QTestState *global_qtest; =20 static GHookList abrt_hooks; -static struct sigaction sigact_old; +static sighandler_t sighandler_old; =20 static int qtest_query_target_endianness(QTestState *s); =20 @@ -181,20 +181,12 @@ static void sigabrt_handler(int signo) =20 static void setup_sigabrt_handler(void) { - struct sigaction sigact; - - /* Catch SIGABRT to clean up on g_assert() failure */ - sigact =3D (struct sigaction){ - .sa_handler =3D sigabrt_handler, - .sa_flags =3D SA_RESETHAND, - }; - sigemptyset(&sigact.sa_mask); - sigaction(SIGABRT, &sigact, &sigact_old); + sighandler_old =3D signal(SIGABRT, sigabrt_handler); } =20 static void cleanup_sigabrt_handler(void) { - sigaction(SIGABRT, &sigact_old, NULL); + signal(SIGABRT, sighandler_old); } =20 static bool hook_list_is_empty(GHookList *hook_list) --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661338572; cv=none; d=zohomail.com; s=zohoarc; b=jnX5t12tCmg+myB3O5cwfRRPEX7FbeG+Fo5fVnTBkpD2EY3G9BXTIuEVsFc+rw/F+O8n7cG0CRpltewZLFn+xgeZDhzAS+K/m5UijyA5DxJixkkglOI3dZ2uDjRGql9hmEr9R5+M0bzt00AD9iWBO0irAPVD6i5Koy1MzKWh8wM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661338572; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sE4uin/5Bmc8/yGa6VCpnxa0hplMimzWw2M8gv5/mEQ=; b=NNKbDcToQEE9ecmcXINsve+5Bh3rlcbC6b1hXmD4OvcarBKsyvhD/y3IKNNr4acVMFOSabXSgAb58uAg0TYJKdg/zFCDC6mrIBGVTEOi6jxvNJjY5uqeM8RykySCVoAI2NAJnL7o4HcPknilbbUM1x1IKsx1NrpLQok8yFGd+d4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661338572529713.1104151871942; Wed, 24 Aug 2022 03:56:12 -0700 (PDT) Received: from localhost ([::1]:46066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQo3N-0003AB-AV for importer@patchew.org; Wed, 24 Aug 2022 06:56:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuW-0004H9-Tl; Wed, 24 Aug 2022 05:42:57 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:43528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuV-0001cf-9S; Wed, 24 Aug 2022 05:42:56 -0400 Received: by mail-pg1-x531.google.com with SMTP id v4so14530702pgi.10; Wed, 24 Aug 2022 02:42:54 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=sE4uin/5Bmc8/yGa6VCpnxa0hplMimzWw2M8gv5/mEQ=; b=fV1hODKhOZvakcFDKm461LeBn6X9stN3iz2YM9PxYQmpmn29VpVPGPBcOd4Kd5QUNI yMeMwKYr4eHe8luNoSBvtRMlzUhz2dNR3FEaUtUZ0WZYrMHxDvU/hlDRq6tl0U9iN3u8 LhZL6b/QSSkQLp0qOYCEc4V87KPLliXiQIwl/31BvLcFcDharzzqQbiLNF9V048xTN+j 6x99p4LYHVCP682xu716wOzfYReZ52TovFs05XT0kJBWJIg3YGOzAm2Rtctf8HbXR+oE nF6IJ0DIJjvPZZv4SKSU1ibwXDyB/L0zNGp8qQ4s66yjqTt7OOE84VDvCjNK9+zFkiz3 zcUQ== 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; bh=sE4uin/5Bmc8/yGa6VCpnxa0hplMimzWw2M8gv5/mEQ=; b=MEVfcLJyKDgisvy02G0Enyt7wKaMNIaYJ+iXZdbanjkqnM6ZL61Go2Nl71F+KRb4I8 8x12m7RGPrPoIhR9npXl7tLPOvWkiHG2ysdD2EqjPlAV3eYE2e4Gvkzi9ch3iaVc6i8p 6asfWhcDzU32HTus6Lmy4cXXxYVfixaUKJbdT7ryV8rypG8yABWgLVKActlfNFZpFP1M kZDSQ5hWAfsY1ZSRyk6xUkrREYHXhzdruHubDRt5xuAQ6c+HbW2/+tHDs3TEqHYUA1fC stIjwjmCoObv1M1VJQutzUOqqcTQzWYxfmYa2z4UGQk1PkiWMlYEPsz9xv7VxVNNc6tP 6V1w== X-Gm-Message-State: ACgBeo31Qd2TcdZeJxy4dfnNbdfGcYB4JWVa+bMlDfSs5tcWqI5rKLDc /qEVBjxdN7uh+yuI+ZlCPl/XXht0pQY= X-Google-Smtp-Source: AA6agR6rZkHeHlGQXKdzSxISjnNBYsPTX5eqpxcAX8FqaIhEPaQP3uY/1HZW/G9r1dCM33evv7zbuw== X-Received: by 2002:a05:6a00:180b:b0:536:816b:f770 with SMTP id y11-20020a056a00180b00b00536816bf770mr15277423pfa.3.1661334173373; Wed, 24 Aug 2022 02:42:53 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Hanna Reitz , Kevin Wolf , Laurent Vivier , Paolo Bonzini , Thomas Huth , qemu-block@nongnu.org Subject: [PATCH 30/51] tests: Skip iotests and qtest when '--without-default-devices' Date: Wed, 24 Aug 2022 17:40:08 +0800 Message-Id: <20220824094029.1634519-31-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x531.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661338574392100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng When QEMU is configured with '--without-default-devices', we should not build and run iotests and qtest because devices used by these test cases are not built in. Signed-off-by: Bin Meng --- tests/qemu-iotests/meson.build | 5 +++++ tests/qtest/meson.build | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build index 323a4acb6a..38d9a874d2 100644 --- a/tests/qemu-iotests/meson.build +++ b/tests/qemu-iotests/meson.build @@ -2,6 +2,11 @@ if not have_tools or targetos =3D=3D 'windows' or get_opti= on('gprof') subdir_done() endif =20 +# Skip iotests if configured without a default selection of devices +if not get_option('default_devices') + subdir_done() +endif + foreach cflag: config_host['QEMU_CFLAGS'].split() if cflag.startswith('-fsanitize') and \ not cflag.contains('safe-stack') and not cflag.contains('cfi-icall') diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index c97da5a062..0291b3966c 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -4,6 +4,11 @@ if not config_host.has_key('CONFIG_POSIX') subdir_done() endif =20 +# Skip QTests if configured without a default selection of devices +if not get_option('default_devices') + subdir_done() +endif + slow_qtests =3D { 'ahci-test' : 60, 'bios-tables-test' : 120, --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661338053; cv=none; d=zohomail.com; s=zohoarc; b=Zb05txZ3tdh3pcIksM9qf+gCblQ6glGsubOh7uLzvcSWCUGZytbXi3opC3J8coyQY8AnJuz83QXhuC1lswsqLWlbMwqtNQsTatjyhRDseDXMf/3gMKJwoTEdhVJBX+AqKAW1CJS4YNXgSH1LVAqEAMQ/UAgzZhypXP49tAy93hk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661338053; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CPsT8yKW9uSm1LoqvEpj4UnWFz4dPJ5OToB007xj8tE=; b=Nb+UWCe3nCrRmo0svJTYMbUVh6jxdYEDQ37lRI/OM6ylvYhuxT99MM3qKp7GTgQAh5zFw3c+TaiUpIJzw+Szou3HK6+5tnlfP1Yh3W/lYssOk5Lvl/oM5r5VAt38yBHfhZvCCk+mpojbDWkS+w2bH/H7jtV2waUKOrZ7fD9CG7Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661338053579240.9783201969832; Wed, 24 Aug 2022 03:47:33 -0700 (PDT) Received: from localhost ([::1]:36460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnv2-00024I-8E for importer@patchew.org; Wed, 24 Aug 2022 06:47:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuZ-0004Jf-3d for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:00 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:36369) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuW-0001br-VF for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:42:58 -0400 Received: by mail-pg1-x534.google.com with SMTP id s206so14562498pgs.3 for ; Wed, 24 Aug 2022 02:42:56 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=CPsT8yKW9uSm1LoqvEpj4UnWFz4dPJ5OToB007xj8tE=; b=CqPR1+QBNs+cQpCW93zLh+SOdajgwCxnaqA9hceFY+/lJmFoP7+tPsOHgyKirwNDwY WZK1ys112Q0XVK0HsBf5xLwSJECbQSKiqLLEVyCytsDrer3fIGWsVFURNnp7Tl1OOpy5 ZA0Vo7zU/QOhWeaXKMDLKFUkMFY5yFXFepXVQ0LmlijMXIW9TpMUXk+Y6pcF5z6JcfBC YPyhJrRTipe0e9SB/ixPSHwpq1wITpcwP7yIMeXyRNTHpKhfltsbB3xbdBw7St2t1vf8 SX1lv09fABlssEXHKnMTitdt8ATpkmYtJGbjipHTGHDDmbKCC+WImoAPBQiwDVJdPnG5 QjRw== 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; bh=CPsT8yKW9uSm1LoqvEpj4UnWFz4dPJ5OToB007xj8tE=; b=iDFj7rVEJxzQOPEUbbS9U7KMBo9jAPeq/tDdhfa4fHwyM4YfQSHUHa9DUxbAxg+XCi Fli2CmyojUaOP/cVUgWv5BeUO2qfeCf27UjwEXelLmPLRd8GLe0w1E05zP77NIYZ8zr7 f92D1JJKcFtiDwzxrdzu0+jk+SN8UR6e5TH8c+B31N+EXGc/A9t/ow+JoLmunpCQcgnG puYJ7AHpgJoa93zLTrREu/ZuPVPqB61hE30HzdwmFt1acPShgCUfQ1kUeNYmUw4Kqlof K6n3sR9vBcC2XwbWfuM8KgfHhUHWEz8P8VwxPTbNjoWXQgcMhgCZxPakgGvlNTc8Q09F WKGg== X-Gm-Message-State: ACgBeo36bmZN9LMQy9OvbUHfAbrX7yrrCHHiVOlQSXWiZJb/Y5O129D1 ACIQn3YUsiKX9QlPXpHOvg1OJup+oek= X-Google-Smtp-Source: AA6agR4rjqEu1PIXZWh6c8j5VqyAUg3JTCPKQVlTXI8dlRxYGUpr5/CA81YbyDX1N21B/CSGxAbsQg== X-Received: by 2002:a63:d16:0:b0:41d:fe52:1d2f with SMTP id c22-20020a630d16000000b0041dfe521d2fmr24011424pgl.416.1661334175932; Wed, 24 Aug 2022 02:42:55 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Xuzhou Cheng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 31/51] tests/qtest: Support libqtest to build and run on Windows Date: Wed, 24 Aug 2022 17:40:09 +0800 Message-Id: <20220824094029.1634519-32-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x534.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661338054181100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng At present the libqtest codes were written to depend on several POSIX APIs, including fork(), kill() and waitpid(). Unfortunately these APIs are not available on Windows. This commit implements the corresponding functionalities using win32 native APIs. With this change, all qtest cases can build successfully on a Windows host, and we can start qtest testing on Windows now. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- tests/qtest/libqtest.c | 101 +++++++++++++++++++++++++++++++++++++++- tests/qtest/meson.build | 5 +- 2 files changed, 101 insertions(+), 5 deletions(-) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 70d7578740..99e52ff571 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -16,9 +16,11 @@ =20 #include "qemu/osdep.h" =20 +#ifndef _WIN32 #include #include #include +#endif /* _WIN32 */ #ifdef __linux__ #include #endif /* __linux__ */ @@ -27,6 +29,7 @@ #include "libqmp.h" #include "qemu/ctype.h" #include "qemu/cutils.h" +#include "qemu/sockets.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qjson.h" #include "qapi/qmp/qlist.h" @@ -35,6 +38,16 @@ #define MAX_IRQ 256 #define SOCKET_TIMEOUT 50 =20 +#ifndef _WIN32 +# define CMD_EXEC "exec " +# define DEV_STDERR "/dev/fd/2" +# define DEV_NULL "/dev/null" +#else +# define CMD_EXEC "" +# define DEV_STDERR "2" +# define DEV_NULL "nul" +#endif + typedef void (*QTestSendFn)(QTestState *s, const char *buf); typedef void (*ExternalSendFn)(void *s, const char *buf); typedef GString* (*QTestRecvFn)(QTestState *); @@ -68,6 +81,9 @@ struct QTestState QTestState *global_qtest; =20 static GHookList abrt_hooks; +#ifdef _WIN32 +typedef void (*sighandler_t)(int); +#endif static sighandler_t sighandler_old; =20 static int qtest_query_target_endianness(QTestState *s); @@ -120,10 +136,18 @@ bool qtest_probe_child(QTestState *s) pid_t pid =3D s->qemu_pid; =20 if (pid !=3D -1) { +#ifndef _WIN32 pid =3D waitpid(pid, &s->wstatus, WNOHANG); if (pid =3D=3D 0) { return true; } +#else + DWORD exit_code; + GetExitCodeProcess((HANDLE)pid, &exit_code); + if (exit_code =3D=3D STILL_ACTIVE) { + return true; + } +#endif s->qemu_pid =3D -1; } return false; @@ -137,13 +161,23 @@ void qtest_set_expected_status(QTestState *s, int sta= tus) void qtest_kill_qemu(QTestState *s) { pid_t pid =3D s->qemu_pid; +#ifndef _WIN32 int wstatus; +#else + DWORD ret, exit_code; +#endif =20 /* Skip wait if qtest_probe_child already reaped. */ if (pid !=3D -1) { +#ifndef _WIN32 kill(pid, SIGTERM); TFR(pid =3D waitpid(s->qemu_pid, &s->wstatus, 0)); assert(pid =3D=3D s->qemu_pid); +#else + TerminateProcess((HANDLE)pid, s->expected_status); + ret =3D WaitForSingleObject((HANDLE)pid, INFINITE); + assert(ret =3D=3D WAIT_OBJECT_0); +#endif s->qemu_pid =3D -1; } =20 @@ -151,6 +185,7 @@ void qtest_kill_qemu(QTestState *s) * Check whether qemu exited with expected exit status; anything else = is * fishy and should be logged with as much detail as possible. */ +#ifndef _WIN32 wstatus =3D s->wstatus; if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) !=3D s->expected_status= ) { fprintf(stderr, "%s:%d: kill_qemu() tried to terminate QEMU " @@ -167,6 +202,16 @@ void qtest_kill_qemu(QTestState *s) __FILE__, __LINE__, sig, signame, dump); abort(); } +#else + GetExitCodeProcess((HANDLE)pid, &exit_code); + CloseHandle((HANDLE)pid); + if (exit_code !=3D s->expected_status) { + fprintf(stderr, "%s:%d: kill_qemu() tried to terminate QEMU " + "process but encountered exit status %ld (expected %d)\n", + __FILE__, __LINE__, exit_code, s->expected_status); + abort(); + } +#endif } =20 static void kill_qemu_hook_func(void *s) @@ -245,6 +290,38 @@ static const char *qtest_qemu_binary(void) return qemu_bin; } =20 +#ifdef _WIN32 +static pid_t qtest_create_process(char *cmd) +{ + STARTUPINFO si; + PROCESS_INFORMATION pi; + BOOL ret; + + ZeroMemory(&si, sizeof(si)); + si.cb =3D sizeof(si); + ZeroMemory(&pi, sizeof(pi)); + + ret =3D CreateProcess(NULL, /* module name */ + cmd, /* command line */ + NULL, /* process handle not inheritable */ + NULL, /* thread handle not inheritable */ + FALSE, /* set handle inheritance to FALSE */ + 0, /* No creation flags */ + NULL, /* use parent's environment block */ + NULL, /* use parent's starting directory */ + &si, /* pointer to STARTUPINFO structure */ + &pi /* pointer to PROCESS_INFORMATION structur= e */ + ); + if (ret =3D=3D 0) { + fprintf(stderr, "%s:%d: unable to create a new process (%s)\n", + __FILE__, __LINE__, strerror(GetLastError())); + abort(); + } + + return (pid_t)pi.hProcess; +} +#endif /* _WIN32 */ + QTestState *qtest_init_without_qmp_handshake(const char *extra_args) { QTestState *s; @@ -272,6 +349,9 @@ QTestState *qtest_init_without_qmp_handshake(const char= *extra_args) unlink(socket_path); unlink(qmp_socket_path); =20 +#ifdef _WIN32 + socket_init(); +#endif sock =3D init_socket(socket_path); qmpsock =3D init_socket(qmp_socket_path); =20 @@ -280,7 +360,7 @@ QTestState *qtest_init_without_qmp_handshake(const char= *extra_args) =20 qtest_add_abrt_handler(kill_qemu_hook_func, s); =20 - command =3D g_strdup_printf("exec %s %s" + command =3D g_strdup_printf(CMD_EXEC "%s %s" "-qtest unix:%s " "-qtest-log %s " "-chardev socket,path=3D%s,id=3Dchar0 " @@ -289,7 +369,7 @@ QTestState *qtest_init_without_qmp_handshake(const char= *extra_args) "%s" " -accel qtest", qemu_binary, tracearg, socket_path, - getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/nu= ll", + getenv("QTEST_LOG") ? DEV_STDERR : DEV_NULL, qmp_socket_path, extra_args ?: ""); =20 @@ -298,6 +378,7 @@ QTestState *qtest_init_without_qmp_handshake(const char= *extra_args) s->pending_events =3D NULL; s->wstatus =3D 0; s->expected_status =3D 0; +#ifndef _WIN32 s->qemu_pid =3D fork(); if (s->qemu_pid =3D=3D 0) { #ifdef __linux__ @@ -320,6 +401,9 @@ QTestState *qtest_init_without_qmp_handshake(const char= *extra_args) execlp("/bin/sh", "sh", "-c", command, NULL); exit(1); } +#else + s->qemu_pid =3D qtest_create_process(command); +#endif /* _WIN32 */ =20 g_free(command); s->fd =3D socket_accept(sock); @@ -338,9 +422,19 @@ QTestState *qtest_init_without_qmp_handshake(const cha= r *extra_args) s->irq_level[i] =3D false; } =20 + /* + * Stopping QEMU for debugging is not supported on Windows. + * + * Using DebugActiveProcess() API can suspend the QEMU process, + * but gdb cannot attach to the process. Using the undocumented + * NtSuspendProcess() can suspend the QEMU process and gdb can + * attach to the process, but gdb cannot resume it. + */ +#ifndef _WIN32 if (getenv("QTEST_STOP")) { kill(s->qemu_pid, SIGSTOP); } +#endif =20 /* ask endianness of the target */ =20 @@ -393,6 +487,9 @@ QTestState *qtest_init_with_serial(const char *extra_ar= gs, int *sock_fd) g_assert_true(g_mkdtemp(sock_dir) !=3D NULL); sock_path =3D g_strdup_printf("%s/sock", sock_dir); =20 +#ifdef _WIN32 + socket_init(); +#endif sock_fd_init =3D init_socket(sock_path); =20 qts =3D qtest_initf("-chardev socket,id=3Ds0,path=3D%s -serial chardev= :s0 %s", diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 0291b3966c..6d469a1822 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -1,6 +1,5 @@ -# All QTests for now are POSIX-only, but the dependencies are -# really in libqtest, not in the testcases themselves. -if not config_host.has_key('CONFIG_POSIX') +# Build all QTests for POSIX and Windows +if not config_host.has_key('CONFIG_POSIX') and not config_host.has_key('CO= NFIG_WIN32') subdir_done() endif =20 --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661335670; cv=none; d=zohomail.com; s=zohoarc; b=I7n3LP3vqfqSEgckStw17IsQ4a0QNqIWVo+ScwEK5K2bIUVl4/0BIZueXRE2PmzLjd0ADlMJ4fdUT9X2sl0+E2a1Cx8ulCJtb3/9qXHAEF7M7raaLbEYX9cb6EerH6Bt0v116VyoREX90rGQ7GKdWFRy6fy6DzI3PnfrGMMw6h0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661335670; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fh5IADzLChmDjxkrpWsCj8Fs3Tnsz/cyvb/BerXAflg=; b=b3Akvi3GyP0xWbVy8UIlGZ8OFElcjlTTEMw3yF/1a75ggVvd5oksMqsqJZJMdOR0uuzMYK9XfNj+LcxLftPewyiH1jTkfLVHy6hu3GOvPHRLPvE6QvcO//4HfR5+Pf/sXrDgqCE7Onyt+6odP/5L693tmYslaNYZbTHaqccLUiE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661335669935577.8499098630483; Wed, 24 Aug 2022 03:07:49 -0700 (PDT) Received: from localhost ([::1]:44492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnIa-00036j-Ly for importer@patchew.org; Wed, 24 Aug 2022 06:07:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuc-0004MQ-TF; Wed, 24 Aug 2022 05:43:03 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:54853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmua-0001ef-Jq; Wed, 24 Aug 2022 05:43:01 -0400 Received: by mail-pj1-x1029.google.com with SMTP id bf22so16490340pjb.4; Wed, 24 Aug 2022 02:42:59 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:42:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Fh5IADzLChmDjxkrpWsCj8Fs3Tnsz/cyvb/BerXAflg=; b=LqblTMxq3Mc6jUl5h8nnSzgNibYFICp8fZsnoRN19X1eqDPQIKuenoldw82V/ni8du jJckz9Yx1U4bfRebjJUN9lxoKP7x4ajA+IGd6ZgJgQQ88BQJ4DMOvg8Pe0zla7tciQzH 8eP2bsnAcoqn0eHjZanLP5A2CTeM78ZmYnOnW60WfNs/YNRJ6gzYYn9wCjKxBi1q1/zy 336xswD8TUW21oI+M79kW+6DbwvgiPkCBLDNRDVwS13S4x8jKsyBcjRyfhQt7ep+cgVd SDOwRW8181J2pLmG8I+pWHjDWov+cMnIUnJxc7ijTHtFWn91zNeo2F6Iwgma6YJVrMz3 4cxA== 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; bh=Fh5IADzLChmDjxkrpWsCj8Fs3Tnsz/cyvb/BerXAflg=; b=SZKxcrSk3IwfmIfO5SpJ24vXs06hC+UnkuEAXVM6mWa4MfxVdYYdwespmQAVenW/Y4 D9HPNAbCTybKaZfKXb6OopXskkdRjPmJwevNsDAXHckkejrisHLBC5WIfECsRn53eCdG UeGi8AM1trHCl3aa3mCvTRw5lwWitvhfVcP/GVV0JODrSv8u9Ahp1NRYNwXCg9h6CtEB pZoAOzxalVyJm5IDawKQ6bCvMwikb1NG4EVDq8jlfRkWVUU9bTclPlp9hmAzvqqCz4+S PRbeQ7k7pFJOy8mAjJU3MS1GkYFXdQeTk+qhQLmBcXcp4ydlJ7jtti1u46M2wuFJR/Hd LnSg== X-Gm-Message-State: ACgBeo2yhqdNKslQCUSs+IfMBF2XhTnsmkFvUULBwjkEVPYir82TevgB QHLMVF5x2PULUeHZS4lMI+ASVzQFmNM= X-Google-Smtp-Source: AA6agR4rIQOiAg2O2QvH0ykk9DKb2bOB3N3VoYE7fp6sDLNSeafa4RG4CcjKoXk9BXSGR0RSDa0HUw== X-Received: by 2002:a17:902:ea12:b0:172:de75:bc7b with SMTP id s18-20020a170902ea1200b00172de75bc7bmr15835560plg.25.1661334178803; Wed, 24 Aug 2022 02:42:58 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , John Snow , Laurent Vivier , Paolo Bonzini , Thomas Huth , qemu-block@nongnu.org Subject: [PATCH 32/51] tests/qtest: Fix ERROR_SHARING_VIOLATION for win32 Date: Wed, 24 Aug 2022 17:40:10 +0800 Message-Id: <20220824094029.1634519-33-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x1029.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661335672047100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng On Windows, the MinGW provided mkstemp() API opens the file with exclusive access, denying other processes to read/write the file. Such behavior prevents the QEMU executable from opening the file, (e.g.: CreateFile returns ERROR_SHARING_VIOLATION). This can be fixed by closing the file and reopening it. Signed-off-by: Bin Meng --- tests/qtest/ahci-test.c | 14 ++++++++++++++ tests/qtest/boot-serial-test.c | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index f26cd6f86f..0e88cd0eef 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -1443,6 +1443,20 @@ static int prepare_iso(size_t size, unsigned char **= buf, char **name) int fd =3D mkstemp(cdrom_path); =20 g_assert(fd !=3D -1); +#ifdef _WIN32 + /* + * On Windows, the MinGW provided mkstemp() API opens the file with + * exclusive access, denying other processes to read/write the file. + * Such behavior prevents the QEMU executable from opening the file, + * (e.g.: CreateFile returns ERROR_SHARING_VIOLATION). + * + * Close the file and reopen it. + */ + close(fd); + fd =3D open(cdrom_path, O_WRONLY); + g_assert(fd !=3D -1); +#endif + g_assert(buf); g_assert(name); patt =3D g_malloc(size); diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index 404adcfa20..fb6c81bf35 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -235,6 +235,19 @@ static void test_machine(const void *data) =20 ser_fd =3D mkstemp(serialtmp); g_assert(ser_fd !=3D -1); +#ifdef _WIN32 + /* + * On Windows, the MinGW provided mkstemp() API opens the file with + * exclusive access, denying other processes to read/write the file. + * Such behavior prevents the QEMU executable from opening the file, + * (e.g.: CreateFile returns ERROR_SHARING_VIOLATION). + * + * Close the file and reopen it. + */ + close(ser_fd); + ser_fd =3D open(serialtmp, O_RDONLY); + g_assert(ser_fd !=3D -1); +#endif =20 if (test->kernel) { code =3D test->kernel; --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661338661320469.21637176774254; Wed, 24 Aug 2022 03:57:41 -0700 (PDT) Received: from localhost ([::1]:44900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQo4q-0006EY-AS for importer@patchew.org; Wed, 24 Aug 2022 06:57:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuh-0004NX-2R; Wed, 24 Aug 2022 05:43:07 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:40598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmud-0001f8-Pr; Wed, 24 Aug 2022 05:43:05 -0400 Received: by mail-pl1-x632.google.com with SMTP id x23so15191752pll.7; Wed, 24 Aug 2022 02:43:03 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=/VLZ6dLEwhi2chftBh37GSy19Wuab6YAYmjufo6q520=; b=VLCeVfQ0VlrSUdv/RbrmfZbWOD/r6Nj51yvPcKqsi2UruZ2hwydXU/z8gByVOX6EHA A4tnnOP1BnTubE5yyNy8Fx+SsOBFpQT4LzhVv0RCqP85oWcYV6vKjTFmaVlNKDmdr98j UQx10XLhTsSn/BkUtxolKgFxuLfcTym4mxuFOnDEaeoTLk6f4tWGY+OB+vtczzCU5suh lfVZMbvg42/BLgLie+pEmgHWnpMiRjeht7FMxutQ7geJQgTEZd2Vr65z0KWhJfQSo4Fy dt88w2jlb+jgTaxr/o7Y9kBXV2vGy4rXp2G7Ph0CniiLMXbspdfwncc7IcJUUZLBZCu0 J0Lg== 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; bh=/VLZ6dLEwhi2chftBh37GSy19Wuab6YAYmjufo6q520=; b=T2eU6c0nVH/ZlHqEPpmw3fJoWU8kmfDA0XfRvNKzywAuL0NiQ7s/QstDGuBQ0cP06w uP/JPKhCYhSd0PnQ7OTDfIW/rJx1GcBEWCIUAqjiWOCLzP1bNLD5o3nvBbKBmlQBWD6E ZMXX/TwG4zPdlH6q7zw9CoavAWayfbVBpYaH3lyKmKTUG9OR9c2uAol+xDi5xJEGLFtW XC0oolqNEoKNIw5P5CVFE6OCO6HN9UUcJiXyuovnVnbPylhCLIN+GWhvztu99godEdYH Y6hLuvh+DAlScO/OcDSJH+3E3wPode7JgsnuEqJkRvLLIOff3RjGpx67Pmp88Y505+kU Mtbw== X-Gm-Message-State: ACgBeo1efpU98k1HNGzM6vWErfzAHz2uk0SkH7BvcYLlJcLhKZs9hkBI XaKJ47UeiLSMI+XeyBrP9VKJxWQrXx8= X-Google-Smtp-Source: AA6agR4Yh9tytQwZIx+V6LzE1S5IiFITxtOROjx6UWm1XchsDbdFiQlfjC6vDYybCOxDcw3N8IJv9Q== X-Received: by 2002:a17:902:7783:b0:173:11e6:a580 with SMTP id o3-20020a170902778300b0017311e6a580mr3219028pll.10.1661334181357; Wed, 24 Aug 2022 02:43:01 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , John Snow , Laurent Vivier , Paolo Bonzini , Thomas Huth , qemu-block@nongnu.org Subject: [PATCH 33/51] tests/qtest: {ahci, ide}-test: Use relative path for temporary files Date: Wed, 24 Aug 2022 17:40:11 +0800 Message-Id: <20220824094029.1634519-34-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x632.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1661338661804100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng These test cases uses "blkdebug:path/to/config:path/to/image" for testing. On Windows, absolute file paths contain the delimiter ':' which causes the blkdebug filename parser fail to parse filenames. Signed-off-by: Bin Meng --- tests/qtest/ahci-test.c | 19 ++++++++++++++++--- tests/qtest/ide-test.c | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index 0e88cd0eef..bce9ff770c 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -1848,7 +1848,7 @@ static void create_ahci_io_test(enum IOMode type, enu= m AddrMode addr, =20 int main(int argc, char **argv) { - const char *arch; + const char *arch, *base; int ret; int fd; int c; @@ -1886,8 +1886,21 @@ int main(int argc, char **argv) return 0; } =20 + /* + * "base" stores the starting point where we create temporary files. + * + * On Windows, this is set to the relative path of current working + * directory, because the absolute path causes the blkdebug filename + * parser fail to parse "blkdebug:path/to/config:path/to/image". + */ +#ifndef _WIN32 + base =3D g_get_tmp_dir(); +#else + base =3D "."; +#endif + /* Create a temporary image */ - tmp_path =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); + tmp_path =3D g_strdup_printf("%s/qtest.XXXXXX", base); fd =3D mkstemp(tmp_path); g_assert(fd >=3D 0); if (have_qemu_img()) { @@ -1905,7 +1918,7 @@ int main(int argc, char **argv) close(fd); =20 /* Create temporary blkdebug instructions */ - debug_path =3D g_strdup_printf("%s/qtest-blkdebug.XXXXXX", g_get_tmp_d= ir()); + debug_path =3D g_strdup_printf("%s/qtest-blkdebug.XXXXXX", base); fd =3D mkstemp(debug_path); g_assert(fd >=3D 0); close(fd); diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index ebbf8e0126..c5cad6c0be 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -1011,17 +1011,31 @@ static void test_cdrom_dma(void) =20 int main(int argc, char **argv) { + const char *base; int fd; int ret; =20 + /* + * "base" stores the starting point where we create temporary files. + * + * On Windows, this is set to the relative path of current working + * directory, because the absolute path causes the blkdebug filename + * parser fail to parse "blkdebug:path/to/config:path/to/image". + */ +#ifndef _WIN32 + base =3D g_get_tmp_dir(); +#else + base =3D "."; +#endif + /* Create temporary blkdebug instructions */ - debug_path =3D g_strdup_printf("%s/qtest-blkdebug.XXXXXX", g_get_tmp_d= ir()); + debug_path =3D g_strdup_printf("%s/qtest-blkdebug.XXXXXX", base); fd =3D mkstemp(debug_path); g_assert(fd >=3D 0); close(fd); =20 /* Create a temporary raw image */ - tmp_path =3D g_strdup_printf("%s/qtest.XXXXXX", g_get_tmp_dir()); + tmp_path =3D g_strdup_printf("%s/qtest.XXXXXX", base); fd =3D mkstemp(tmp_path); g_assert(fd >=3D 0); ret =3D ftruncate(fd, TEST_IMAGE_SIZE); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661339090; cv=none; d=zohomail.com; s=zohoarc; b=VR8iNC8Jf9/eEfRwK/YhhEIj3OCx0mtwHfUrZa7kNoAhGIbRF7/goQLlw9FtMin7KiTfkeRlgGxyioymZf8t5mLpXw7u/c8IphSntXS1L8Bk0F/ox1NW9eOD8yDrGsrBPqna1rdDOdacAGARLYMc8JFVZINl0gKMU1iM+c45qpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661339090; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4Ic8Dewm4aoDrdRLw64oIo7eHOUzBmGaQZ6sE0IwdOY=; b=hPhmfC9eGzJAubQcj/GSflV8loG0CvyK6r+SzQe6ktBBbq5036XDiOx0o0q0R+8pt30D4Xc6Lf0e+4FE/qeffv2SnPxCCSc9wTWRGufPMuBGQdAaE5PXrrRj3ypLaMusxaAUA01tZJXkTYFc+GxpRTXE3rCS9mz2O1wiHXNa0Wk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661339089971141.586974347754; Wed, 24 Aug 2022 04:04:49 -0700 (PDT) Received: from localhost ([::1]:44134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQoBl-0004kg-0H for importer@patchew.org; Wed, 24 Aug 2022 07:04:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmui-0004OX-Jj for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:11 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:34555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuf-0001fP-TA for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:08 -0400 Received: by mail-pl1-x633.google.com with SMTP id io24so1899648plb.1 for ; Wed, 24 Aug 2022 02:43:05 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=4Ic8Dewm4aoDrdRLw64oIo7eHOUzBmGaQZ6sE0IwdOY=; b=jG/wQsD1ovlMBd/EBk/jX9hepGicoP4nWz+DY6uHIk1H44ND8LxPeRRcSBvbd8VoZb X6Qonji6B7yGhM4DcVSQypJ9f2bwgS2LJhL0DGjYNjXDv6KxlcGB26PjZeWgabgSnmeD oiflKc3H3KSyhKidgrfV13HlO+bNaT0ar2iCNtgdPWwSMf9xUnubmQtrNmSykMobKotY NVYA9iP3kcldspF2PKe5wFrhJFI+YMYJn2WF7gZj6WAkZe2LIjyda98m4smUFrYPkbJA H0OzxreYNl4/5uDmrEeJUKpFFQRlAIN3mfn8kZVrWZBDwkhBfPtC2zZzmxuLfxgkH5sU d+2A== 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; bh=4Ic8Dewm4aoDrdRLw64oIo7eHOUzBmGaQZ6sE0IwdOY=; b=ql2yJ5qeukelJbai+TAFY+W/sHkuvrAXqvG/4nh8hAM5PrVCgqpC1mpe1Nvq8uU/e7 RrsIXAt95lThv04VFgP+KgTuzX3F6NaqbU96mM67g+By7zZv9QxqCeCA846zNQqpAUa4 ut7r5UJtJ+ZSiwhYVhX5aTYXNXRAJkJgcq7Xon28A/KXMk+WIkk5+cY4E+2aL9PkLsKG uvczecK5tbrJG0Pu8vlnwkXPXUONeQuIAEs6y9iasjxuo7ZxGgEHUstw5Ar7pOUycrD3 6rFXl8Ns+BG45ICTebWQpFLwEw5We3DB/rbgjT0Yqq4qmi2rjoTsXT2nD91oOvW5yto4 V/ZA== X-Gm-Message-State: ACgBeo1WLlGpKkr5trATPIY+i9dCVu5Rgk17b/ps1cFemBjvTyPAU0TT dvUzbtVv8hxvewR0mHzJaRYOiD/UNeU= X-Google-Smtp-Source: AA6agR50nKWKX3hEzItpGrCI8zzpBfI0Wn0y2+eoW4OOUGLgaDo9no/QXSzsdSc4wF6KhP2bapc59w== X-Received: by 2002:a17:902:bd49:b0:172:df88:8981 with SMTP id b9-20020a170902bd4900b00172df888981mr15553890plx.120.1661334183799; Wed, 24 Aug 2022 02:43:03 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Ani Sinha , Igor Mammedov , "Michael S. Tsirkin" Subject: [PATCH 34/51] tests/qtest: bios-tables-test: Adapt the case for win32 Date: Wed, 24 Aug 2022 17:40:12 +0800 Message-Id: <20220824094029.1634519-35-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x633.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661339091557100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Single quotes in the arguments (oem_id=3D'CRASH ') are not removed in the Windows environment before it is passed to the QEMU executable. The space in the argument causes the "-acpitable" option parser to think that all of its parameters are done, hence it complains: '-acpitable' requires one of 'data' or 'file' Change to use double quotes which works fine on all platforms. Also /dev/null does not work on win32, and nul should be used. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/bios-tables-test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 36783966b0..0148ce388c 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1615,6 +1615,12 @@ static void test_acpi_virt_viot(void) free_test_data(&data); } =20 +#ifndef _WIN32 +# define DEV_NULL "/dev/null" +#else +# define DEV_NULL "nul" +#endif + static void test_acpi_q35_slic(void) { test_data data =3D { @@ -1622,9 +1628,9 @@ static void test_acpi_q35_slic(void) .variant =3D ".slic", }; =20 - test_acpi_one("-acpitable sig=3DSLIC,oem_id=3D'CRASH ',oem_table_id=3D= 'ME'," - "oem_rev=3D00002210,asl_compiler_id=3D'qemu'," - "asl_compiler_rev=3D00000000,data=3D/dev/null", + test_acpi_one("-acpitable sig=3DSLIC,oem_id=3D\"CRASH \",oem_table_id= =3DME," + "oem_rev=3D00002210,asl_compiler_id=3Dqemu," + "asl_compiler_rev=3D00000000,data=3D" DEV_NULL, &data); free_test_data(&data); } --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661339044; cv=none; d=zohomail.com; s=zohoarc; b=EYs7BA6SQU2OeHIGwGK8qga5pVbgvujY1nKI5c/b8GZQxpM7+CdPr10w6r9MQNG4gnGZ9aBlW+Qrn839OiBanPCJx5LzmUVzLUPWRuGlTOf3+e+1JC2r8SiXyWWYQyrzMpiFEP/EXsrzpZnHlte3gviAUUrqvan7p30h/0HqUY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661339044; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=u98oOh2RZJczW5UAcqsVUjAFpgf7KCCG68fKfAs85dg=; b=gxhQKiQyft8htUqiweBG7iY0VVNpEWzb3BmTjhYP3pRQgEjCHvJnT32ETRowu1uSI3NJurD4h/r8Cld874cB0YJyj01R99z4OEhJDW2jYgwqgnraJdrfYfhKbznMccdSZUBoBkh3QiiSyO0FLDdLkonR7uNF7wiCIoyuEUiXzdE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661339044527326.04974581827344; Wed, 24 Aug 2022 04:04:04 -0700 (PDT) Received: from localhost ([::1]:45884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQoB0-0003pm-Kt for importer@patchew.org; Wed, 24 Aug 2022 07:04:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmui-0004OZ-Sg for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:11 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:38517) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuh-0001ft-Co for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:08 -0400 Received: by mail-pf1-x433.google.com with SMTP id y127so13000933pfy.5 for ; Wed, 24 Aug 2022 02:43:07 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=u98oOh2RZJczW5UAcqsVUjAFpgf7KCCG68fKfAs85dg=; b=ADokp7IbBe6sNqDoaeIH5+IGs35wZ6xDjqAdtOZhmV+TEBqYAtJRKETCLPwUC7xS// MRlX21bpUa5fQynBeS/tGiK2Tg38i9ge/+egam5S2VOHkGILfg4sk5AmqFf6QG2KOHuz QFQKYn8rQ4dhsvCuEvU1ErLig8pRIqaQZshJJ9AUG4xiFYxfutcL41zwD7TkiQhIVnEJ xahE2swvNzOEljkje5qOhJfd4vBaaC2IbnyxzjeDsqR7JGtDPVZLDETrmpPU4ehwWL5k 4HeSuftdKqjcjSa1J0ZDfecpDmU7xXR0+oiCXJjAe5sSJyVR7I8DarI+vSSzWGjLWyhR iC8w== 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; bh=u98oOh2RZJczW5UAcqsVUjAFpgf7KCCG68fKfAs85dg=; b=IHXJFICynPem4fglxMzSwNz9FOrJi6IchCfvh9NA3nzcON1v9pVStA/HwyGh0jK+Ph sBqb+skjmArXv8kXbfjNmDvrUdu8ZSH5Sr3SyXFQMU9ooQW8jckEHHpfXkWeoRpNM1Cc eMbDyW8qMbdto9yV55oKi8NnbWsn9mQAf39JL4gCWX6jJ6c+JiR3WBz1RaCj2RIm5I9l hh4oU1y7CdaMoP4qMCpSRIHn4ivfcOf3+m37FD03W3vQ+awBPq2JuaSVz6qs6LprtMdJ C+YQ+bifCGWL3XZiBy5SV3W39dU0mbmlS8luTXLyoRDDIQgFLxUNqRyUDOPC9b5mhXjI rBwA== X-Gm-Message-State: ACgBeo2zjiP1cjsAmoSRvXWV+6Scuh2iNR5vqaquHzjPPEBCSZs1mxjo q6dYrnCLf4tu1spoNvXdv37as9o8hMo= X-Google-Smtp-Source: AA6agR7npptidhh5bxOO7LDgFmActNzUSNI0cpOBCLF05bODydPEdxRuPELPaHebGnwhhn60AgymUg== X-Received: by 2002:a63:3509:0:b0:42b:15a6:8267 with SMTP id c9-20020a633509000000b0042b15a68267mr2453122pga.570.1661334185942; Wed, 24 Aug 2022 02:43:05 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 35/51] tests/qtest: device-plug-test: Reverse the usage of double/single quotes Date: Wed, 24 Aug 2022 17:40:13 +0800 Message-Id: <20220824094029.1634519-36-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=bmeng.cn@gmail.com; helo=mail-pf1-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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661339046798100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng The usage of double/single quotes in test_pci_unplug_json_request() should be reversed to work on both win32 and non-win32 platforms: - The value of -device parameter needs to be surrounded by "" as Windows does not drop '' when passing it to QEMU which causes QEMU command line option parser failure. - The JSON key/value pairs need to be surrounded by '' to make the JSON parser happy on Windows. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- tests/qtest/device-plug-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c index 2e3137843e..a1fb99c8ff 100644 --- a/tests/qtest/device-plug-test.c +++ b/tests/qtest/device-plug-test.c @@ -95,7 +95,7 @@ static void test_pci_unplug_json_request(void) } =20 QTestState *qtest =3D qtest_initf( - "%s -device '{\"driver\": \"virtio-mouse-pci\", \"id\": \"dev0\"}'= ", + "%s -device \"{'driver': 'virtio-mouse-pci', 'id': 'dev0'}\"", machine_addition); =20 /* --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661336009; cv=none; d=zohomail.com; s=zohoarc; b=mxujGhSM9FUmPSVIjYXpmUtTxdPB8CpsfsjdrMO8udK6GOU/vA8c4Tfs7DJdRicz3CighPHuzG8FJZfqksMin75uUfqXrVA3lb8zrCI7wmXuQ/X4O1ZZ/FcHD8FUPLnwxym4f7Cvx3Veg06/Vu+kuMN/rvWXH2+uvHksNOu5PV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661336009; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0zcu0n9LW86iNDYo0FnxWs0JURAtkjxHBse1nGh+orQ=; b=C+J6c6Xl1re69pORFa9p82WylokGXY8GAM6rhiucJgEUyXDCyxPNHX3uxiiBbyE2qJB48FlMh1XVrbsBZhOEH7+waxu7NbSL2Vv3l/BuIiCYX4LWp1bKAoqk5DR4YT12i47DRJCEWmWLg7xOhu4lkcaxuI8Aeb92OZCQ2hkAgGc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336009953874.4958453197283; Wed, 24 Aug 2022 03:13:29 -0700 (PDT) Received: from localhost ([::1]:34564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnO4-0000Zu-SV for importer@patchew.org; Wed, 24 Aug 2022 06:13:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmul-0004Og-5m for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:11 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:38518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuj-0001h0-Ki for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:10 -0400 Received: by mail-pf1-x434.google.com with SMTP id y127so13001004pfy.5 for ; Wed, 24 Aug 2022 02:43:09 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=0zcu0n9LW86iNDYo0FnxWs0JURAtkjxHBse1nGh+orQ=; b=jAwRr3TJdj3E6aVSq0FR8RTUwDndv30CUAf843Oedit4lvZXFumH0KMAJ9Qme4LYFI tX9CMpf4P09Nef4WvMHk6ma6jrQf1SzyWdjhGUbxjgnGJYcAP+ktcc8tuB5qFWSU5OUa pUdBm4AA1a1uOB6K8sVoE4qBg/3BvmOcCqF0+jBIHUwNKhP1hWXJIA9BR/ofgh2dgg1p vwXMLh4dQVv8kcvkOx/CPKagLBsdNY7h9wex1EyF4PJ9QFCJ1jz5aR89X6JOSCfl2WOY fiqbbAQ9JPiSzD3j7umzxAiRpx6HvbExhd+DUdH1Y3Lr9YUeWrsBMw5AUS1FRdvJvrXQ wm6Q== 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; bh=0zcu0n9LW86iNDYo0FnxWs0JURAtkjxHBse1nGh+orQ=; b=rqTYVsDjhZM/GqNrPltV7tqvnHmZaaIFHP9yINqSzJjsLJ33DhpVZoFVuwTttuWV9E Uj9v7IULFrzGAK1u1mGpNXsGuKIdMUcMo9UjZilZ91MmoC11GfhqsyeXapiUv92hdj4x 3FrLbn7X/JtW7ZsF3cT7Lj9/94Qe9BkPM8V+DNr1aUIhqbpbpGHChN+wGmecXDFj/KJe ZeUdNgpM6t0mXWGxBcccB48/y/wY1LxMQhLT7PKt9xje4sj5z1DZQKeuBAoB/18EtoaE Tr6KteFekajMNU/K8lYcYktz/Iicy/enCMESBUIsjMuXc6d9oP1RcrkUe6LV5SHRhjYZ eKxg== X-Gm-Message-State: ACgBeo0ADgJvGe/CxKvlpZPe5TQ+HaL6rWLwqER6xewOb7X07XEkB9Bj cvI52fzZQwp75hre8EEMCUfL9ofwMpU= X-Google-Smtp-Source: AA6agR5q/NqyG0wSZNYTpwWW43l0RKmfKOF48j5KkwZP3MokFVf/vXIjLwIsga03EQJpzZXl++xalA== X-Received: by 2002:a63:5912:0:b0:42a:dcc6:210d with SMTP id n18-20020a635912000000b0042adcc6210dmr7470279pgb.50.1661334187964; Wed, 24 Aug 2022 02:43:07 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 36/51] tests/qtest: machine-none-test: Use double quotes to pass the cpu option Date: Wed, 24 Aug 2022 17:40:14 +0800 Message-Id: <20220824094029.1634519-37-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=bmeng.cn@gmail.com; helo=mail-pf1-x434.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661336010253100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Single quotes in the arguments (e.g.: -cpu 'qemu64,apic-id=3D0') are not removed in the Windows environment before it is passed to the QEMU executable. Such argument causes a failure in the QEMU CPU option parser codes. Change to use double quotes which works fine on all platforms. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- tests/qtest/machine-none-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/machine-none-test.c b/tests/qtest/machine-none-tes= t.c index f92fab479f..31cc0bfb01 100644 --- a/tests/qtest/machine-none-test.c +++ b/tests/qtest/machine-none-test.c @@ -81,7 +81,7 @@ static void test_machine_cpu_cli(void) " add it to cpus_map\n", arch); return; /* TODO: die here to force all targets have a test */ } - qts =3D qtest_initf("-machine none -cpu '%s'", cpu_model); + qts =3D qtest_initf("-machine none -cpu \"%s\"", cpu_model); =20 response =3D qtest_qmp(qts, "{ 'execute': 'quit' }"); g_assert(qdict_haskey(response, "return")); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661336365; cv=none; d=zohomail.com; s=zohoarc; b=myAiHW2V3aY7KwUfqFWXqQE5Ck8qqraT7KEMjc8yFzOikYL76HZm0F7+al1gBijx0/e2RMXReBoR2U5rEdT6og0Pg6TPXZ6O2Znw14M6fJ2eIVLXklar0GKlLrRxHzm/k2nhOKvAFxrqeS3U/zKvgLcXKddKiMsGuuH2hHF4Z/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661336365; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hUl0ynk/tFixZOGM/lQ3GUXaTY7tp/lhfNkZoNncHPk=; b=gpNycAjSi4cpQrL+NEn5fkpCnp6N8HQk5Ycw4rPiU8SRfEWrYKzb087BeaWLqWijVcWoin86u3+8TxFPGH4XnadfrQAsWTDGpzc+oW8S3KpBvH4V+FUklQDvPgqRJWG4lqZklL9Nu9Zf0OSCXeTASKMYL9dtLjg2CQbIsyblj78= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336365136385.6468826258413; Wed, 24 Aug 2022 03:19:25 -0700 (PDT) Received: from localhost ([::1]:49480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnTo-0006Ku-3O for importer@patchew.org; Wed, 24 Aug 2022 06:19:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmun-0004Qn-Tk for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:16 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:45013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmum-0001jM-3s for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:13 -0400 Received: by mail-pj1-x1032.google.com with SMTP id r15-20020a17090a1bcf00b001fabf42a11cso950691pjr.3 for ; Wed, 24 Aug 2022 02:43:11 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=hUl0ynk/tFixZOGM/lQ3GUXaTY7tp/lhfNkZoNncHPk=; b=EF9AIrePmYD2JceHt4BGbq+PRGTpecsKp+p6fyNfxYUsb+huoFjrZxf2xFbPfr0M/l prgyKNVmXTWE2/JQ04ZzlwUtEIsCODPgqLoHZDJGZ9OAnmDNEjw8PJAQ6KMIggcnZYJt jkCHqFGdUkWwUgvU1Q+UzTB8R0Cj4qzIo9Qpxi9Nqp8ryT1D/X82hX0Xnr/3UROmoG/F ZuHrdOMwNECJEYBxXOjA7w1zEgvSF5QXARXWUYcjrPgZ3NiJhw+sWZcAkT3wC5UArhPM hDVsbMG6hMZSvxsx9SGDI1vw8kYeWbC2GuJLlcdyyvdWDC9/tK4VRrO1UtWHghaGY3rq /rkA== 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; bh=hUl0ynk/tFixZOGM/lQ3GUXaTY7tp/lhfNkZoNncHPk=; b=LO4tn0wLk39rExv4yEWuF8H59gtkID0PJ9ZOIZfKhXP1x4bP7n7w2uJXSr7HlvQSw5 bMSCauh+DIjG5uTzZ0FR4yYvifedgPiHYZZfVJgM5rkbfn+BvkcOXVSD/tpr2rfNflBb E78ehbPG6t+JMpFfBhLtLBaaDo8FKd44Kns4IzbJiw7LVfW7gxTZBTfVGZRK6seOZT+O vuJYf7UOZAgZ3wPwHpnvT7esdrJwlyo7CMVjH7tosGvk7clVxMsv66rzLYKklP78C2fE ODPiE6leovv4dbrLfiZ4sCRxyyIefvIjHq33VvozaSJdKY0AKcyVNRKG8r7aq465k263 Vm5A== X-Gm-Message-State: ACgBeo0YN89H967uKVslOIr7ICbquesLKPj/mFu+7OE1gIU6hysKrEjd Dylsm+N0li2EvubxfTgCjcEqJsl07Jw= X-Google-Smtp-Source: AA6agR7rlNgKaUJlakGO1/J0so4uMaqd860TscxMeD9DxwvESwDi7a0+sWjPk2Z5WX6e8oVfcLkYYw== X-Received: by 2002:a17:90b:378a:b0:1fa:f716:a427 with SMTP id mz10-20020a17090b378a00b001faf716a427mr7573477pjb.153.1661334190406; Wed, 24 Aug 2022 02:43:10 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , "Dr. David Alan Gilbert" , Juan Quintela , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 37/51] tests/qtest: migration-test: Disable IO redirection for win32 Date: Wed, 24 Aug 2022 17:40:15 +0800 Message-Id: <20220824094029.1634519-38-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x1032.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661336365563100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng On Windows the QEMU executable is created via CreateProcess() and IO redirection does not work, so we need to set MigrateStart::hide_stderr to false to disable adding IO redirection to the command line. Signed-off-by: Bin Meng --- tests/qtest/migration-test.c | 39 +++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 2ae7498d5d..125d48d855 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -53,6 +53,17 @@ static bool uffd_feature_thread_id; */ #define DIRTYLIMIT_TOLERANCE_RANGE 25 /* MB/s */ =20 +/* + * On Windows the QEMU executable is created via CreateProcess() and IO + * redirection does not work, so we need to set MigrateStart::hide_stderr + * to false to disable adding IO redirection to the command line. + */ +#ifndef _WIN32 +# define HIDE_STDERR true +#else +# define HIDE_STDERR false +#endif + #if defined(__linux__) #include #include @@ -1186,7 +1197,7 @@ static void test_postcopy_recovery_common(MigrateComm= on *args) g_autofree char *uri =3D NULL; =20 /* Always hide errors for postcopy recover tests since they're expecte= d */ - args->start.hide_stderr =3D true; + args->start.hide_stderr =3D HIDE_STDERR; =20 if (migrate_postcopy_prepare(&from, &to, args)) { return; @@ -1287,7 +1298,7 @@ static void test_postcopy_preempt_all(void) static void test_baddest(void) { MigrateStart args =3D { - .hide_stderr =3D true + .hide_stderr =3D HIDE_STDERR }; QTestState *from, *to; =20 @@ -1410,7 +1421,7 @@ static void test_precopy_unix_tls_x509_default_host(v= oid) g_autofree char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); MigrateCommon args =3D { .start =3D { - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }, .connect_uri =3D uri, .listen_uri =3D uri, @@ -1526,7 +1537,7 @@ static void test_precopy_tcp_tls_psk_mismatch(void) { MigrateCommon args =3D { .start =3D { - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }, .listen_uri =3D "tcp:127.0.0.1:0", .start_hook =3D test_migrate_tls_psk_start_mismatch, @@ -1564,7 +1575,7 @@ static void test_precopy_tcp_tls_x509_mismatch_host(v= oid) { MigrateCommon args =3D { .start =3D { - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }, .listen_uri =3D "tcp:127.0.0.1:0", .start_hook =3D test_migrate_tls_x509_start_mismatch_host, @@ -1590,7 +1601,7 @@ static void test_precopy_tcp_tls_x509_hostile_client(= void) { MigrateCommon args =3D { .start =3D { - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }, .listen_uri =3D "tcp:127.0.0.1:0", .start_hook =3D test_migrate_tls_x509_start_hostile_client, @@ -1616,7 +1627,7 @@ static void test_precopy_tcp_tls_x509_reject_anon_cli= ent(void) { MigrateCommon args =3D { .start =3D { - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }, .listen_uri =3D "tcp:127.0.0.1:0", .start_hook =3D test_migrate_tls_x509_start_reject_anon_client, @@ -1747,7 +1758,7 @@ static void test_validate_uuid_error(void) MigrateStart args =3D { .opts_source =3D "-uuid 11111111-1111-1111-1111-111111111111", .opts_target =3D "-uuid 22222222-2222-2222-2222-222222222222", - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }; =20 do_test_validate_uuid(&args, true); @@ -1757,7 +1768,7 @@ static void test_validate_uuid_src_not_set(void) { MigrateStart args =3D { .opts_target =3D "-uuid 22222222-2222-2222-2222-222222222222", - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }; =20 do_test_validate_uuid(&args, false); @@ -1767,7 +1778,7 @@ static void test_validate_uuid_dst_not_set(void) { MigrateStart args =3D { .opts_source =3D "-uuid 11111111-1111-1111-1111-111111111111", - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }; =20 do_test_validate_uuid(&args, false); @@ -1990,7 +2001,7 @@ static void test_multifd_tcp_tls_psk_mismatch(void) { MigrateCommon args =3D { .start =3D { - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }, .listen_uri =3D "defer", .start_hook =3D test_migrate_multifd_tcp_tls_psk_start_mismatch, @@ -2038,7 +2049,7 @@ static void test_multifd_tcp_tls_x509_mismatch_host(v= oid) */ MigrateCommon args =3D { .start =3D { - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }, .listen_uri =3D "defer", .start_hook =3D test_migrate_multifd_tls_x509_start_mismatch_host, @@ -2062,7 +2073,7 @@ static void test_multifd_tcp_tls_x509_reject_anon_cli= ent(void) { MigrateCommon args =3D { .start =3D { - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }, .listen_uri =3D "defer", .start_hook =3D test_migrate_multifd_tls_x509_start_reject_anon_cl= ient, @@ -2088,7 +2099,7 @@ static void test_multifd_tcp_tls_x509_reject_anon_cli= ent(void) static void test_multifd_tcp_cancel(void) { MigrateStart args =3D { - .hide_stderr =3D true, + .hide_stderr =3D HIDE_STDERR, }; QTestState *from, *to, *to2; QDict *rsp; --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661339401; cv=none; d=zohomail.com; s=zohoarc; b=AKlKf1v6pLIQ6J0xthh6Wrp3VNLVMyj3rRn0ZDbA95fPIGtEf2aiit6WuoZeHv/tfC8QeHeqehFVTLojtQtNDiJ+Qr6KDsqUipsprEyv17FEXtKQBqWRVVr4q5tvMol/067HM3mKoGjCMWYxgOmgf7ckh4DRzoTSXPgWXzmeZWk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661339401; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eEoKxp42Yd3WBOROS2c0qiQDyg/EAnV+AW6xakgUti4=; b=kjXvUMlkoOPAJ/eeedJWfwpjbvFzIymzqxb9P9qLJPBdMtk+SuFAQ2kVg7+ndsAi2N3NF6nC/kaORwtzPJLhE/xTUfDYoDHReCKNaNUCohaynOL7VUgwlIJr1B/pHEBnw7Da+Wd82SmgV1en1yJ43KmWhUJvM+4jt+AxKA4OEeY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661339401520179.3332924502878; Wed, 24 Aug 2022 04:10:01 -0700 (PDT) Received: from localhost ([::1]:40864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQoGm-00022t-HR for importer@patchew.org; Wed, 24 Aug 2022 07:10:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmur-0004Qv-7y; Wed, 24 Aug 2022 05:43:19 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:42714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuo-0001kK-QI; Wed, 24 Aug 2022 05:43:16 -0400 Received: by mail-pg1-x536.google.com with SMTP id q63so310853pga.9; Wed, 24 Aug 2022 02:43:14 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=eEoKxp42Yd3WBOROS2c0qiQDyg/EAnV+AW6xakgUti4=; b=VBq3AAQqrP8uyu8gEHd6zVduVlv5Ef+ui/ZaK/yoS01xBZkfkrfB599Al+MK154LGr BZ/YC88oX42d3ShsrSfa7VcVx/cZcsYESbfCAgWkMC1rdcqbXVHh5wQlDwz41QlXs+++ YxrEC7cyBhY9iyDftLFX5S2RZVFUAO2RGKX6XN1Mrg1HIk1FwTOKGsrPiEK/7TOyepNe OoykRdEsyE4n+m2AcKDGsQ1oVezGmqOQNBJ1oju3r8EwRtR0672jX3X3FeV7eS5UEbpv S+FktJ2wGxzZV3WyMb3iBywP18dt7BDAsE/Y8kaeIVTOs7IPCuUO2caObQICxpandBgn 4cwg== 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; bh=eEoKxp42Yd3WBOROS2c0qiQDyg/EAnV+AW6xakgUti4=; b=BAUFO3aqYf3a1+kmIvUSwaXB6CX+mUf0CBUEi+nkIGzZ0WKqDQ1X+68kRQ1HOHfyl1 RioyckEjdVYO47jiBWkF3RK6yMm/3WWnnb/0rX8rhbQdYsua+mPZTamqY+q4iXPFJYPr JUdRtce7BCDsmJQ5r4Y0E89UB82+FIgYfTrA7sjPjyMnwS0oGJozWDKKrM7jbJNE5D3/ y6JBHyipHvjWHjFuRyyhRVJa6dhj42kUkH48opN+gJKajGtP0RMGabx9yBn2QI6d6CTE rG5CbO7hObqavI++4pPJU0DOGdJsb6z7UyeuqD1bsmRU6kQ/Km0NSsz2Hx7kwdkKlfqP 1DnQ== X-Gm-Message-State: ACgBeo275WcJd3vc49n0sZ0NsPDL0of8RO95kcyjeY/KLEt01gMJcr9I 6/g86+XwzN19Fo+XL+oD9NQo8NPaFo8= X-Google-Smtp-Source: AA6agR7xNemF/2rVM3wx90IZYhfUNqRdR8Tbsqs9yvCnWdWSUsBtlzX6r1sK1NIr4hYOcTm5evluhQ== X-Received: by 2002:a65:6d9a:0:b0:41c:c77:7b6 with SMTP id bc26-20020a656d9a000000b0041c0c7707b6mr24403796pgb.139.1661334193051; Wed, 24 Aug 2022 02:43:13 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , John Snow , Laurent Vivier , Paolo Bonzini , Thomas Huth , qemu-block@nongnu.org Subject: [PATCH 38/51] tests/qtest: {ahci,ide}-test: Open file in binary mode Date: Wed, 24 Aug 2022 17:40:16 +0800 Message-Id: <20220824094029.1634519-39-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x536.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661339403745100001 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng By default Windows opens file in text mode, while a POSIX compliant implementation treats text files and binary files the same. The fopen() 'mode' string can include the letter 'b' to indicate binary mode shall be used. POSIX spec says the character 'b' shall have no effect, but is allowed for ISO C standard conformance. Let's add the letter 'b' which works on both POSIX and Windows. Similar situation applies to the open() 'flags' where O_BINARY is used for binary mode. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/ahci-test.c | 2 +- tests/qtest/ide-test.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index bce9ff770c..be11508c75 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -1453,7 +1453,7 @@ static int prepare_iso(size_t size, unsigned char **b= uf, char **name) * Close the file and reopen it. */ close(fd); - fd =3D open(cdrom_path, O_WRONLY); + fd =3D open(cdrom_path, O_WRONLY | O_BINARY); g_assert(fd !=3D -1); #endif =20 diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index c5cad6c0be..ee03dea4fa 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -892,7 +892,7 @@ static void cdrom_pio_impl(int nblocks) =20 /* Prepopulate the CDROM with an interesting pattern */ generate_pattern(pattern, patt_len, ATAPI_BLOCK_SIZE); - fh =3D fopen(tmp_path, "w+"); + fh =3D fopen(tmp_path, "wb+"); ret =3D fwrite(pattern, ATAPI_BLOCK_SIZE, patt_blocks, fh); g_assert_cmpint(ret, =3D=3D, patt_blocks); fclose(fh); @@ -993,7 +993,7 @@ static void test_cdrom_dma(void) prdt[0].size =3D cpu_to_le32(len | PRDT_EOT); =20 generate_pattern(pattern, ATAPI_BLOCK_SIZE * 16, ATAPI_BLOCK_SIZE); - fh =3D fopen(tmp_path, "w+"); + fh =3D fopen(tmp_path, "wb+"); ret =3D fwrite(pattern, ATAPI_BLOCK_SIZE, 16, fh); g_assert_cmpint(ret, =3D=3D, 16); fclose(fh); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661339740; cv=none; d=zohomail.com; s=zohoarc; b=jTFhUTqsWMN79fWbQXC3TwkhpXGSFxv2NSBkwd2dl8jTA7G3sbHIWR/kGy25TGx2GZ0NgbTlH+ciQwoqY5NMG3edrsZQMqvbh6PLjPWeduk0bnWRlRsP+NGtU87zVEaXCuLMg1iqD9cdC1H4ngjrO77rNkJYHRS99LXR0Igyq4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661339740; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EOFKHiRmcE74HgecgSGAabnZE3vUv0bvhkBrDlb0U9A=; b=OB1QOJjKoxYNGyG8jFFLC2m4zwdDmrKbBq1mvS143s5a0oKvqRnHxjDw6rm9C72P5fWV+BhXjXQiSer+6yewPSr/vlOwJHq8AGp+GhLdS5pRrOLbEBayQuquem5yffsHfFmKa/LZLp4We0VFfI3dhNWoctQGb3a7h9fOCTbv/Ik= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661339740462598.8286544322781; Wed, 24 Aug 2022 04:15:40 -0700 (PDT) Received: from localhost ([::1]:60716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQoMF-0000Ev-2n for importer@patchew.org; Wed, 24 Aug 2022 07:15:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmut-0004RZ-UR for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:23 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:35489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuq-0001lq-Q9 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:18 -0400 Received: by mail-pl1-x634.google.com with SMTP id y4so15195427plb.2 for ; Wed, 24 Aug 2022 02:43:16 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=EOFKHiRmcE74HgecgSGAabnZE3vUv0bvhkBrDlb0U9A=; b=nyLGNG/k8QKO0L9U3XkOZOlFQivxUx6Hz8G6QKP+yFtbDDmLV7blKQmbLXQ+IlGZWT EIXAn+7AGT/fC+V0q0m0mAFNJvLEygu2a7YzJGVrRaV35QaJQhQW+6BARRdcz/3jE+L2 ESiN+e7WHUm+6DAdvwNF/V04ZqS3fUQgaaFy2299NrcyYCqVyU9Rp3q0k5ee+vxcdmO1 MMFfGU5v6N6URy3kwGs1f3N0prKvDfNerlnuTDWyQDmo5LTmxZdOUGYFPvbhhcF7uqxt yeM1+R3WkLcUCC+iQjYQHRJyUdzabHH/BRe5XcbI1dgFAQIHkDD6NIzdX1Ddm9+OiLeU rkrw== 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; bh=EOFKHiRmcE74HgecgSGAabnZE3vUv0bvhkBrDlb0U9A=; b=PQh1DIKdypBz9+2h4yETfIa0eJqZ+zkkJxiARXkSATkQ+OivUcNsct88laUYLEEHom MUlE/TA0+maGC5xbH4+pvDNCloSeT6TMVIsVA2JdzGq3fav9Hty+WhRyvZ6Io1ypfR1j stATWkqHRJZNWOvP2+39SmL8sg1yJO6cVMwaJ8y8/FJdVNXEAm3M2OguKUFeiLbwAbxd LMsbZWra1BgMzcHVvIpe/CipAI0qpj2P1RnTgpgXE6YEhsR848UmDL9owRxATcIixOP5 CAqJwRNd5aAf7rj7MYxJy+qZMZk5WFhwEuPljP7ImFWjwPT1um0+X8KQNt6aROeEpfFV xMRg== X-Gm-Message-State: ACgBeo1AAVfjGNldFNn/E4l/da0GYZkfPSFDq/Ej3fuLe7ov8fHoVtqf El057MlssLKmh7qfDMHggGIVgy8TcYk= X-Google-Smtp-Source: AA6agR6KtzTvp5fnDoEd/kUeMWOU3ajThweLYJ/BWEtVANY8QmJeUSMZD3FJyZwB8pZw4j42uIFdhg== X-Received: by 2002:a17:90a:d982:b0:1fb:aec:e8db with SMTP id d2-20020a17090ad98200b001fb0aece8dbmr7317472pjv.148.1661334195215; Wed, 24 Aug 2022 02:43:15 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 39/51] tests/qtest: virtio-net-failover: Disable migration tests for win32 Date: Wed, 24 Aug 2022 17:40:17 +0800 Message-Id: <20220824094029.1634519-40-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x634.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661339743171100001 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng These tests use the exec migration protocol, which is unsupported on Windows as of today. Disable these tests for now. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- tests/qtest/virtio-net-failover.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-fai= lover.c index 443ee56de9..4a809590bf 100644 --- a/tests/qtest/virtio-net-failover.c +++ b/tests/qtest/virtio-net-failover.c @@ -588,6 +588,7 @@ static void test_hotplug_2_reverse(void) machine_stop(qts); } =20 +#ifndef _WIN32 static QDict *migrate_status(QTestState *qts) { QDict *resp, *ret; @@ -1827,6 +1828,7 @@ static void test_multi_in(gconstpointer opaque) =20 machine_stop(qts); } +#endif /* _WIN32 */ =20 int main(int argc, char **argv) { @@ -1857,7 +1859,11 @@ int main(int argc, char **argv) qtest_add_func("failover-virtio-net/hotplug/2_reverse", test_hotplug_2_reverse); =20 - /* migration tests */ +#ifndef _WIN32 + /* + * These migration tests cases use the exec migration protocol, + * which is unsupported on Windows. + */ qtest_add_data_func("failover-virtio-net/migrate/on/out", tmpfile, test_migrate_out); qtest_add_data_func("failover-virtio-net/migrate/on/in", tmpfile, @@ -1886,6 +1892,7 @@ int main(int argc, char **argv) tmpfile, test_multi_out); qtest_add_data_func("failover-virtio-net/migrate/multi/in", tmpfile, test_multi_in); +#endif /* _WIN32 */ =20 ret =3D g_test_run(); =20 --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661336696; cv=none; d=zohomail.com; s=zohoarc; b=cifQMMdYCm8O5wVcIyGLMx2dpiBjyJ4astN+Lmit+UzPeWjcEubDOXecs9DtfsV5axs4h067iZPaggqo+Eh8jJ2OT3+mw8UeQe964ljPJwq4Bql4QI9XHUQyG5QWuQHs0IHMS5KLtiFvnYgHzl3FUHitMEjRar4jHAjwsktlO0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661336696; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=paTY5YEP1jsreKma1QR+zPm4bWzf2LxlFPbO3yVctjg=; b=cpHjyiYAV0036O52f1fg4ec8pN3ebTvf3TisyViEQ+M0pw0fRWc3aywYQxQspwWboS+JHKrfTDxQLKPayb4XVeSlirskCpvjJ267W0McrVd6dJRky/HfaKPVk6wBt3h9YzQE/TbmGQeRmtagz8Y0Zz+NpiOpFKTEZF6pwnJKxXI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661336696657224.77778627573332; Wed, 24 Aug 2022 03:24:56 -0700 (PDT) Received: from localhost ([::1]:39606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnZ9-0003em-FZ for importer@patchew.org; Wed, 24 Aug 2022 06:24:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmux-0004Rh-2S for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:24 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:34755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmut-0001mg-Mr for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:21 -0400 Received: by mail-pg1-x52e.google.com with SMTP id 12so14559970pga.1 for ; Wed, 24 Aug 2022 02:43:18 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=paTY5YEP1jsreKma1QR+zPm4bWzf2LxlFPbO3yVctjg=; b=Tfd0/b2IXE9rDdRsV2eAJrgw/Z7ZClGxrdyqYWfsTtUJv2/Luw7dCdEsidgAb12sFO 6PvwjO3hPjix1ZA/2PnK43cE8ClL88t6uKu1aUxIkIuWYDZko/QOyUrispBSNOvsxUn0 fIg949JaNCA204JUfKbppItwJWdBa4LQNVQLpt+HYuEOJx50yWDfhuvugL+p3wOhpwgR bVUeUkrYGzOtu6DWc31mCXQS0Cgi+Ex1sQ28fuHyP9y3HOpjbn2HyKNODYtlBKTw+OLp kmAh1V6Oi0ed4FvuQdxggIn5iCDfCLqTWlHiVONyJ5qMXfNnEwn6xDCIVoJYGa4LT3X+ i1iQ== 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; bh=paTY5YEP1jsreKma1QR+zPm4bWzf2LxlFPbO3yVctjg=; b=iuKfZ+17byTuKqF1/A+QqqiK/HE4yOFNWXxn2X+DEhDvn9wDQi4KYbmBL5pXks0cVM FaC8Oiow2B7J4xQBI5gqVrkMsD0LN7f6wRqfnDq32jxletdX5kaXkth+SI8JRzOHK6JF /IWHmmeDkWo+Tj0LfbnDtMj45+tT5PBo5RTTs4qxjvo9Vr6QEafwbF7xKrtxgdJtaDAF mpy5twDaSUAddxSjKcisRmOO09A9O70nrXeXEt3K89w/l5qKMW5fx+OVjOTbgWuiGTjl dD0XAZr+EYC8S0UEpF77QwnsrkfJpBj6FNmeGXgiHiFcxm6hKHwDtAL/Mbzpli17bB80 leNQ== X-Gm-Message-State: ACgBeo0GP92JTq8C6v/MqFKgvXnRDuSw6xaLbAFkT9U8yBLJdfMjYu8U Vz19F4w9/aZwallLQpkhv2aTDF6WnK4= X-Google-Smtp-Source: AA6agR7SAPzNS16io4sRXRVvDvfVpzFuYgcjDArHoCPwHchiIlN8E9IFExstYkptRzQ8OpcRb+fo3Q== X-Received: by 2002:a62:38d4:0:b0:536:3cde:4d07 with SMTP id f203-20020a6238d4000000b005363cde4d07mr21804166pfa.66.1661334197213; Wed, 24 Aug 2022 02:43:17 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini Subject: [PATCH 40/51] chardev/char-file: Add FILE_SHARE_WRITE when openning the file for win32 Date: Wed, 24 Aug 2022 17:40:18 +0800 Message-Id: <20220824094029.1634519-41-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x52e.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661336697302100003 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng The combination of GENERIC_WRITE and FILE_SHARE_READ options does not allow the same file to be opened again by CreateFile() from another QEMU process with the same options when the previous QEMU process still holds the file handle openned. As per [1] we should add FILE_SHARE_WRITE to the share mode to allow such use case. This change makes the behavior be consisten with the POSIX platforms. [1] https://docs.microsoft.com/en-us/windows/win32/fileio/creating-and-open= ing-files Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- chardev/char-file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chardev/char-file.c b/chardev/char-file.c index 2fd80707e5..66385211eb 100644 --- a/chardev/char-file.c +++ b/chardev/char-file.c @@ -60,8 +60,8 @@ static void qmp_chardev_open_file(Chardev *chr, flags =3D CREATE_ALWAYS; } =20 - out =3D CreateFile(file->out, accessmode, FILE_SHARE_READ, NULL, flags, - FILE_ATTRIBUTE_NORMAL, NULL); + out =3D CreateFile(file->out, accessmode, FILE_SHARE_READ | FILE_SHARE= _WRITE, + NULL, flags, FILE_ATTRIBUTE_NORMAL, NULL); if (out =3D=3D INVALID_HANDLE_VALUE) { error_setg(errp, "open %s failed", file->out); return; --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661337121; cv=none; d=zohomail.com; s=zohoarc; b=CP1l5i4eruS3KE7EaW0ew8+FlGqTwIXMlsnRHur5gxW1UPVwvI2ZCLMoUjckrunaIu3xjgzm/mgJgpyDqqMJn54flqQb2O4JTJgszRrpS+tcaKzFh3yMa7nHQiSx3wzecfmp3OSuH0VzywfF0WkTC2ew2TTCgfL5mqUBhs0d8jA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661337121; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gaj+hsFra3tAAn41KvUkD6S/64I4IDGVCSXdBoXHO4Y=; b=ITywvn8uWVMfFf4UlviYp+lLnapkf4VjDdbktL3Cy+yZ5LVwZjHMF74G/1xmqEmhYl4ZEkp7T/4wLhicN8fIVZlMijDmJUihpzv8l750/I7gZy94r6EHNxf4XQi6N+i9CYjMKQmvlmSiwIMwNly/SI+zbfdQQOmmtr3qAOotdRc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661337121007326.3722438641398; Wed, 24 Aug 2022 03:32:01 -0700 (PDT) Received: from localhost ([::1]:37038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnfy-0001Ot-Rj for importer@patchew.org; Wed, 24 Aug 2022 06:31:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmuz-0004SJ-AQ for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:26 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:38680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuv-0001nk-A1 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:23 -0400 Received: by mail-pl1-x630.google.com with SMTP id x19so15188906plc.5 for ; Wed, 24 Aug 2022 02:43:20 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=gaj+hsFra3tAAn41KvUkD6S/64I4IDGVCSXdBoXHO4Y=; b=VUtrICafBqG5XkXx5nGmzMDoekmJWM/zvT+7TEVeQwS6I4+3SDULmAVSprYnc9G7bd CWK3bv8bL0rZZBrWld38PDkozHxJCl7oDZ7o6zYBqbRkVFsyvC1R6god2OjZ5g3nrwVX kwnzODmz522M5Rt4MrtMrOgU1tbAtUYQHyA1uL9GKJUokgCnGDtNNzsuV2n9iLsQMg34 u7TOSKp7lhFUDz/3JWzNGn/pGvD8s6x2WlByRfKwkcoD3AeTNBNgCFWtBSOl1rxU1FBx NpxwV8UXAqgiHQD02y+vpEU1TTMtYmIlZYLsudha2iN7aPFORe507/tMtCOTxuYvJ4H8 J2Cw== 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; bh=gaj+hsFra3tAAn41KvUkD6S/64I4IDGVCSXdBoXHO4Y=; b=8DFQ4mtw2KxmW+pXd2ZOf8pjW3m25eZrFwbZuzD9dXQdlMGrP61S4L1jrVtimtHi77 wpdTHbhBZRAUrss3V45c19mgRvtBdaOlx52cnpT2pxajK9QyXk6tPvFqluJCAWNH30c1 GAR4v9F1dQaEVN0rblAgSJxSf1VbpyoRvf2Pd+ulLOSL0A02z1dxPLnkFnr4InBy0qyc NiM83WKp4eW4USZlj2cQGT3Ji77jkxPwtvlqwVrgMHoSDn50iywY82jNkxETA4otHbnN wtNMe2F6J+A0gmOqSBolzpMxGqSi7QBNerkuOzDEqo6AJqS5V/Lxqc45Pg0NIB/nWXVr IxjA== X-Gm-Message-State: ACgBeo0zEcTmtipGZk1cxLF/EDM6VUdNrsG4XEcgVXSAunvn6Og/PJf5 ivjpZ5LyJyFK7tgLlhuWRkmepzo0FNw= X-Google-Smtp-Source: AA6agR5B1Wi6+1whPfRy/KEcWJHZxlVPYEwuKw02+TfXPJNmwX8h1PBi8SGm932FejldgP0EVJU6KQ== X-Received: by 2002:a17:90a:304a:b0:1fa:d832:5aca with SMTP id q10-20020a17090a304a00b001fad8325acamr7351025pjl.16.1661334199814; Wed, 24 Aug 2022 02:43:19 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , "Dr. David Alan Gilbert" , Juan Quintela , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 41/51] tests/qtest: migration-test: Kill "to" after migration is canceled Date: Wed, 24 Aug 2022 17:40:19 +0800 Message-Id: <20220824094029.1634519-42-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x630.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661337121705100003 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng Make sure QEMU process "to" is killed before launching another target for migration in the test_multifd_tcp_cancel case. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/migration-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 125d48d855..18ec079abf 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2132,6 +2132,10 @@ static void test_multifd_tcp_cancel(void) wait_for_migration_pass(from); =20 migrate_cancel(from); + /* Make sure QEMU process "to" is killed */ + if (qtest_probe_child(to)) { + qtest_kill_qemu(to); + } =20 args =3D (MigrateStart){ .only_target =3D true, --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661340154; cv=none; d=zohomail.com; s=zohoarc; b=S3WacMSBNAtnQGBN0tQTQQIZ+XrrjCgL7kRTfY/MXjrQ96MsPXT6HXiiEv22OX3jTtpWBKWtMcD/HdwtmF6iOgoGv9wSzj+2N1r2qDXaBzJ63Dd4Qml6EVMNRhHY80/U0N8JxK4BvUQ47sTo2SN1Hsdy8owipxmnnvpqUaKLy2k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661340154; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ohy+ZaRm+mExMl6IasKlBa1D9a82pE4z4g4jo6700W8=; b=DQn/UbvuP+4ddLzZKUA1l1YNidTG1sEfsvxkjdqXP8Glje1l5tf07bvJV+YiVwsfVd4OwdV0Kvsc5AWR1c5gZssjoG5TgzwmRMcPmLbSStTQD8K5e1mn9PCBEY5bCM0iNxuBFwANf6E364bsNtlgrSm3MmJ5+ChCNt6+SPNhcZY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166134015426333.66770931871724; Wed, 24 Aug 2022 04:22:34 -0700 (PDT) Received: from localhost ([::1]:59992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQoSt-0006Kl-RK for importer@patchew.org; Wed, 24 Aug 2022 07:22:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmv1-0004ST-5U; Wed, 24 Aug 2022 05:43:28 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:45735) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmuy-0001oH-9J; Wed, 24 Aug 2022 05:43:26 -0400 Received: by mail-pg1-x536.google.com with SMTP id f4so12712765pgc.12; Wed, 24 Aug 2022 02:43:23 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=ohy+ZaRm+mExMl6IasKlBa1D9a82pE4z4g4jo6700W8=; b=EFa36jtNPvYtjxpE+KhgJMJiHEArv3lvGNBpYs8rNtYVOJ2h5L5tnNXhwshALvkBSv t+4ACo4IWpzDvvgwlRhuVaaaw7SCVrw62iGL51Ttjv3/GLIGZYSeCyrCWs/0+p52Ho6V eZWyJudGq9qkprfJZ6GfJM1VlhoBq/41m6s2rslW6njYVLH14q/WAPKbT3/SSYtdFL73 OG8Vo3ofAqIR149E7xi3SHvJtZcNmfg66S2co4p0G7FqV5LaoA26twA6Tj0VF9GN6VpE RbDwUhVkf1Tk/C8OHtD159sljtsQ4/suF1p4xMxDnCpER9+qhdikM3hpxsQeBTQ56/Ts S3OQ== 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; bh=ohy+ZaRm+mExMl6IasKlBa1D9a82pE4z4g4jo6700W8=; b=j4XidXyxmX+i/X7HLkr+jpiGXW410qpCp36Su+SaEmLr9kFpKJcaRBQ+cIZoJDKTyA M36AonbfR0MNV4xNeHq+HbXH2yyEiL9OOvez43vICKNZIqcbtG7xOgJKwgFIrRXCRQCW twH8IDNMG1E8oxu29jUzMsm7bMpBJ+G24IUKKa7PlgSvd6smXNkur8yP9OmqXfmE7YHf LhjSsKNdaI5lXjF+9FEyFv7EMThSpTjE0H0uxCqMlt4euDeL+MSeD9xUtVud/HCvAQVJ +fGk1v6japuffUmPQ8bmITaZspeN6A9D1IxlcfHV+NAHwR7l+wJNxYsTekwISqlOcddB /t7A== X-Gm-Message-State: ACgBeo1UcRVWZMp/GS2LRriKGMtgGR4h07oizSvbB2lOJbcpRuZQ6GO/ bcQWYQgQzxK2Sld5erNoaLaRqT3tsxY= X-Google-Smtp-Source: AA6agR6bx+H5hvlsCfy0SQNQpJsv5cGpqgtTzuWACh35mc98Z24eSOFRsWe+SJAr8exISxezTqElDQ== X-Received: by 2002:a05:6a00:2918:b0:536:3967:5d08 with SMTP id cg24-20020a056a00291800b0053639675d08mr21463197pfb.68.1661334202610; Wed, 24 Aug 2022 02:43:22 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH 42/51] hw/ppc: spapr: Use qemu_vfree() to free spapr->htab Date: Wed, 24 Aug 2022 17:40:20 +0800 Message-Id: <20220824094029.1634519-43-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x536.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661340156179100001 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng spapr->htab is allocated by qemu_memalign(), hence we should use qemu_vfree() to free it. Fixes: c5f54f3e31bf ("pseries: Move hash page table allocation to reset tim= e") Fixes: b4db54132ffe ("target/ppc: Implement H_REGISTER_PROCESS_TABLE H_CALL= "") Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Daniel Henrique Barboza Reviewed-by: Marc-Andr=C3=A9 Lureau --- hw/ppc/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index bc9ba6e6dc..4034f4d130 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1522,7 +1522,7 @@ int spapr_hpt_shift_for_ramsize(uint64_t ramsize) =20 void spapr_free_hpt(SpaprMachineState *spapr) { - g_free(spapr->htab); + qemu_vfree(spapr->htab); spapr->htab =3D NULL; spapr->htab_shift =3D 0; close_htab_fd(spapr); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661337844474218.58024973852014; Wed, 24 Aug 2022 03:44:04 -0700 (PDT) Received: from localhost ([::1]:56104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnre-00072h-Lr for importer@patchew.org; Wed, 24 Aug 2022 06:44:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmv4-0004TI-3j; Wed, 24 Aug 2022 05:43:30 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:42734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmv1-0001ol-7O; Wed, 24 Aug 2022 05:43:28 -0400 Received: by mail-pj1-x1030.google.com with SMTP id s3-20020a17090a2f0300b001facfc6fdbcso957368pjd.1; Wed, 24 Aug 2022 02:43:26 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=MHfTEu/249wVV9m0rBn3cA/BnwhFgurm/PYKRUtzg+o=; b=ZZK1hRnYE1UDVwGvYkKI2LanoP3FgMW+1eLQGcXLgaAknQhWlHpDk1G1aG0/uf8LMu y54chOAX4JZPoMJ3LzQc2GDdCS4qknDTBFAFMSiR+O5GaI3Rt2CBMB3GyydJ23FOgjWz oArmj5LDEvjSzwQQsGVDz1N1NLCsOGGgkl9dm+G00CCJMGy76vZG6hiwkiLwWSYUJs2i +qa4ykgb0OWlUWRb+7t3W7KE+OoR2lEmYaE9n9G8AHIoC8SzzX3TDyNAgufQ5lMRcxX9 Tv3RrNlb0wwFgN39PpH6SKXvzC7f0ZJWrHTbP5Bm5NIqJ8mlJMy3xWsRQkQmsNZFg3pr J7jA== 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; bh=MHfTEu/249wVV9m0rBn3cA/BnwhFgurm/PYKRUtzg+o=; b=L2lHWrGPrUuH5BG5wTYcq7ERwjtXdI/yQQEidqZ4kvnJC2Yh5kRd4bYDwF0NqAWD0K KXX/MV3aym/zs5LpLCHaV96FWMbAPptlm+msDdmRqDiAOF0O/45314mofcudkqjSAyA+ O7hvs+3Zv6l8qad/1jgCyTL4WW7HrX7/SQ1V2XTWF7TrRzej2kUVK0V0cbOfLo1KZE0y IBtmjBQ4DTIV5a/4OaFOq6sa8dk5Q38L8ZDSTfc1l0ta5DM1VcVgZGEQrrbWnJYWrJfc HeKYUuiHWO0UtpUkT2HIvEWbdcj7ba108CYjprYw7uaSAmDkQSkAOjuLsi8q+OlGk+Rj BoUg== X-Gm-Message-State: ACgBeo2ResUmzdux2zf1bsh7VqC1m7JxoNRq8vl/1pc2WqW/UUIOLQT8 y9Yv8xrAzGm2l7r0wFCtz21becNF7Rg= X-Google-Smtp-Source: AA6agR4xoekxEgNHaKoZU/b9XwWIXxLm5ZQP4bl1zHL6rBDjhPECybJknIQ+cPD4IzWj/LolL81Ldw== X-Received: by 2002:a17:90a:e543:b0:1fa:d591:12c4 with SMTP id ei3-20020a17090ae54300b001fad59112c4mr7302607pjb.91.1661334205265; Wed, 24 Aug 2022 02:43:25 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Havard Skinnemoen , Laurent Vivier , Paolo Bonzini , Thomas Huth , Tyrone Ting , qemu-arm@nongnu.org Subject: [PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32 Date: Wed, 24 Aug 2022 17:40:21 +0800 Message-Id: <20220824094029.1634519-44-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x1030.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1661337845062100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng The test cases 'test_{tx,rx}' call socketpair() which does not exist on win32. Exclude them. Signed-off-by: Bin Meng Reviewed-by: Hao Wu Reviewed-by: Thomas Huth --- tests/qtest/npcm7xx_emc-test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/qtest/npcm7xx_emc-test.c b/tests/qtest/npcm7xx_emc-test.c index a353fef0ca..c373d24e1e 100644 --- a/tests/qtest/npcm7xx_emc-test.c +++ b/tests/qtest/npcm7xx_emc-test.c @@ -209,6 +209,7 @@ static int emc_module_index(const EMCModule *mod) return diff; } =20 +#ifndef _WIN32 static void packet_test_clear(void *sockets) { int *test_sockets =3D sockets; @@ -243,6 +244,7 @@ static int *packet_test_init(int module_num, GString *c= md_line) g_test_queue_destroy(packet_test_clear, test_sockets); return test_sockets; } +#endif /* _WIN32 */ =20 static uint32_t emc_read(QTestState *qts, const EMCModule *mod, NPCM7xxPWMRegister regno) @@ -250,6 +252,7 @@ static uint32_t emc_read(QTestState *qts, const EMCModu= le *mod, return qtest_readl(qts, mod->base_addr + regno * sizeof(uint32_t)); } =20 +#ifndef _WIN32 static void emc_write(QTestState *qts, const EMCModule *mod, NPCM7xxPWMRegister regno, uint32_t value) { @@ -339,6 +342,7 @@ static bool emc_soft_reset(QTestState *qts, const EMCMo= dule *mod) g_message("%s: Timeout expired", __func__); return false; } +#endif /* _WIN32 */ =20 /* Check emc registers are reset to default value. */ static void test_init(gconstpointer test_data) @@ -387,6 +391,7 @@ static void test_init(gconstpointer test_data) qtest_quit(qts); } =20 +#ifndef _WIN32 static bool emc_wait_irq(QTestState *qts, const EMCModule *mod, int step, bool is_tx) { @@ -843,6 +848,7 @@ static void test_rx(gconstpointer test_data) =20 qtest_quit(qts); } +#endif /* _WIN32 */ =20 static void emc_add_test(const char *name, const TestData* td, GTestDataFunc fn) @@ -865,8 +871,10 @@ int main(int argc, char **argv) td->module =3D &emc_module_list[i]; =20 add_test(init, td); +#ifndef _WIN32 add_test(tx, td); add_test(rx, td); +#endif } =20 return g_test_run(); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661340510; cv=none; d=zohomail.com; s=zohoarc; b=fBJOFNc2G8yfJcew/45gyXoVluO5UrVOds/viY75zGvJpLZ9PDMa2JePRhC+qwQVQrR2UiPlVrybb14moSeaXklsgcdBGu1k0cPOzy1g/7bkpJfJmUUpbwAiVRzzxQ8QlxNMk5M7FA4Hh6jMQfYsbrGQfSNdEPieC72yhF3pcnw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661340510; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=absMu0MsCcS+D8Q8iKeaSzi8XuqAyekaCuc9H9DLYbc=; b=QUbHCHV1AV58RQnzXcdmLIYkBKbH2FJm4PbyL3xE4iR7D1BQy3K6fwkocLm6wEncvqrtonCtM4AjQHYYgk/A0tMAhqAB+MlWzUD13/EO3IhJIgvFdGVcNaXJNkLonV4xn1xnzEtfXJ1pG0xEt+649L3rDr1w/Q69a++NihpnK48= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661340510938266.3348260551313; Wed, 24 Aug 2022 04:28:30 -0700 (PDT) Received: from localhost ([::1]:38980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQoYf-0004A2-Pv for importer@patchew.org; Wed, 24 Aug 2022 07:28:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmv6-0004UF-RC; Wed, 24 Aug 2022 05:43:34 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:42739) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmv5-0001qE-6Z; Wed, 24 Aug 2022 05:43:32 -0400 Received: by mail-pj1-x1035.google.com with SMTP id s3-20020a17090a2f0300b001facfc6fdbcso957475pjd.1; Wed, 24 Aug 2022 02:43:30 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=absMu0MsCcS+D8Q8iKeaSzi8XuqAyekaCuc9H9DLYbc=; b=NDv6cXqYoVIT6UlJFchvJvI+7vc9VAWbvNd8EzFyl0Xyy9JSejdoTtHowjqeyY5WN/ 1SjWn/ZzooHtZMTLk2ehGXnsRGzjFJ9iCQnlZjpLjLHsUBc4Q7EPJ8ADRtBSpIfAhg8l D5gfwgybFUY3yOy6LSUSSwp6gcG9DPlBEIFnSQRmhKB0GXQ+edUtrSbFoIYelcp9aPtN 4ji2U4v+N3tcYObSlcRmJTPdEMCceVHQbOvD2s+rNDGN1+gBWln4jwOS24pkmv/RURMf Ax6TSvJmbDivLCmMM0G1bUVpFLM2EOKffasyDtVcFH4JSqv6KSRiPcEKECN65oi8mTe9 Oksg== 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; bh=absMu0MsCcS+D8Q8iKeaSzi8XuqAyekaCuc9H9DLYbc=; b=EM5Qe0V6Akki9ilSurkQJ/a3S+rpowIoF6rqkt0PvstLfWEcVEZbt4A7TwlG5aahm6 0vXBrw6BgORxIpR71hHVgmH49KzpWKRyXAqS8Yd/QHOBsnh6ZYO0A+oFQPaQxu1ZEJYd 7cAwL4Rr4vr4IdOYW9kTPayct1ZMK+E3KVrLe1a36xsvGXXg7jznIvE7qScxq9T5z3sN wsI/8Fo+7uj/1cQxTc4jOqnJU/andLLS4i5lAaPKEA8y76eolUi733LBRtswcP1yG5Lb KtjH4WFdJ2+k6TTJz3dGbZ49TluGxCwueioB0WtQfycgO51Hv5/WzJdRSt2SQ/isNANu d5SA== X-Gm-Message-State: ACgBeo2qrqdWwsnN62wcZ8okwj2SSrUycgklcwtvFDuAf7laqhx2VYUn 4xL8uxxbU+5ZQmzkcODvDvrJjWyWTW8= X-Google-Smtp-Source: AA6agR6KlU+xRZ2lkZP2HppMEyj38xUjcrmF2XbzsyhEkWSoBlawKVR+FaBgroKzTEyBH2FLgMiS4w== X-Received: by 2002:a17:90a:6b0d:b0:1fa:c6fe:db6 with SMTP id v13-20020a17090a6b0d00b001fac6fe0db6mr7432037pjj.99.1661334208035; Wed, 24 Aug 2022 02:43:28 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Joel Stanley , Laurent Vivier , Paolo Bonzini , Peter Maydell , Thomas Huth , qemu-arm@nongnu.org Subject: [PATCH 44/51] tests/qtest: microbit-test: Fix socket access for win32 Date: Wed, 24 Aug 2022 17:40:22 +0800 Message-Id: <20220824094029.1634519-45-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x1035.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661340514161100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Sockets on Windows do not use *nix-style file descriptors, so write()/read()/close() do not work on Windows. Switch over to use send()/recv()/closesocket() which work with sockets on all platforms. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/microbit-test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/qtest/microbit-test.c b/tests/qtest/microbit-test.c index b71daae9a9..4bc267020b 100644 --- a/tests/qtest/microbit-test.c +++ b/tests/qtest/microbit-test.c @@ -51,7 +51,7 @@ static void uart_rw_to_rxd(QTestState *qts, int sock_fd, = const char *in, { int i, in_len =3D strlen(in); =20 - g_assert_true(write(sock_fd, in, in_len) =3D=3D in_len); + g_assert_true(send(sock_fd, in, in_len, 0) =3D=3D in_len); for (i =3D 0; i < in_len; i++) { g_assert_true(uart_wait_for_event(qts, NRF51_UART_BASE + A_UART_RXDRDY)); @@ -77,7 +77,7 @@ static void test_nrf51_uart(void) char s[10]; QTestState *qts =3D qtest_init_with_serial("-M microbit", &sock_fd); =20 - g_assert_true(write(sock_fd, "c", 1) =3D=3D 1); + g_assert_true(send(sock_fd, "c", 1, 0) =3D=3D 1); g_assert_cmphex(qtest_readl(qts, NRF51_UART_BASE + A_UART_RXD), =3D=3D= , 0x00); =20 qtest_writel(qts, NRF51_UART_BASE + A_UART_ENABLE, 0x04); @@ -97,17 +97,17 @@ static void test_nrf51_uart(void) =20 qtest_writel(qts, NRF51_UART_BASE + A_UART_STARTTX, 0x01); uart_w_to_txd(qts, "d"); - g_assert_true(read(sock_fd, s, 10) =3D=3D 1); + g_assert_true(recv(sock_fd, s, 10, 0) =3D=3D 1); g_assert_cmphex(s[0], =3D=3D, 'd'); =20 qtest_writel(qts, NRF51_UART_BASE + A_UART_SUSPEND, 0x01); qtest_writel(qts, NRF51_UART_BASE + A_UART_TXD, 'h'); qtest_writel(qts, NRF51_UART_BASE + A_UART_STARTTX, 0x01); uart_w_to_txd(qts, "world"); - g_assert_true(read(sock_fd, s, 10) =3D=3D 5); + g_assert_true(recv(sock_fd, s, 10, 0) =3D=3D 5); g_assert_true(memcmp(s, "world", 5) =3D=3D 0); =20 - close(sock_fd); + closesocket(sock_fd); =20 qtest_quit(qts); } --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661341069; cv=none; d=zohomail.com; s=zohoarc; b=CkN3tRrRmOdet/E0docHeZjWJcTwiCM+HI7P633GuVXegSQtHc/TJ0QqOtGskNBF7qYtgHl+YKBkINoMo5OKg7MtDTOgI4M27EVQ695X6fJm2WJxTdakKdwCtyVWneIGWpHA0UmhXnm1GjUuK12zWVUGIkqxUGHKbMbFHTdpRAE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661341069; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dRHhWPJXiN/4/A11QD7zEQfLoQkKTg9o+isZ5w1L5e4=; b=JKycCtcqbPfjvT8Cuf8snGGn4ZKXixGZzm9dduyHkJddrvBl313DCevDf4YimXPLkZHLDOJM1C+vLa9PPZZWg+uf17PItSs1tWPYLROwuvYS8tS6fXpGgPTdtD03UIYq2ZQOh+6kaFDMuoVX21I2cwIgMfBIZboT4CN5NVhy/nA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661341069601203.35753952229334; Wed, 24 Aug 2022 04:37:49 -0700 (PDT) Received: from localhost ([::1]:57898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQohe-0001xQ-Tt for importer@patchew.org; Wed, 24 Aug 2022 07:37:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmv8-0004V1-Tk for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:36 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:43525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmv6-0001rk-6Q for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:33 -0400 Received: by mail-pg1-x52a.google.com with SMTP id v4so14531915pgi.10 for ; Wed, 24 Aug 2022 02:43:31 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=dRHhWPJXiN/4/A11QD7zEQfLoQkKTg9o+isZ5w1L5e4=; b=DijW74OWB2eWz9Ojal28Y5v6r3SE2TdD7WVXvXriN/6blq08UM7V4dFXNme1gtuqSY WSEZu3r2AWD4xcrlQSrXeIScxS6myobDMKPcWwDI2WyQm1pxWlAi4mMlGD0Zi6xRVnbV prIRXaXIQtxJzZyySpWBIR54/cJ8xx+mOdr4uX4PAzCUFp1cYbbw+n/Y+EEchqbY3DaT UhJJEY7wcOFeoLZkiVtZli5eJ4Z+oGOxFBEsTWD8BohaR9IIYBFIAePcryucP0ic3PWI M59M9uQ+AGLS6cb/G4qNvFi3DfqAZsWUYO64XjT97iRteq/hjQYOtdarrT4fSoY30pN8 I1bQ== 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; bh=dRHhWPJXiN/4/A11QD7zEQfLoQkKTg9o+isZ5w1L5e4=; b=LN8K5P9WYM7Gm1i0T28v/MzcrubQx8BDAl2+dpSzoyA5PurITQOcMIjGHoCrN3J9fV Kf1WWWKWFYbYbPyYMvlQTtE6cJjh4xcGO4CgD0x5DLl1s+rPPVneK5TS70Yq3GnsQgsj B1Sbblo/mEjAkJkHzEeMpDp9W5//nQdQQDFIqAb46WCMDcA7LwGhgbm4quJMNvmsKixP YGCdaSe2JDB3mSfcXPlbW+OXHDm5SH3TpVCijDcq7nvnhdaBRA33WEQgJ1QzvDbyG85g mlGIAsNR4qKdEOy1GToNG3FRHZyM7T/XaqqmJGKduJWL+YRMG3L0hq4Ac2evjh5Bnqwr pTww== X-Gm-Message-State: ACgBeo28HQgZycSGw6tuM8k07Zj1QjLomoYg+3zPPXrpMsSZlvvw0kju PEVF+KDH0UEk04ZL7hs5uhNN42ohXIk= X-Google-Smtp-Source: AA6agR7cRjAvZg3xRyk3AUzz2mVMwWY4nn+tzhJjiNQJ5clFrSadpzgtPWCkxihhA7Sa+zM9RaRoLg== X-Received: by 2002:a65:6bca:0:b0:420:712f:ab98 with SMTP id e10-20020a656bca000000b00420712fab98mr23713431pgw.350.1661334210229; Wed, 24 Aug 2022 02:43:30 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 45/51] tests/qtest: prom-env-test: Use double quotes to pass the prom-env option Date: Wed, 24 Aug 2022 17:40:23 +0800 Message-Id: <20220824094029.1634519-46-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x52a.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661341070552100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Single quotes like -prom-env 'nvramrc=3Dcafec0de 4000 l!' in the arguments are not removed in the Windows environment before it is passed to the QEMU executable. Such argument causes a failure in the QEMU prom-env option parser codes. Change to use double quotes which works fine on all platforms. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- tests/qtest/prom-env-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/prom-env-test.c b/tests/qtest/prom-env-test.c index c2b0448e55..39ccb59797 100644 --- a/tests/qtest/prom-env-test.c +++ b/tests/qtest/prom-env-test.c @@ -58,8 +58,8 @@ static void test_machine(const void *machine) " -machine " PSERIES_DEFAULT_CAPABILITIES; } =20 - qts =3D qtest_initf("-M %s -accel tcg %s -prom-env 'use-nvramrc?=3Dtru= e' " - "-prom-env 'nvramrc=3D%x %x l!' ", (const char *)mac= hine, + qts =3D qtest_initf("-M %s -accel tcg %s -prom-env \"use-nvramrc?=3Dtr= ue\" " + "-prom-env \"nvramrc=3D%x %x l!\" ", (const char *)m= achine, extra_args, MAGIC, ADDRESS); check_guest_memory(qts); qtest_quit(qts); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661339439; cv=none; d=zohomail.com; s=zohoarc; b=FsGRofuXXIseb4BC7cBu0SD7WC5/IhJwvKijVn/i+91GQtXt/p0U4Jl7wKkIX3swgiq1gzrhZQJh0HlaXpFr6udWvk+knU/o4fmCuGdJDL+fS8BayJPxhxam47NdkUOo7fPr+aNuqhKYpDCMXnE7gXqVUiX94VevDvx6YFvh9t8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661339439; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F0tptSCqhJOQrvbB4isSFD9NCdxNi1hMprPFt8tETzY=; b=CNNovSbFktLZBKmUBypciJto0gAkyTbQw5c/dKJGMjZhnoxBGscgOJ5LLG1r2b+yKJbgdpoTCvT7g2Jk+rqvo6zz1ho1Wxu5AfZVrX7jVO39ehsTAWYEa8fkBdHcVnoYbll2zywrZllKej2XKwrJVaEqZnwrzvmjwj68jmHG52E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661339439863242.13827617650702; Wed, 24 Aug 2022 04:10:39 -0700 (PDT) Received: from localhost ([::1]:41608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQoHM-0002z4-Nt for importer@patchew.org; Wed, 24 Aug 2022 07:10:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmvA-0004Vk-Rz for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:37 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:42938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmv7-0001sw-NF for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:35 -0400 Received: by mail-pf1-x433.google.com with SMTP id y15so11987232pfr.9 for ; Wed, 24 Aug 2022 02:43:33 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=F0tptSCqhJOQrvbB4isSFD9NCdxNi1hMprPFt8tETzY=; b=LYsjvN/x9aEuSqhpXHXwgLQ5k8RXHez+dJbE4zvToHUDwX7/e/riE8UggNCli7Euiw qcsIn4vwlB/Px3dfrKq2yg1BnaKltp5lbuGkMjAN25uGQUMGj/dJwzN1R85m07GNF9R9 uR7xYfIiLFTFB8sD6v563LLnaKU999iyF/iMCvmxXRXtlvHrJjsnRWf1mKFHLrR5fjh2 sHS7Iv+YLtYLECz1E1sVou070aZOm8+/eSFZuZgI2pNHXon3ZijJA8IouF9jM8gO1xEc EzaoDS6AIgMFMWYuABDiUUd/UkAogqznjfpzOETJvb4QVajxn2raXKEQVcrtHeR/6LRS RWPQ== 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; bh=F0tptSCqhJOQrvbB4isSFD9NCdxNi1hMprPFt8tETzY=; b=00tIZGp9B04aG6AsCwAnJFfHmD94daPtRLmnbdrNG8VWlKaX18SB56ykGg+tHuaPPn LztCt0TNcPkK3pvUr096riecQPjNmn0J6A4wn+NcveFvCuQ/IqGaQ6IjWZdNKKCfLwFD FWuzktxGUodGWHVdRK8srJ5wWaBxxUyV0KYAlqUgdOUZk9VXNTPxf3WtZFwbU+Oeen7f g4G35cA1vPykgd+TzzgZYh4p+pi5nOOYhbMHMrnmtT020gAHGXtT9p4lsJd/5oRfR4NL DmW4tuCpjaDLXnVUSeELWzrhGg6boCew1uv7CaGDY7qeKKvHKXL83+qM8sk1r8AJJzfo YYog== X-Gm-Message-State: ACgBeo2QGZwRDA7REBE42FXp7HHPHnQbbZNagU0YyTogViuWC00csx53 iTt7JnW+1tdfAID9nTslOkknNy0BwIk= X-Google-Smtp-Source: AA6agR4wKbwtpR8AjgdyQdje8U0tJQ4vNu7ni5C0B1FebCH9MA0Yy2jk9pXfBc31uSxglIjmNpWzkA== X-Received: by 2002:aa7:8e05:0:b0:536:5dda:e634 with SMTP id c5-20020aa78e05000000b005365ddae634mr17547436pfr.35.1661334212217; Wed, 24 Aug 2022 02:43:32 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 46/51] tests/qtest: libqtest: Replace the call to close a socket with closesocket() Date: Wed, 24 Aug 2022 17:40:24 +0800 Message-Id: <20220824094029.1634519-47-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=bmeng.cn@gmail.com; helo=mail-pf1-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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661339441912100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng close() is a *nix function. It works on any file descriptor, and sockets in *nix are an example of a file descriptor. closesocket() is a Windows-specific function, which works only specifically with sockets. Sockets on Windows do not use *nix-style file descriptors, and socket() returns a handle to a kernel object instead, so it must be closed with closesocket(). In QEMU there is already a logic to handle such platform difference in os-posix.h and os-win32.h, that: * closesocket maps to close on POSIX * closesocket maps to a wrapper that calls the real closesocket() on Windows Replace the call to close a socket with closesocket() instead. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/libqtest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 99e52ff571..918f4657ed 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -115,7 +115,7 @@ static int socket_accept(int sock) (void *)&timeout, sizeof(timeout))) { fprintf(stderr, "%s failed to set SO_RCVTIMEO: %s\n", __func__, strerror(errno)); - close(sock); + closesocket(sock); return -1; } =20 @@ -126,7 +126,7 @@ static int socket_accept(int sock) if (ret =3D=3D -1) { fprintf(stderr, "%s failed: %s\n", __func__, strerror(errno)); } - close(sock); + closesocket(sock); =20 return ret; } @@ -512,8 +512,8 @@ void qtest_quit(QTestState *s) qtest_remove_abrt_handler(s); =20 qtest_kill_qemu(s); - close(s->fd); - close(s->qmp_fd); + closesocket(s->fd); + closesocket(s->qmp_fd); g_string_free(s->rx, true); =20 for (GList *it =3D s->pending_events; it !=3D NULL; it =3D it->next) { --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661341788; cv=none; d=zohomail.com; s=zohoarc; b=ccug17eiqojA7UD+K2eDIKWNluGk2tSqDEb4pfyep76UhhYe9UYmsKPutpHko9i/us4Jp0J579qo5iLGqXSj4ZS79nHw+Qo2USFSR7ZbeLTHKweN0wqpPk2lKg2TBAILBt5gCuhAYahIyU/hkLtter2wQGbWoe3y5MqFVz2YOd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661341788; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KNoYD8dCMjVvXD7l6AFXvjIplF+y/seVMIxP0e3Hrho=; b=IeLyKA3AgzKpYbMAtG7bUKpIHVfnratNeSN2SsUbRYAuC46i3JYmQ78ZZAUUKFkqtvk+BCy5mm+nHs9rFejB/jEuytqzYBhlCw4iVTTi1C9eYv/RNSzfAC57FuLZKwRhap4J1hsQIz0r/2EZ/UFU23KyRCGn2txNMlMl290Cr8M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661341788944441.1889444465387; Wed, 24 Aug 2022 04:49:48 -0700 (PDT) Received: from localhost ([::1]:46150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQotH-0000bA-N6 for importer@patchew.org; Wed, 24 Aug 2022 07:49:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmvC-0004XN-BA for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:38 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:40920) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmv9-0001tw-R7 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:37 -0400 Received: by mail-pg1-x532.google.com with SMTP id w13so9474448pgq.7 for ; Wed, 24 Aug 2022 02:43:35 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=KNoYD8dCMjVvXD7l6AFXvjIplF+y/seVMIxP0e3Hrho=; b=mZEqbFZG4On1tN55lgipnchPnF4qUcohXmRl/A3IlBWrwJl4P9OdnRklu6e4YKq54I Ak61Ml8CWejHGATGZ5fvmkXPT844sLmBtLwWDev0EUne5DVXTvAJd0hK5FtwBr9wC1Z0 +eqejq6sVj/9qM4gpylIwnVMpoYrVSyjul9qBcelOYc5YISWXn9t3RUjoxl6jxJKc2Yn qVZZr4HobZX/+ntj8LIQYBGCw8VmCEWhGzpiYHDqw4QvCPeou/uOoVfdDkO8ScwcYr3a hwwbqbxfeEaH+D2LJ3XefKiYXWq8L4AfsZd23X14zCbPeIrM1jh/s21/LxZWZwGMpZJv g1zA== 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; bh=KNoYD8dCMjVvXD7l6AFXvjIplF+y/seVMIxP0e3Hrho=; b=rpl+rjYfcveDU+b0/SQ0O0P+H5K7Xd/n2cVCEnKzJhDv/EiHNKIvLEvQQ15naBayNE YG+FmV2uSvNiVmQ/Uloybh5bQ0HgM5r94H1s8SSqIxJfywlHVfiEBTWId22cUdZiN99l /kSqBb5Ltt1hPgebcNSlqNNyuE+vOSeQdlPX+WgYA/rJVOEOkDPSdbOd4yPnTd+xK4BF zlIrxn23cWOGuKyrGdRafOIhz9goTwA7XU5Ya5NG9/ZZzDmMcOa15NL2STgAUxOuXnvj ajo1MjIrciONghibZrrwKWcFqAcP5Mk1w9JK0LEl7h5yY7QDavdj0iJ3lPtUadzEJ7ZZ 7YLA== X-Gm-Message-State: ACgBeo0nsiTjqFxP0guk6pOCSQ4PW9ZJbyrKYDzhYQSLhBrkUa4yKsdi uO2vQfyAzELlaK4S1iCtqGOz6b/j2S4= X-Google-Smtp-Source: AA6agR6lbBCU3hcBIWie281FWXZo8Rcp7V5wbWG8phwnaFQeHj7pNJsmqmbLG0tQEWMdjrVZgeFUow== X-Received: by 2002:a05:6a00:2283:b0:537:2c29:fc8 with SMTP id f3-20020a056a00228300b005372c290fc8mr3214660pfe.42.1661334214376; Wed, 24 Aug 2022 02:43:34 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH 47/51] tests/qtest: libqtest: Correct the timeout unit of blocking receive calls for win32 Date: Wed, 24 Aug 2022 17:40:25 +0800 Message-Id: <20220824094029.1634519-48-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=bmeng.cn@gmail.com; helo=mail-pg1-x532.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661341789485100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Some qtest cases don't get response from the the QEMU executable under test in time on Windows. It turns out that the socket receive call got timeout before it receive the complete response. The timeout value is supposed to be set to 50 seconds via the setsockopt() call, but there is a difference among platforms. The timeout unit of blocking receive calls is measured in seconds on non-Windows platforms but milliseconds on Windows. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/libqtest.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 918f4657ed..7b41971347 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -36,13 +36,14 @@ #include "qapi/qmp/qstring.h" =20 #define MAX_IRQ 256 -#define SOCKET_TIMEOUT 50 =20 #ifndef _WIN32 +# define SOCKET_TIMEOUT 50 # define CMD_EXEC "exec " # define DEV_STDERR "/dev/fd/2" # define DEV_NULL "/dev/null" #else +# define SOCKET_TIMEOUT 50000 # define CMD_EXEC "" # define DEV_STDERR "2" # define DEV_NULL "nul" @@ -108,8 +109,16 @@ static int socket_accept(int sock) struct sockaddr_un addr; socklen_t addrlen; int ret; + /* + * timeout unit of blocking receive calls is different among platfoms. + * It's in seconds on non-Windows platforms but milliseconds on Window= s. + */ +#ifndef _WIN32 struct timeval timeout =3D { .tv_sec =3D SOCKET_TIMEOUT, .tv_usec =3D 0 }; +#else + DWORD timeout =3D SOCKET_TIMEOUT; +#endif =20 if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (void *)&timeout, sizeof(timeout))) { --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661337615; cv=none; d=zohomail.com; s=zohoarc; b=FtmKfXAIjiatR9bDp3O1VSjGs5GhUHSgjyYloHzcd+nV3QGlNobgIPKopSsbsCiWdW7TQFy38tPZs/6/AL2omPwNr7df5i6rU8o/MMBzHyYXqb13n0KZNFm23EwjGzsfcsl0UL5cd+KogSjjfYxNgnDytmLlAVJE/mmuUtJvO0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661337615; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=k+wOqDGAd9uW6KVCk7h/YSoejf9awPSlxEfxhVeL2s0=; b=WHJGBBePDY98pzQxhAQcShmpB0E2e446twAlgk/o287wvbTBc/v4j6tD67VtS2dYz5b/XXsQCZf62QQ0pDg5P+e/qUjWIuwO+3Q9q44AmLPxSsrFpFn3BXl2wtembXMjM7MESGTwTmCD3w6yZh0bmHJCFWO+ur8nwKQjaxkm9KQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661337615300505.31205025480665; Wed, 24 Aug 2022 03:40:15 -0700 (PDT) Received: from localhost ([::1]:47674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnnx-00004t-18 for importer@patchew.org; Wed, 24 Aug 2022 06:40:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmvD-0004YQ-GU for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:39 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:47079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmvC-0001uv-1K for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:39 -0400 Received: by mail-pf1-x432.google.com with SMTP id p185so1501873pfb.13 for ; Wed, 24 Aug 2022 02:43:37 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=k+wOqDGAd9uW6KVCk7h/YSoejf9awPSlxEfxhVeL2s0=; b=BlUUof9KV7lo3UYByGgMBl4hZCyN+BBdHZ2Tr1C+nPomC0ZFXokTWg/sgZ1Vt67zab wbF954lhuV7jSa27O1FYBqGs5mBsbsS40dYaxXiIcCy3AFtozhvOQPIVIK4fJSyZPkFl Ca+Ay23X4xMBxCJdc5QWPoRBNCDa5Ndt6U07yXpUOoXiFMh4K19CaunIuUYcO/KvNnoM sJrEG9Xxqz7m4uZjgix+IAiiRMxB6d4sQxH+nfr4o//pbAh1JZdf/wtkks9HCiCBwX5h 0/PG9ge7kxvWNjtUmDZi0+LyN7O6rCZ+OCOMoWMmsjyvIM4TGjecn9aXr9zdeA+oHHbq xecQ== 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; bh=k+wOqDGAd9uW6KVCk7h/YSoejf9awPSlxEfxhVeL2s0=; b=U7tAvCIXFRJ8uyirECI/bqjTSWFt4VFfcpKyauG0urL4nfxVoYqrdwvPITLrDFlCBk ZNAq9oegQ3/IVvZ6cTcvMlbN3+GKhHaAlSSzcGA3j8pZa1KMW2IBGyD+YmGiTUiduJl8 4k3xS4e4L5gmet86XLk8QiQpvAaxDvgNTQa0Bfuhr1htKw0/F14Mc9mWDPa6fmSfp/cs So9t1pvejiyxu1sIfg1H3mrKoV3dXTUaBx052zOFInJwAgxo7Q/TgAoY19zvOU2SyC/Y 9dk5rrBLsRKTJln0Fn1vzryc8rfFILVLC2Goe8ZnaXwyA5+8tRVssDNSHrCSs9OVe6h2 B2yw== X-Gm-Message-State: ACgBeo0PNSUuS1KKagXUUlsR8afh0le6TJt1VQ+H14e9y9asBr08jt0w xSRY+JpUFjSuYVmb+Kzp6sOkc4MTSqM= X-Google-Smtp-Source: AA6agR7Ye5D0NyOAW6AHEspp+cycbkplrlSxx1gFwSzmM9NXktwH8s6xUlRHeUXDi66hDxhnNbhq4g== X-Received: by 2002:aa7:96a1:0:b0:536:9a2:5012 with SMTP id g1-20020aa796a1000000b0053609a25012mr24572239pfk.24.1661334216073; Wed, 24 Aug 2022 02:43:36 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 48/51] io/channel-watch: Drop a superfluous '#ifdef WIN32' Date: Wed, 24 Aug 2022 17:40:26 +0800 Message-Id: <20220824094029.1634519-49-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=bmeng.cn@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661337617699100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng In the win32 version qio_channel_create_socket_watch() body there is no need to do a '#ifdef WIN32'. Signed-off-by: Bin Meng Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- io/channel-watch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/io/channel-watch.c b/io/channel-watch.c index 0289b3647c..89f3c8a88a 100644 --- a/io/channel-watch.c +++ b/io/channel-watch.c @@ -285,11 +285,9 @@ GSource *qio_channel_create_socket_watch(QIOChannel *i= oc, GSource *source; QIOChannelSocketSource *ssource; =20 -#ifdef WIN32 WSAEventSelect(socket, ioc->event, FD_READ | FD_ACCEPT | FD_CLOSE | FD_CONNECT | FD_WRITE | FD_OOB); -#endif =20 source =3D g_source_new(&qio_channel_socket_source_funcs, sizeof(QIOChannelSocketSource)); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661338234; cv=none; d=zohomail.com; s=zohoarc; b=U/q03EchmpgNUMdxmfxN3Jv1boxNuXUlRpDbEaNZB6rTCjW1k2y0ulgqGUjeviKImaS6qKKcbE7hRpKPgSLJ35x+svZLD+xcYP3KClcbqBcqWVV6hQ9tRyvL3hh5sX5tXCs72RjJoMw0O9xQebVd3f+mVqnsaxb7no9sEpo8TDc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661338234; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gKxyDa7lKyWG5WkBmx+APlEruT/rzwWcMPKdz4TXZxE=; b=B7flx3UZQ3fU/OU6muoKJXOLGPjAluKtK+IA6HjVTFKDgPgjv4HBwcIVtNuvtwHtPIbbnpeA0H04kAElQDtytqxRCUppEcaPtATLl7wYl2qeEnO7kAZmrk8SYxzRwnVr0H9ySClM5oNLq+FoMdBq6qTfuZtj8nIajxIuCSb9CoQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661338234202555.6336916023263; Wed, 24 Aug 2022 03:50:34 -0700 (PDT) Received: from localhost ([::1]:45480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQnxx-0005UT-4h for importer@patchew.org; Wed, 24 Aug 2022 06:50:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmvF-0004d5-4K for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:41 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:45660) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmvD-0001vg-Dk for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:40 -0400 Received: by mail-pl1-x634.google.com with SMTP id u22so15173826plq.12 for ; Wed, 24 Aug 2022 02:43:38 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=gKxyDa7lKyWG5WkBmx+APlEruT/rzwWcMPKdz4TXZxE=; b=SFoZENIBmBu9tOpu74KvH9CSn7EwhCAtdV9yo82+axZchtmdoe/1UO4Ry2tfRRlz0k k0tFUc8h3SdH7xiEE/tM5LX2YXpYfVADc5FHT3AMbxc0/EHSU3mSsB2xl6vpaZoOpC/x jAH/eQCO2wR28Izp3fKsPQaNZiRU/D9+W0uDynCwkstakbmbV5eCsiqudBPEM81LttHD alMKZ9NM7v40a5Wo9ycEte6Rg6u7xuteXmsxEo4ZFftVH5yKlDgy4phCDhs9Ma8tvWu5 CsxRj3acSgqlFIVT8D9TvuqmLY4uSkRm7SiviVB7zfFS9EbQzMwmnO49KLY+4QadQva8 131g== 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; bh=gKxyDa7lKyWG5WkBmx+APlEruT/rzwWcMPKdz4TXZxE=; b=K/OycWdR5kVpHwMYb96fAdH1mJIKDn6v0EnKWfdYcfHnvU+yg2xR08h5CGlWSzxTdK bcKMa0Pj1LyneFAmcgk2nU6DliAOIgO+twrdGBs1zRruUkVJqf8as7YT22EPVxBxJ4aT 4kS99RsWoCecr93H+IZOyjmohJUNB7mL4g0GQVEc8nPT40/Jj1+vht6KaqgAuZ3B83ov hR6glgVhQYByme5hBBoc+WWhPqZyCLVtJ/OBnuMNazPCmfNWDdG7mfGHRPcOQBhuErVm MMY6cLnJzMIM3g1AUUcXU1dDtxFtpwHtEqx1laSElM2XiDtg1QDra9TCY70We/j0XG3U nphg== X-Gm-Message-State: ACgBeo3JmCpZBI1MWxTkn1/1mv1dRc6+7/lyLCcahj2yFjC/IGt8h3mj LZ56lfNvDf8maqrIbDJhn3IukwGvMZE= X-Google-Smtp-Source: AA6agR7R4Ggo59qr8j5X0/6MA331SC6M7I85cNMVBFA8PFo0pfmlhLeqMbnUmN5vQvJ6PsNZx1DfFA== X-Received: by 2002:a17:902:e851:b0:172:dda3:77d3 with SMTP id t17-20020a170902e85100b00172dda377d3mr15775461plg.19.1661334217828; Wed, 24 Aug 2022 02:43:37 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 49/51] io/channel-watch: Fix socket watch on Windows Date: Wed, 24 Aug 2022 17:40:27 +0800 Message-Id: <20220824094029.1634519-50-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x634.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661338235599100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Random failure was observed when running qtests on Windows due to "Broken pipe" detected by qmp_fd_receive(). What happened is that the qtest executable sends testing data over a socket to the QEMU under test but no response is received. The errno of the recv() call from the qtest executable indicates ETIMEOUT, due to the qmp chardev's tcp_chr_read() is never called to receive testing data hence no response is sent to the other side. tcp_chr_read() is registered as the callback of the socket watch GSource. The reason of the callback not being called by glib, is that the source check fails to indicate the source is ready. There are two socket watch sources created to monitor the same socket event object from the char-socket backend in update_ioc_handlers(). During the source check phase, qio_channel_socket_source_check() calls WSAEnumNetworkEvents() to discovers occurrences of network events for the indicated socket, clear internal network event records, and reset the event object. Testing shows that if we don't reset the event object by not passing the event handle to WSAEnumNetworkEvents() the symptom goes away and qtest runs very stably. It looks we don't need to call WSAEnumNetworkEvents() at all, as we don't parse the result of WSANETWORKEVENTS returned from this API. We use select() to poll the socket status. Fix this instability by dropping the WSAEnumNetworkEvents() call. Signed-off-by: Bin Meng Reviewed-by: Daniel P. Berrang=C3=A9 --- During the testing, I removed the following codes in update_ioc_handlers(): remove_hup_source(s); s->hup_source =3D qio_channel_create_watch(s->ioc, G_IO_HUP); g_source_set_callback(s->hup_source, (GSourceFunc)tcp_chr_hup, chr, NULL); g_source_attach(s->hup_source, chr->gcontext); and such change also makes the symptom go away. And if I moved the above codes to the beginning, before the call to io_add_watch_poll(), the symptom also goes away. It seems two sources watching on the same socket event object is the key that leads to the instability. The order of adding a source watch seems to also play a role but I can't explain why. Hopefully a Windows and glib expert could explain this behavior. io/channel-watch.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/io/channel-watch.c b/io/channel-watch.c index 89f3c8a88a..e34d86e810 100644 --- a/io/channel-watch.c +++ b/io/channel-watch.c @@ -115,17 +115,13 @@ static gboolean qio_channel_socket_source_check(GSource *source) { static struct timeval tv0; - QIOChannelSocketSource *ssource =3D (QIOChannelSocketSource *)source; - WSANETWORKEVENTS ev; fd_set rfds, wfds, xfds; =20 if (!ssource->condition) { return 0; } =20 - WSAEnumNetworkEvents(ssource->socket, ssource->ioc->event, &ev); - FD_ZERO(&rfds); FD_ZERO(&wfds); FD_ZERO(&xfds); --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661338552; cv=none; d=zohomail.com; s=zohoarc; b=ZWdlJYItRZohKcqzRgFUfQrcWpqnKPDR2k2/4PlnJ3jsVCXW6k8PbpNKOPo3pmY+Ykk4goI1GgNA/CtP7OdIbFKLeS+tppWRb2rMeunPRvLTJtOiqDwR7j81AwHE94VTXMt1WdXNccAFUT5AY63347+WO9Dd+EaEUKqaDWNFyho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661338552; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yHfvFbtV55sIFsllW+Yh1BVm3WnXAcaxhuBNZ2Rs4dY=; b=hgJZnKmDbJprF/8i+ErbWqqqppNHtXDs+6/m2u1BIc0/4sGVYD/3FOasfeHtsR19K3//Q9yHKDEeNgZ56zG/32JMnC4dht58ETK43GIsD8iN3IM2RlBnfpKqHM5ZUX1waS56MWnjPbQaYjrlEMPvKZiw0qHHvzvqhMJSnH2CUIs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661338552788294.43743170182836; Wed, 24 Aug 2022 03:55:52 -0700 (PDT) Received: from localhost ([::1]:46068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQo33-0003Eh-AR for importer@patchew.org; Wed, 24 Aug 2022 06:55:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmvJ-0004jy-00 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:45 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:42935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmvG-0001wU-9t for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:44 -0400 Received: by mail-pl1-x62c.google.com with SMTP id v23so9909165plo.9 for ; Wed, 24 Aug 2022 02:43:41 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=yHfvFbtV55sIFsllW+Yh1BVm3WnXAcaxhuBNZ2Rs4dY=; b=n98X281VnSIXn3kaNQ4oC0g06Bd3h21W4/4R3DYvQaogjZR3GX8XlPJY6U7ovZo4K6 xb45hx5EyZKBC+goYwJdNOZMTz2TvxCC/zFvshvC0yLmQ/bMEP7KmeSS4B0RbuSvwWRZ GdaQnFn4J7VR8DhsVqqhsVvL5EXQQQNg+HKPr0DQwdTTn1A9bn3zyPPQHGazWOeln/CF b8nG1K+Y5c4m/uDXyK94VXnuxIQOh7CLK61jahrJsj7L3Cr0Dqhz7qGZYYOG//fqh0rN JnrDXTKrUXi0msOPH2hQXni8uqQ3h6ORHgr4AIKZI7m0/C/ddJSVNQDrSpemsLys3ETA cpwg== 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; bh=yHfvFbtV55sIFsllW+Yh1BVm3WnXAcaxhuBNZ2Rs4dY=; b=GPQomE86T/UhanZ6EbX7fm/Ja1DSm/DoMRwXp5U/fr0HdO2cbsZK/p0BQSU0cfnPR+ CjnUBUTSF/OSQyPfjhVHPiTrXQKfoG0QqGxH+bpYBSCUFQM0Z6F/2LU54/yEMHOTT1aU ZeFNPzc86bk0ve3lpFSz7GaL+y/LxWubyJny31apx6YQ02kVmfheTuIbDE/GrfRIMQSY kXz1+BHLWTjDH81CkTGN+GJQAlbrVW7nvFTR1C6MO44jwQQFN7Ux2UD2+ncQpNrL8hdl 8oEszsCCo2/VfhJMHTmxyTeeafkfijdkpzOMqLKMbJ0kvZZwFvjpdFE+wnJKqmPqz81n NXHQ== X-Gm-Message-State: ACgBeo2qgmryDd/eOCp6RY2nycgfdpgw8Qzp6HLSf7fSTuubtCtBqZQK RrfXGdPy+wsNNSmbXkcI4vgPQZaTEwU= X-Google-Smtp-Source: AA6agR7VCqP14AnB0BgzlFcLgFyL94Kxm2pb/fJcLkwbgILm2ODzmvsVJnWWah0bZ80BAPxfqZNn2w== X-Received: by 2002:a17:90a:1912:b0:1f7:8c6c:4fde with SMTP id 18-20020a17090a191200b001f78c6c4fdemr7600625pjg.8.1661334220282; Wed, 24 Aug 2022 02:43:40 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Beraldo Leal , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta Subject: [PATCH 50/51] .gitlab-ci.d/windows.yml: Increase the timeout to the runner limit Date: Wed, 24 Aug 2022 17:40:28 +0800 Message-Id: <20220824094029.1634519-51-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x62c.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661338553370100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --wi= thout-default-devices" changed to compile QEMU with the --without-default-devices switch for the msys2-64bit job, due to the build could not complete within the project timeout (1h), and also mentioned that a bigger timeout was getting ignored on the shared Gitlab-CI Windows runners. However as of today it seems the shared Gitlab-CI Windows runners does honor the job timeout, and the runner has the timeout limit of 2h, so let's increase the timeout to the runner limit and drop the configure switch "--without-default-devices" to get a larger build coverage. As a result of this, the check-qtest starts running on Windows in CI. Signed-off-by: Bin Meng --- .gitlab-ci.d/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml index c4bde758be..d4fd821b5f 100644 --- a/.gitlab-ci.d/windows.yml +++ b/.gitlab-ci.d/windows.yml @@ -10,7 +10,7 @@ - ${CI_PROJECT_DIR}/msys64/var/cache needs: [] stage: build - timeout: 70m + timeout: 2h before_script: - If ( !(Test-Path -Path msys64\var\cache ) ) { mkdir msys64\var\cache @@ -59,7 +59,7 @@ msys2-64bit: - $env:MSYSTEM =3D 'MINGW64' # Start a 64 bit Mingw environment - $env:MSYS =3D 'winsymlinks:native' # Enable native Windows symlink - .\msys64\usr\bin\bash -lc './configure --target-list=3Dx86_64-softmmu - --enable-capstone --without-default-devices' + --enable-capstone' - .\msys64\usr\bin\bash -lc "sed -i '/^ROMS=3D/d' build/config-host.mak" - .\msys64\usr\bin\bash -lc 'make -j2' - .\msys64\usr\bin\bash -lc 'make check' --=20 2.34.1 From nobody Fri May 17 07:07:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661338846; cv=none; d=zohomail.com; s=zohoarc; b=WbhUH8qz+CZqw5a0zrTN+JWsn0uQpLwCByswaXkGU/Vw+zK6mXHJGtmImWiidW1M9AnU+w203ZtbINLbv4TCokY3GOwqqY3JdojkSHLYFBflqJEEZbSz0WFKn4L4XG/fKgvy8qQeudp9zW0pjEx66C5xQvG2IOvz9SzYKdoLYHA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661338846; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4oQw+eQhY7hVGzdAfMaik/NQNQlk5bn8HV+UO9xrDSE=; b=YMzfP8F5IqILUf98k+yBhgvfEGBbAaf6JxZIJceXQINlhwkw/9EqsIZis6TuJsFxiz8IdpfMpmL6E5i0QDaIEKBX+uPgmE2WGp8lTp/S0pLRbiq5gY5Yhct4Q7q7Gh8h09lHSJCUiMFEQsn8OUePWcDz/xqsII3YcwHHtSkIAow= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661338846053940.6745973048883; Wed, 24 Aug 2022 04:00:46 -0700 (PDT) Received: from localhost ([::1]:43658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQo7o-0001Eo-S3 for importer@patchew.org; Wed, 24 Aug 2022 07:00:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQmvR-00050d-WD for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:54 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:34560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQmvI-0001wz-89 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 05:43:53 -0400 Received: by mail-pl1-x634.google.com with SMTP id io24so1900802plb.1 for ; Wed, 24 Aug 2022 02:43:43 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001728eb339e2sm12165972plh.286.2022.08.24.02.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 02:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=4oQw+eQhY7hVGzdAfMaik/NQNQlk5bn8HV+UO9xrDSE=; b=f2HY8z/CO/OBp04wuKvuQwgymMtZa73d6IuR7cPd5mM/SZZu/v9nJeY5D0JozmrxlT cjrWdnLeTlZENE/dp1Qw/1Qf9OChl/4+SZOWrCzvJN4dgBM7DH5iWS0DLqgn3eRYOG21 uqJj7NFeIeNcKKlzakeR+3PM+AGRzqYmmu17hxf8EZcA6WluPQNUcKMg0XeBBHrJdr3V 9igS01XS1SApzZMimjAEf8sjr94/GpOOlcbhGS99DYE1cLp11i0HSI1xxl8IpHfL2B4O Q6JJv7ER2FXtcIZZfY6GMDBLqB827vcum3FTHuSqOCh8S5VcvJrpT3+Yk16GwGEoR2ny 58Qw== 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; bh=4oQw+eQhY7hVGzdAfMaik/NQNQlk5bn8HV+UO9xrDSE=; b=mmGuQMJQxNl7KmwCYuZyhVHE2A8Io9CTO1/AXKbVRA+EMZdyaLVoDtGDIoXXIqPCp5 puOGTC76KfXZF+snLgv89mEsWd4rIAzXgJEC/zFOlITCnip2OouclOolYOUI6q3why/i CqVChaQPuSRaVjLzKD3Jm+/mHUZ7+rNCagaNVxqrXvM/GbuG2Izc0vEThZNxwZ84VDRh xcRAXRlsXfCL1LEvxQKT/KftVyxcIDVSJ9PIrk/EKapE5qFMPpWzHAWsUmm6JtpznveV GxxXOx68U6PuW8JMm+gx/haT1ltpwZy5eMQnEpZoGuUuQxIJyUFGeZf/bLbYToySz1at fGcQ== X-Gm-Message-State: ACgBeo0qcSqwT3oid8Z0MsHZXQSfcRy9QinHyjGbXP2ZnwKFBJnRqT33 NYgQbe/sB7E8o5WmZOxi2qByMQ6jk/E= X-Google-Smtp-Source: AA6agR6U2Ff7fq2DkSsnsBw10MHiNNF26Ys3D2dsl58nWz0J/xzQ0r7mSgnI4KL5vK7RKnJCoi8XJQ== X-Received: by 2002:a17:903:2450:b0:173:9fe:70e5 with SMTP id l16-20020a170903245000b0017309fe70e5mr4863488pls.148.1661334222779; Wed, 24 Aug 2022 02:43:42 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: Bin Meng , Emanuele Giuseppe Esposito , Hanna Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Vladimir Sementsov-Ogievskiy , Willian Rampazzo Subject: [PATCH 51/51] docs/devel: testing: Document writing portable test cases Date: Wed, 24 Aug 2022 17:40:29 +0800 Message-Id: <20220824094029.1634519-52-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220824094029.1634519-1-bmeng.cn@gmail.com> References: <20220824094029.1634519-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=bmeng.cn@gmail.com; helo=mail-pl1-x634.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, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661338850016100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Update the best practices of how to write portable test cases that can be built and run successfully on both Linux and Windows hosts. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- docs/devel/testing.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 3f6ebd5073..8fcabda30f 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -115,6 +115,36 @@ check-block are in the "auto" group). See the "QEMU iotests" section below for more information. =20 +Writing portable test cases +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Both unit tests and qtests can run on a Linux host as well as a Windows ho= st. +Care must be taken when writing portable test cases that can be built and = run +successfully on both hosts. The following are some best practices: + +* Use portable APIs from glib whenever necessary, e.g.: g_setenv(), + g_mkdtemp(), g_mkdir_with_parents(). +* Avoid using hardcoded /tmp for temporary file directory. + Use g_get_tmp_dir() instead. +* Bear in mind that Windows has different special string representation for + stdin/stdout/stderr and null devices. For example if your test case uses + "/dev/fd/2" and "/dev/null" on Linux, remember to use "2" and "nul" on + Windows instead. Also IO redirection does not work on Windows, so avoid + using "2>nul" whenever necessary. +* If your test cases uses the blkdebug feature, use relative path to pass + the config and image file paths in the command line as Windows absolute + path contains the delimeter ":" which will confuse the blkdebug parser. +* Use double quotes in your extra QEMU commmand line in your test cases + instead of single quotes, as Windows does not drop single quotes when + passing the command line to QEMU. +* Windows opens a file in text mode by default, while a POSIX compliant + implementation treats text files and binary files the same. So if your + test cases opens a file to write some data and later wants to compare the + written data with the original one, be sure to pass the letter 'b' as + part of the mode string to fopen(), or O_BINARY flag for the open() call. +* If a certain test case can only run on POSIX or Linux hosts, use a proper + #ifdef in the codes. If the whole test suite cannot run on Windows, disa= ble + the build in the meson.build file. + QEMU iotests ------------ =20 --=20 2.34.1