summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/libvirt-respect-modules-path.patch
diff options
context:
space:
mode:
authornathan <nathan_mail@nborghese.com>2025-03-13 20:36:27 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-03-17 20:55:38 +0900
commit614ba97d9847c2e52db9ffed9f98caf8a1e06922 (patch)
treea30b63892399e2d7e7b245423ecb5e3401d2166f /gnu/packages/patches/libvirt-respect-modules-path.patch
parent8e61e3baf63bf304f8714587da24015b682959d7 (diff)
gnu: libvirt: Fix path to Linux modules.
* gnu/packages/virtualization.scm (libvirt): Use LINUX_MODULE_DIRECTORY to find modules. [source]: Add libvirt-respect-modules-path.patch. * gnu/packages/patches/libvirt-respect-modules-path.patch: New file. * gnu/local.mk: Register new file. * gnu/services/virtualization.scm (libvirt-shepherd-service) <#:environment-variables>: Pass LINUX_MODULE_DIRECTORY. Change-Id: Idde5b59df3c1641fcbab376e6c694730769294d3 Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/packages/patches/libvirt-respect-modules-path.patch')
-rw-r--r--gnu/packages/patches/libvirt-respect-modules-path.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/gnu/packages/patches/libvirt-respect-modules-path.patch b/gnu/packages/patches/libvirt-respect-modules-path.patch
new file mode 100644
index 00000000000..faf40af0181
--- /dev/null
+++ b/gnu/packages/patches/libvirt-respect-modules-path.patch
@@ -0,0 +1,15 @@
+Honor the LINUX_MODULE_DIRECTORY environment variable.
+
+Upstream-status: N/A
+
+--- a/src/util/virpci.c
++++ b/src/util/virpci.c
+@@ -1459,6 +1459,7 @@ virPCIDeviceFindBestVFIOVariant(virPCIDevice *dev,
+ }
+
+ uname(&unameInfo);
+- modulesAliasPath = g_strdup_printf("/lib/modules/%s/modules.alias", unameInfo.release);
++ char* modulepath = getenv("LINUX_MODULE_DIRECTORY");
++ modulesAliasPath = g_strdup_printf("%s/%s/modules.alias", modulepath ? modulepath : "/lib/modules", unameInfo.release);
+ if (virFileReadAll(modulesAliasPath, 8 * 1024 * 1024, &modulesAliasContent) < 0)
+ return -1;