From nobody Mon Feb 9 20:35:21 2026 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=1664281762; cv=none; d=zohomail.com; s=zohoarc; b=AaCN28+XvdwitAOd/H5oY9rgg1977L5pGf/HJLYn3SFBQL1TccdCFGkcqD6fr7J8SDXI8NNunjXsLAews5f13mS2fF/O5uXg6b4G5CI+CNDW1l8aC8uyjw5HPChA78FqpwZLf3tvGLNnyDPOHQh80QP2VB56gmKFwBay1q5nz6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664281762; h=Content-Type: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=XHDxWl0yKYCxicgHp9QKyyYngaBXpOqvJcPgeDq+rGo=; b=joduYXeBiR+exYn+uFPUBySvHs9FzWusInv0LMPR38MNYEeExIKr86G0Qwz1FctWF3nZNjpg8nosMq4w4ppTwxe4dUIuWciCd4BP9MXiYCO6iGGpevcsCdM8LRReOL97kKv6AWUSqpsgpmrqv/LICAuR0cgSaWbFyON+a27T7pA= 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 1664281762106924.2037238085389; Tue, 27 Sep 2022 05:29:22 -0700 (PDT) Received: from localhost ([::1]:35242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1od9iC-0001XU-Kl for importer@patchew.org; Tue, 27 Sep 2022 08:29:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od8RF-0002o0-E1; Tue, 27 Sep 2022 07:07:49 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:45896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1od8R6-0004xF-S9; Tue, 27 Sep 2022 07:07:40 -0400 Received: by mail-pg1-x535.google.com with SMTP id r62so5261456pgr.12; Tue, 27 Sep 2022 04:07:35 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id i7-20020a626d07000000b00540f2323f67sm1453601pfc.95.2022.09.27.04.07.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 04:07: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:subject:date; bh=XHDxWl0yKYCxicgHp9QKyyYngaBXpOqvJcPgeDq+rGo=; b=dTghabO161ejNoITJDu0eYJVX4jRVEqP5MM+LlI6NTUD0U319y/i4LLjFrLvksiHC5 Qqtd2liaZS+QnxfAQlHwtENr2bXSD2n+vaLYvOuBYEJ9trBMUDdVHG/r1VpdktYQhnwb LzOBbnitHsnPZtDhj06iUHVH3oTiK8tPtyeWa5ibp0TNlfVFodfq+VaBNznuXkJLD//7 9AqZzZxNOROF4ypnkNTvjfJwFXGxxUOZ4nUrzNuFso5MPwkv3UjfMBswdCMoJI2jjiLr UEU6YSgFxJ8pRlF/YxQqaehzvA4N1wXID83tQ8VNAONnx8gaanhkobU8Dgu4qEQ6wb+v Z4aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=XHDxWl0yKYCxicgHp9QKyyYngaBXpOqvJcPgeDq+rGo=; b=6Iba0pKMy+nzNc2wYn54CfQRUEiKVesO86VnVPNjgyy9emJVYWYs4mo7tZoVm8BpSN dk3ev8+klnHetOvlfpQ8icfR4EzNUWvBP/e2uuzc8T68fKkdcbpa1tQI7Vf4J/Sa5AI8 iRLz0bynpZl0zQNKShzCVth70AsDAUbz0/71vPbNJ9AvpRjll6yKjaSwsSCfbyrOdj7n keaiSiN1pPWFpnHCT085SnGkuWNvTKBjDzLyIU5YnH+igvQWOlpC/npWfKr0ANAvV96w bK2E4LMlvj0WfCX5+6YhsSwXzgh3oJgMWdN5DIjWt7AEdCiTtZYxS4f6Ff7nB8Mmp4Od o7rQ== X-Gm-Message-State: ACrzQf0KLqVQZ/G812Pnld0IyHINGUo6IAEERMpeuS4xtvXrMEkuOOid +y/PRmazX53LTXmDSb6UIP9WlcFgfAg= X-Google-Smtp-Source: AMsMyM7K4Vy0QfPzypkgervWWh/t8VHVFkyzUZfNMT0O5f2Rl0BnXCZCwRbmmzD9QdcgrezrtR5lrQ== X-Received: by 2002:a63:cc4a:0:b0:439:1c48:2fed with SMTP id q10-20020a63cc4a000000b004391c482fedmr24724465pgi.618.1664276854411; Tue, 27 Sep 2022 04:07:34 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org, Thomas Huth Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Bin Meng , Laurent Vivier , Paolo Bonzini , Stefan Hajnoczi , qemu-block@nongnu.org Subject: [PATCH v4 19/54] tests/qtest: virtio-blk-test: Avoid using hardcoded /tmp Date: Tue, 27 Sep 2022 19:05:57 +0800 Message-Id: <20220927110632.1973965-20-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220927110632.1973965-1-bmeng.cn@gmail.com> References: <20220927110632.1973965-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 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: 1664281762800100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau --- (no changes since v3) Changes in v3: - Split to a separate patch tests/qtest/virtio-blk-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/virtio-blk-test.c b/tests/qtest/virtio-blk-test.c index dc5eed31c8..19c01f808b 100644 --- a/tests/qtest/virtio-blk-test.c +++ b/tests/qtest/virtio-blk-test.c @@ -49,10 +49,10 @@ 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; =20 /* Create a temporary raw image */ - fd =3D mkstemp(t_path); + fd =3D g_file_open_tmp("qtest.XXXXXX", &t_path, NULL); g_assert_cmpint(fd, >=3D, 0); ret =3D ftruncate(fd, TEST_IMAGE_SIZE); g_assert_cmpint(ret, =3D=3D, 0); --=20 2.34.1