~ruther/guix-local

ref: 25e2662e7e65db2d2c3f9479a352e3507bcb46e9 guix-local/gnu/packages/patches/libvirt-respect-modules-path.patch -rw-r--r-- 614 bytes
25e2662e — Maxim Cournoyer gnu: dhtnet: Update to 0.0.1-6.6dd5a5e and enable natpmp support. a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;