On Thu, Oct 29, 2020 at 06:27:21PM +0100, Christian Schoenebeck wrote: > On Donnerstag, 29. Oktober 2020 16:04:03 CET Daniel P. Berrangé wrote: > > On Thu, Oct 29, 2020 at 02:52:16PM +0000, Peter Maydell wrote: > > > On Thu, 29 Oct 2020 at 14:31, Christian Schoenebeck > > > > > > <qemu_...@crudebyte.com> wrote: > > > > On Donnerstag, 29. Oktober 2020 15:15:19 CET Peter Maydell wrote: > > > > > On Thu, 29 Oct 2020 at 14:06, Christian Schoenebeck > > > > > > > > > > <qemu_...@crudebyte.com> wrote: > > > > > > Ok, I'll use mkdtemp() instead, that avoids other potential parallel > > > > > > config > > > > > > colissions that I may not have considered yet. > > > > > > > > > > > > The original motivation against mkdtemp() was that /tmp is isually a > > > > > > ramfs, > > > > > > hence very limited regarding large file tests. But that's not an > > > > > > issue > > > > > > right now.
snip > @@ -278,3 +278,14 @@ static void virtio_9p_register_nodes(void) > } > > libqos_init(virtio_9p_register_nodes); > + > +static void __attribute__((constructor)) construct_virtio_9p(void) { > + /* make sure test dir for the 'local' tests exists */ > + init_local_test_path(); > + create_local_test_dir(); > +} > + > +static void __attribute__((destructor)) destruct_virtio_9p(void) { > + /* remove previously created test dir when test suite completed */ > + remove_local_test_dir(); > +} > > So it would still use the current directory instead of /tmp/ and would > create and remove the test dir on process start/end. I wanted to avoid > using constructor/destructor atttributes, as some compilers don't > support them, but it seems it's already used in the code base and there > are currently no setup/teardown callbacks in libqos. QEMU explicitly only supports CLang and GCC, and our code assumes constructors/destructors work. IOW, you should ignore the portability concern. We don't care about other vendor compilers with poor feature sets. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|