[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 17/54] tests/qtest: vhost-user-blk-test: Avoid using hardcoded
From: |
Bin Meng |
Subject: |
[PATCH v4 17/54] tests/qtest: vhost-user-blk-test: Avoid using hardcoded /tmp |
Date: |
Tue, 27 Sep 2022 19:05:55 +0800 |
From: Bin Meng <bin.meng@windriver.com>
This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_get_tmp_dir() for a portable implementation.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
(no changes since v3)
Changes in v3:
- Split to a separate patch
tests/qtest/vhost-user-blk-test.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
/* No race because our pid makes the path unique */
- path = g_strdup_printf("/tmp/qtest-%d-sock.XXXXXX", getpid());
+ path = g_strdup_printf("%s/qtest-%d-sock.XXXXXX",
+ g_get_tmp_dir(), getpid());
tmp_fd = mkstemp(path);
g_assert_cmpint(tmp_fd, >=, 0);
close(tmp_fd);
--
2.34.1
- Re: [PATCH v4 18/54] tests/qtest: vhost-user-test: Avoid using hardcoded /tmp, (continued)
- [PATCH v4 27/54] hw/usb: dev-mtp: Use g_mkdir(), Bin Meng, 2022/09/27
- [PATCH v4 29/54] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only, Bin Meng, 2022/09/27
- [PATCH v4 33/54] tests/qtest: Use send/recv for socket communication, Bin Meng, 2022/09/27
- [PATCH v4 31/54] accel/qtest: Implement a portable qtest accelerator, Bin Meng, 2022/09/27
- [PATCH v4 26/54] fsdev/virtfs-proxy-helper: Use g_mkdir(), Bin Meng, 2022/09/27
- [PATCH v4 28/54] tests/qtest: Skip running virtio-net-test cases that require socketpair() for win32, Bin Meng, 2022/09/27
- [PATCH v4 30/54] tests/qtest: qmp-test: Skip running test_qmp_oob for win32, Bin Meng, 2022/09/27
- [PATCH v4 13/54] tests/qtest: ide-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 17/54] tests/qtest: vhost-user-blk-test: Avoid using hardcoded /tmp,
Bin Meng <=
- [PATCH v4 35/54] tests/qtest: libqtest: Install signal handler via signal(), Bin Meng, 2022/09/27
- [PATCH v4 36/54] tests/qtest: Support libqtest to build and run on Windows, Bin Meng, 2022/09/27
- [PATCH v4 38/54] tests/qtest: bios-tables-test: Adapt the case for win32, Bin Meng, 2022/09/27
- [PATCH v4 39/54] tests/qtest: boot-serial-test: Close the serial file before starting QEMU, Bin Meng, 2022/09/27
- [PATCH v4 32/54] tests/qtest: libqtest: Adapt global_qtest declaration for win32, Bin Meng, 2022/09/27
- [PATCH v4 34/54] tests/qtest: libqtest: Exclude the *_fds APIs for win32, Bin Meng, 2022/09/27