summary refs log tree commit diff
path: root/pkgs/development/libraries/libvirt
diff options
context:
space:
mode:
authorTako Marks <me@github.tako.mx>2022-09-06 20:40:30 +0200
committerTako Marks <me@github.tako.mx>2022-09-16 21:57:46 +0200
commitf00d5620804f700b05b8cb913ac10ef3ddcaa068 (patch)
treeab6e7aa7ffb077a1221dd33f6bcd6cfae664cf01 /pkgs/development/libraries/libvirt
parentda6a05816e7fa5226c3f61e285ef8d9dfc868f3c (diff)
libvirtd: use nix paths for zfs userspace tools
Libvirt zfs storage driver makes use of zfs userspace tools to get the
neccesary information. This patch sets correct nix store paths for these
tools.
Diffstat (limited to 'pkgs/development/libraries/libvirt')
-rw-r--r--pkgs/development/libraries/libvirt/0002-substitute-zfs-and-zpool-commands.patch27
-rw-r--r--pkgs/development/libraries/libvirt/default.nix6
2 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libvirt/0002-substitute-zfs-and-zpool-commands.patch b/pkgs/development/libraries/libvirt/0002-substitute-zfs-and-zpool-commands.patch
new file mode 100644
index 0000000000000..9f380533ee452
--- /dev/null
+++ b/pkgs/development/libraries/libvirt/0002-substitute-zfs-and-zpool-commands.patch
@@ -0,0 +1,27 @@
+From dc5e3df2fd29a547ef0f9545e190a0ce3a73c95c Mon Sep 17 00:00:00 2001
+From: Tako Marks <me@github.tako.mx>
+Date: Tue, 6 Sep 2022 20:19:26 +0200
+Subject: [PATCH] substitute zfs and zpool commands
+
+---
+ src/storage/storage_backend_zfs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c
+index 2a5d74357d..460b3025c4 100644
+--- a/src/storage/storage_backend_zfs.c
++++ b/src/storage/storage_backend_zfs.c
+@@ -33,8 +33,8 @@
+ 
+ VIR_LOG_INIT("storage.storage_backend_zfs");
+ 
+-#define ZFS "zfs"
+-#define ZPOOL "zpool"
++#define ZFS "@zfs@"
++#define ZPOOL "@zpool@"
+ 
+ /*
+  * Some common flags of zfs and zpool commands we use:
+-- 
+2.36.2
+
diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix
index e1ae4527715e5..548671c852ce8 100644
--- a/pkgs/development/libraries/libvirt/default.nix
+++ b/pkgs/development/libraries/libvirt/default.nix
@@ -33,6 +33,7 @@
 , readline
 , rpcsvc-proto
 , stdenv
+, substituteAll
 , xhtml1
 , yajl
 , writeScript
@@ -126,6 +127,11 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch
+    (substituteAll {
+      src = ./0002-substitute-zfs-and-zpool-commands.patch;
+      zfs = "${zfs}/bin/zfs";
+      zpool = "${zfs}/bin/zpool";
+    })
   ];
 
   # remove some broken tests