From efb0a0fa7a4c4f25a5abb5df60f4813951279772 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Fri, 1 May 2026 13:29:56 +0200 Subject: [PATCH] shared: move storage-util to libshared The storage backend providers (block, fs) and storagectl currently each extract storage-util.c into their target. Several upcoming consumers (machine-util's BindVolume parser, vmspawn's hotplug glue, machinectl's new bind-volume verbs) need the StorageProvider type/string-table helpers and a future shared Acquire client helper. Move storage-util.{c,h} to src/shared so libshared exports the symbols once and every consumer (storage providers, storagectl, libshared itself) picks them up by linking libshared. Drop the now-redundant 'extract'/'objects' wiring in src/storage/meson.build. No code changes; this is purely a relocation. Signed-off-by: Christian Brauner (Amutable) --- src/shared/meson.build | 1 + src/{storage => shared}/storage-util.c | 0 src/{storage => shared}/storage-util.h | 0 src/storage/meson.build | 3 --- 4 files changed, 1 insertion(+), 3 deletions(-) rename src/{storage => shared}/storage-util.c (100%) rename src/{storage => shared}/storage-util.h (100%) diff --git a/src/shared/meson.build b/src/shared/meson.build index 0529d35d26..d4cd5ca431 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -199,6 +199,7 @@ shared_sources = files( 'socket-netlink.c', 'specifier.c', 'ssl-util.c', + 'storage-util.c', 'switch-root.c', 'swtpm-util.c', 'tar-util.c', diff --git a/src/storage/storage-util.c b/src/shared/storage-util.c similarity index 100% rename from src/storage/storage-util.c rename to src/shared/storage-util.c diff --git a/src/storage/storage-util.h b/src/shared/storage-util.h similarity index 100% rename from src/storage/storage-util.h rename to src/shared/storage-util.h diff --git a/src/storage/meson.build b/src/storage/meson.build index 21456141de..bcd68e612d 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -4,18 +4,15 @@ executables += [ libexec_template + { 'name' : 'systemd-storage-block', 'sources' : files('storage-block.c'), - 'extract' : files('storage-util.c') }, libexec_template + { 'name' : 'systemd-storage-fs', 'sources' : files('storage-fs.c'), - 'objects' : ['systemd-storage-block'], }, executable_template + { 'name' : 'storagectl', 'public' : true, 'sources' : files('storagectl.c'), - 'objects' : ['systemd-storage-block'], }, ]