]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: Stop looking up ZFS programs at build time
authorAndrea Bolognani <abologna@redhat.com>
Wed, 3 Nov 2021 09:32:14 +0000 (10:32 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 4 Nov 2021 18:02:06 +0000 (19:02 +0100)
At this point, we're no longer using the availability of the
ZFS programs at build time to decide whether to enable ZFS
support, so the only purpose of these find_program() calls is
to record their absolute paths.

However, the virCommand facilities that we're ultimately using
to run them are already capable of performing this lookup at
runtime, and in fact that's exactly what we already do in the
case of, for example, vstorage.

Drop the build time lookups and always perform them at runtime.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
meson.build
src/storage/storage_backend_zfs.c

index 60bf2a1d72681a494ed7e016012858a78e9b444d..dd46572365ec2441446809983a3645bc5fa13a8d 100644 (file)
@@ -1975,24 +1975,8 @@ if conf.has('WITH_LIBVIRTD')
   endif
 
   if not get_option('storage_zfs').disabled()
-    foreach name : [ 'zfs', 'zpool' ]
-      set_variable(
-        '@0@_prog'.format(name),
-        find_program(name, required: false, dirs: libvirt_sbin_path)
-      )
-    endforeach
-
     use_storage = true
     conf.set('WITH_STORAGE_ZFS', 1)
-    foreach name : [ 'zfs', 'zpool' ]
-      prog_var = get_variable('@0@_prog'.format(name))
-      if prog_var.found()
-        prog_path = prog_var.path()
-      else
-        prog_path = name
-      endif
-      conf.set_quoted(name.to_upper(), prog_path)
-    endforeach
   endif
 endif
 
index 6fabeade11117ab51a872353a78d802992a7076d..2a5d74357d9c5bae46d6d58a26a6a677a67eba97 100644 (file)
@@ -33,6 +33,9 @@
 
 VIR_LOG_INIT("storage.storage_backend_zfs");
 
+#define ZFS "zfs"
+#define ZPOOL "zpool"
+
 /*
  * Some common flags of zfs and zpool commands we use:
  * -H -- don't print headers and separate fields by tab