meson: remove obsolete check for LO_FLAGS_AUTOCLEAR

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>
This commit is contained in:
Daniel P. Berrangé 2022-12-08 09:12:25 +00:00
parent 9edbdb9781
commit 84eb50dbd0
2 changed files with 3 additions and 6 deletions

View File

@ -1532,12 +1532,11 @@ if not get_option('driver_lxc').disabled() and host_machine.system() == 'linux'
#include <sys/epoll.h> #include <sys/epoll.h>
void main(void) { void main(void) {
unshare(!(LO_FLAGS_AUTOCLEAR)); unshare(1);
} }
''' '''
if cc.compiles(lxc_support_code, name: 'lxc support', args: '-D_GNU_SOURCE') if cc.compiles(lxc_support_code, name: 'lxc support', args: '-D_GNU_SOURCE')
conf.set('WITH_LXC', 1) conf.set('WITH_LXC', 1)
conf.set('WITH_DECL_LO_FLAGS_AUTOCLEAR', 1)
elif get_option('driver_lxc').enabled() elif get_option('driver_lxc').enabled()
error('Required kernel features for LXC were not found') error('Required kernel features for LXC were not found')
endif endif

View File

@ -66,9 +66,7 @@
# include <linux/magic.h> # include <linux/magic.h>
# endif # endif
# include <sys/statfs.h> # include <sys/statfs.h>
# if WITH_DECL_LO_FLAGS_AUTOCLEAR # include <linux/loop.h>
# include <linux/loop.h>
# endif
# include <sys/ioctl.h> # include <sys/ioctl.h>
# include <linux/cdrom.h> # include <linux/cdrom.h>
/* These come from linux/fs.h, but that header conflicts with /* 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 /* virFileLoopDeviceOpenLoopCtl() returns -1 when a real failure has occurred
* while in the process of allocating or opening the loop device. On success * while in the process of allocating or opening the loop device. On success