From nobody Mon Feb 9 19:07:22 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=1664106858; cv=none; d=zohomail.com; s=zohoarc; b=VWYK508ql1l1VYU/q81xue31uXWmON5qJiYoxwgTnc6cn0EFsML1Aqt6cjBwAg/8RIe+3zjAqFdiQ58OAjkVM703ycRuKy0aKs57nAA6N+Fsnoer95lxVqgdzX7+ePxjtF85TnwVafU56MBIBklQ4/9M8W3lptom7MLOMcQ+QvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664106858; 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=xSaeu3bMM0haLGRmrvVDTyuVh+uN3dsUBZJf+5l/M5A=; b=mS8Hn76IjSvgkk3qQ0NaCWR6uzd6EZJyxyR+kyjNJjQ5EmLpfQ5NFlxInGD1hhB8EhuKWcoJ/7f5nu2T+PWDfHY86yyt79w3W1UTOIxDYJqyixeD9JtrxFU0T5UhAqS75OSqLkt5TkR/clLFZNzi6lAmUObsRtYocDUMPnxiq/8= 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 1664106858240981.7007616226396; Sun, 25 Sep 2022 04:54:18 -0700 (PDT) Received: from localhost ([::1]:46938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocQDB-0008Ct-2p for importer@patchew.org; Sun, 25 Sep 2022 07:54:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocPrG-0002jc-Gc for qemu-devel@nongnu.org; Sun, 25 Sep 2022 07:31:41 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:39536) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocPr8-0006Ki-Md for qemu-devel@nongnu.org; Sun, 25 Sep 2022 07:31:37 -0400 Received: by mail-pl1-x62c.google.com with SMTP id f23so3929103plr.6 for ; Sun, 25 Sep 2022 04:31:20 -0700 (PDT) Received: from ubuntu.. (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id z4-20020a1709027e8400b00176c6738d13sm9187760pla.169.2022.09.25.04.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 04:31: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:subject:date; bh=xSaeu3bMM0haLGRmrvVDTyuVh+uN3dsUBZJf+5l/M5A=; b=NKLUKPCdqqOgJf9p53DOUSaPLKDNdfMlQdi9QRbvSxPLjSJ8ScUh6ZGl9Q6kx2EeIY uLwt5qiIo6wpDdZp/iKyw9dg4S9eH3ETV0eCbZS9EjUY5Lhug/pKNMxZS2tOivmZUNLi 16Uw4OVGT637TzMe50UocZKQuaFlsiyRpTzUoSxO8LaqgIvyt4Ay3TGq6OGgfXbr25to rpzvqo0CD5tcr2wAqzzfSLFUgf4AdtsFNoTsguUoZffxQxFlV8b0zo4dmP5vOepDPmsc LYT6gIdJCrEn+chgV9HFgSOFE6sZQctimRfD59/LrBB0QCRQnQiyij3qGiHvhEWbaMlf MBHQ== 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=xSaeu3bMM0haLGRmrvVDTyuVh+uN3dsUBZJf+5l/M5A=; b=2K9gpq+Hbzpc+ja7t3iA8qOGMjbaYj5ymAPwFnJPwHo4zy62lmIj3NifgZGCJzljZF L0pQ0HfCfslnf1bH7cbq77p2stn/e06MPWJpyyrPL1wgZ0kc/7Sicby0cxJ835GNBBeI UP+ODpn+giWmG8xcsBR6ZPM5oDpKGwjX88ypG0sPBBlYRh7ZnFLa8OmX4HgYFieeZHpk zb2KHKp2dwJWq50SnL+egtj/QdbJ+coJAtA8HGL8xw5Qxo+odEa5w72efQzWskS9QgdB EeQr99nFX60EwvjRkmoIVpuHIRGe4CJzTAik4FxM0cITbVhzghQ7VGP41bxC/vE7ruBs hfpA== X-Gm-Message-State: ACrzQf01mKo2CWs6rKKojGPf+s1/zgcmc4zRWbpWbLlr56g672gieC88 TU3swcEoyM+PuRtcIAS/sUiHqsfN600= X-Google-Smtp-Source: AMsMyM4DbDp9AKe1BDF/g3DryP32wT/Vb6yDv94+lee825jtBPEaTMuVUzehG+oPvA39Oj/YT5VVvw== X-Received: by 2002:a17:902:f545:b0:178:b4c3:eab6 with SMTP id h5-20020a170902f54500b00178b4c3eab6mr16831566plf.148.1664105479913; Sun, 25 Sep 2022 04:31:19 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Bin Meng , "Dr. David Alan Gilbert" , Juan Quintela , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH v3 14/54] tests/qtest: migration-test: Avoid using hardcoded /tmp Date: Sun, 25 Sep 2022 19:29:52 +0800 Message-Id: <20220925113032.1949844-15-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220925113032.1949844-1-bmeng.cn@gmail.com> References: <20220925113032.1949844-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 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: 1664106859289100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/migration-test.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 4728d528bb..029c4f3a6a 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2434,7 +2434,6 @@ static bool kvm_dirty_ring_supported(void) =20 int main(int argc, char **argv) { - char template[] =3D "/tmp/migration-test-XXXXXX"; const bool has_kvm =3D qtest_has_accel("kvm"); const bool has_uffd =3D ufd_version_check(); const char *arch =3D qtest_get_arch(); @@ -2462,9 +2461,10 @@ int main(int argc, char **argv) return g_test_run(); } =20 - tmpfs =3D g_mkdtemp(template); + tmpfs =3D g_dir_make_tmp("migration-test-XXXXXX", NULL); if (!tmpfs) { - g_test_message("g_mkdtemp on path (%s): %s", template, strerror(er= rno)); + g_test_message("g_dir_make_tmp on path (%s): %s", tmpfs, + strerror(errno)); } g_assert(tmpfs); =20 @@ -2589,6 +2589,7 @@ int main(int argc, char **argv) g_test_message("unable to rmdir: path (%s): %s", tmpfs, strerror(errno)); } + g_free((gpointer)tmpfs); =20 return ret; } --=20 2.34.1