On 30/10/2020 12.32, Greg Kurz wrote: > On Fri, 30 Oct 2020 09:19:46 +0100 > Christian Schoenebeck <qemu_...@crudebyte.com> wrote: [...] >> diff --git a/tests/qtest/libqos/virtio-9p.c b/tests/qtest/libqos/virtio-9p.c >> index d43647b3b7..6b22fa0e9a 100644 >> --- a/tests/qtest/libqos/virtio-9p.c >> +++ b/tests/qtest/libqos/virtio-9p.c >> @@ -35,7 +35,12 @@ static char *concat_path(const char* a, const char* b) >> static void init_local_test_path(void) >> { >> char *pwd = g_get_current_dir(); >> - local_test_path = concat_path(pwd, "qtest-9p-local"); >> + char *template = concat_path(pwd, "qtest-9p-local-XXXXXX"); >> + local_test_path = mkdtemp(template); >> + if (!local_test_path) { >> + g_test_message("mkdtemp('%s') failed: %s", template, >> strerror(errno)); > > Just per curiosity, is there a preferred way to output error messages ?
I don't think that we've ever agreed on a common way here... but as far as I can see, most tests rather use fprintf(stderr, ...) for error messages, while g_test_message() is rather for normal log messages? Thomas