util: move datadir.c from system/
The datadir module provides general-purpose data file lookup utilities that are not specific to system emulation. Move it to util/ so it can be reused more broadly. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Marc-André Lureau committed
Feb 18, 2026 at 18:40 UTC
f42c7a79db18fcea11cfb28c41c39d41e8f5f056
5 files changed
+4
-2
system/meson.build
-1
@@ -8,7 +8,6 @@ system_ss.add(files(
8
'bootdevice.c',
9
'cpus.c',
10
'cpu-timers.c',
11
- 'datadir.c',
11
'dirtylimit.c',
12
'dma-helpers.c',
13
'exit-with-parent.c',
system/trace-events
-1
@@ -46,7 +46,6 @@ vm_stop_flush_all(int ret) "ret %d"
46
47
# vl.c
48
vm_state_notify(int running, int reason, const char *reason_str) "running %d reason %d (%s)"
49
-load_file(const char *name, const char *path) "name %s location %s"
49
runstate_set(int current_state, const char *current_state_str, int new_state, const char *new_state_str) "current_run_state %d (%s) new_state %d (%s)"
50
system_wakeup_request(int reason) "reason=%d"
51
qemu_system_shutdown_request(int reason) "reason=%d"
util/datadir.c
renamed
util/meson.build
+1
@@ -30,6 +30,7 @@ util_ss.add(when: linux_io_uring, if_true: files('fdmon-io_uring.c'))
30
if glib_has_gslice
31
util_ss.add(files('qtree.c'))
32
endif
33
+util_ss.add(files('datadir.c'))
34
util_ss.add(files('defer-call.c'))
35
util_ss.add(files('envlist.c', 'path.c', 'module.c'))
36
util_ss.add(files('event.c'))
util/trace-events
+3
@@ -114,3 +114,6 @@ uffd_unregister_memory_failed(void *addr, uint64_t length, int err) "addr: %p le
114
# module.c
115
module_load_module(const char *name) "file %s"
116
module_lookup_object_type(const char *name) "name %s"
117
+
118
+# datadir.c
119
+load_file(const char *name, const char *path) "name %s location %s"