[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 24/54] tests: vhost-user-bridge: Avoid using hardcoded /tmp
From: |
Bin Meng |
Subject: |
[PATCH v3 24/54] tests: vhost-user-bridge: Avoid using hardcoded /tmp |
Date: |
Sun, 25 Sep 2022 19:30:02 +0800 |
From: Bin Meng <bin.meng@windriver.com>
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 <bin.meng@windriver.com>
---
Changes in v3:
- Split to a separate patch
tests/vhost-user-bridge.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
index 9b1dab2f28..fecdf915e7 100644
--- a/tests/vhost-user-bridge.c
+++ b/tests/vhost-user-bridge.c
@@ -631,7 +631,6 @@ static void *notifier_thread(void *arg)
static void
vubr_host_notifier_setup(VubrDev *dev)
{
- char template[] = "/tmp/vubr-XXXXXX";
pthread_t thread;
size_t length;
void *addr;
@@ -639,7 +638,7 @@ vubr_host_notifier_setup(VubrDev *dev)
length = qemu_real_host_page_size() * VHOST_USER_BRIDGE_MAX_QUEUES;
- fd = mkstemp(template);
+ fd = g_file_open_tmp("vubr-XXXXXX", NULL, NULL);
if (fd < 0) {
vubr_die("mkstemp()");
}
--
2.34.1
- Re: [PATCH v3 23/54] tests/unit: test-qga: Avoid using hardcoded /tmp, (continued)
- [PATCH v3 21/54] tests/qtest: libqtest: Avoid using hardcoded /tmp, Bin Meng, 2022/09/25
- [PATCH v3 25/54] block/vvfat: Unify the mkdir() call, Bin Meng, 2022/09/25
- [PATCH v3 31/54] accel/qtest: Implement a portable qtest accelerator, Bin Meng, 2022/09/25
- [PATCH v3 26/54] fsdev/virtfs-proxy-helper: Use g_mkdir(), Bin Meng, 2022/09/25
- [PATCH v3 11/54] tests/qtest: virtio_blk_fuzz: Avoid using hardcoded /tmp, Bin Meng, 2022/09/25
- [PATCH v3 28/54] tests/qtest: Skip running virtio-net-test cases that require socketpair() for win32, Bin Meng, 2022/09/25
- [PATCH v3 29/54] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only, Bin Meng, 2022/09/25
- [PATCH v3 24/54] tests: vhost-user-bridge: Avoid using hardcoded /tmp,
Bin Meng <=
- [PATCH v3 22/54] tests/unit: test-image-locking: Avoid using hardcoded /tmp, Bin Meng, 2022/09/25
- [PATCH v3 18/54] tests/qtest: vhost-user-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/25
- [PATCH v3 30/54] tests/qtest: qmp-test: Skip running test_qmp_oob for win32, Bin Meng, 2022/09/25
- [PATCH v3 32/54] tests/qtest: libqtest: Adapt global_qtest declaration for win32, Bin Meng, 2022/09/25
- [PATCH v3 33/54] tests/qtest: Use send/recv for socket communication, Bin Meng, 2022/09/25
- [PATCH v3 34/54] tests/qtest: libqtest: Exclude the *_fds APIs for win32, Bin Meng, 2022/09/25