util/path.c | 211 ++++++++++++++-------------------------------------- 1 file changed, 57 insertions(+), 154 deletions(-)
This is a third variant attempting to fix the problem of the -L interp_prefix handling not coping well pointing to a full chroot. Previous versions include: https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg06592.html https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg07304.html Both of the other versions keep an open file descriptor to the directory that is interp_prefix. While this seems to be efficient, they also leak a file descriptor into the guest. This has follow-on effects on the emulation, causing failures e.g. within the LTP testsuite. This version uses only string manipulation and access(2). A plausible criticism of this is the mutex and the cache. Are they really needed? I have no idea. I can imagine removing that is actually more efficient, not needing a lock around a shared data structure. Comments? r~ Richard Henderson (1): util/path: Do not cache all filenames at startup util/path.c | 211 ++++++++++++++-------------------------------------- 1 file changed, 57 insertions(+), 154 deletions(-) -- 2.17.1
Patchew URL: https://patchew.org/QEMU/20190417053225.27505-1-richard.henderson@linaro.org/
Hi,
This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===
CC stubs/blockdev-close-all-bdrv-states.o
CC stubs/clock-warp.o
CC stubs/cpu-get-clock.o
/tmp/qemu-test/src/util/path.c:24:12: error: 'g_canonicalize_filename' is deprecated [-Werror,-Wdeprecated-declarations]
base = g_canonicalize_filename(prefix, NULL);
^
/usr/include/glib-2.0/glib/gfileutils.h:175:1: note: 'g_canonicalize_filename' has been explicitly marked deprecated here
---
/usr/include/glib-2.0/glib/gmacros.h:432:37: note: expanded from macro 'G_DEPRECATED'
#define G_DEPRECATED __attribute__((__deprecated__))
^
/tmp/qemu-test/src/util/path.c:54:13: error: assigning to 'char *' from 'const void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
ret = value ? value : name;
^ ~~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/util/path.c:60:21: error: 'g_canonicalize_filename' is deprecated [-Werror,-Wdeprecated-declarations]
full_name = g_canonicalize_filename(g_path_skip_root(name), base);
^
/usr/include/glib-2.0/glib/gfileutils.h:175:1: note: 'g_canonicalize_filename' has been explicitly marked deprecated here
---
/usr/include/glib-2.0/glib/gmacros.h:432:37: note: expanded from macro 'G_DEPRECATED'
#define G_DEPRECATED __attribute__((__deprecated__))
^
/tmp/qemu-test/src/util/path.c:74:17: error: assigning to 'char *' from 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
ret = name;
^ ~~~~
4 errors generated.
The full log is available at
http://patchew.org/logs/20190417053225.27505-1-richard.henderson@linaro.org/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Patchew URL: https://patchew.org/QEMU/20190417053225.27505-1-richard.henderson@linaro.org/
Hi,
This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-mingw@fedora SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===
CC replication.o
CC block/raw-format.o
/tmp/qemu-test/src/util/path.c: In function 'init_paths':
/tmp/qemu-test/src/util/path.c:24:5: error: 'g_canonicalize_filename' is deprecated: Not available before 2.58 [-Werror=deprecated-declarations]
base = g_canonicalize_filename(prefix, NULL);
^~~~
In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0/glib.h:48,
---
gchar *g_canonicalize_filename (const gchar *filename,
^~~~~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/util/path.c: In function 'path':
/tmp/qemu-test/src/util/path.c:54:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
ret = value ? value : name;
^
/tmp/qemu-test/src/util/path.c:60:9: error: 'g_canonicalize_filename' is deprecated: Not available before 2.58 [-Werror=deprecated-declarations]
full_name = g_canonicalize_filename(g_path_skip_root(name), base);
^~~~~~~~~
In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0/glib.h:48,
---
/usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0/glib/gfileutils.h:176:8: note: declared here
gchar *g_canonicalize_filename (const gchar *filename,
^~~~~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/util/path.c:74:17: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
ret = name;
^
cc1: all warnings being treated as errors
The full log is available at
http://patchew.org/logs/20190417053225.27505-1-richard.henderson@linaro.org/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
© 2016 - 2026 Red Hat, Inc.