]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: remove obsolete check for LO_FLAGS_AUTOCLEAR
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 8 Dec 2022 09:12:25 +0000 (09:12 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 12 Dec 2022 10:35:26 +0000 (10:35 +0000)
The LO_FLAGS_AUTOCLEAR constant was introduced to Linux in

  commit 96c5865559cee0f9cbc5173f3c949f6ce3525581
  Author: David Woodhouse <dwmw2@infradead.org>
  Date:   Wed Feb 6 01:36:27 2008 -0800

    Allow auto-destruction of loop devices

This is old enough that all our supported platforms can be assumed
to have this feature. For added fun this whole meson check was
semantically insane because EPOLL_CLOEXEC is not a valid arg
to unshare().

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
meson.build
src/util/virfile.c

index f313767cfed242180015d2057f7843e866923c25..212c3cfafb5ff5832e488645cab60ccae5d2f9bd 100644 (file)
@@ -1532,12 +1532,11 @@ if not get_option('driver_lxc').disabled() and host_machine.system() == 'linux'
 #include <sys/epoll.h>
 
 void main(void) {
-    unshare(!(LO_FLAGS_AUTOCLEAR));
+    unshare(1);
 }
   '''
   if cc.compiles(lxc_support_code, name: 'lxc support', args: '-D_GNU_SOURCE')
     conf.set('WITH_LXC', 1)
-    conf.set('WITH_DECL_LO_FLAGS_AUTOCLEAR', 1)
   elif get_option('driver_lxc').enabled()
     error('Required kernel features for LXC were not found')
   endif
index cef9f9979ac9cd6e2e9ffa53de2907abe520c7a5..7b37d6888ef6568f4a2c3cf0cbf038679bc38ca9 100644 (file)
@@ -66,9 +66,7 @@
 #  include <linux/magic.h>
 # endif
 # include <sys/statfs.h>
-# if WITH_DECL_LO_FLAGS_AUTOCLEAR
-#  include <linux/loop.h>
-# endif
+# include <linux/loop.h>
 # include <sys/ioctl.h>
 # include <linux/cdrom.h>
 /* These come from linux/fs.h, but that header conflicts with
@@ -748,7 +746,7 @@ int virFileUpdatePerm(const char *path,
 }
 
 
-#if defined(__linux__) && WITH_DECL_LO_FLAGS_AUTOCLEAR
+#if defined(__linux__)
 
 /* virFileLoopDeviceOpenLoopCtl() returns -1 when a real failure has occurred
  * while in the process of allocating or opening the loop device.  On success