[libvirt PATCH 04/21] meson: drop check for unshare()

Daniel P. Berrangé berrange at redhat.com
Thu Dec 8 14:35:08 UTC 2022


The unshare() syscall was introduced to Linux in

  commit 2da436e00f9a5fdd0fb6b31e4b2b2ba82e8f5ab8
  Author: JANAK DESAI <janak at us.ibm.com>
  Date:   Tue Feb 7 12:59:03 2006 -0800

    [PATCH] unshare system call -v5: system call registration for i386

This is old enough that all our supported platforms can be assumed
to have this feature. Furthermore, the virprocess.c file was already
using unshare() with nothing more than a #ifdef __linux__ check.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 meson.build | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/meson.build b/meson.build
index 212c3cfafb..0a09e510c7 100644
--- a/meson.build
+++ b/meson.build
@@ -1526,20 +1526,7 @@ elif get_option('driver_libxl').enabled()
 endif
 
 if not get_option('driver_lxc').disabled() and host_machine.system() == 'linux' and conf.has('WITH_LIBVIRTD')
-  lxc_support_code = '''
-#include <sched.h>
-#include <linux/loop.h>
-#include <sys/epoll.h>
-
-void main(void) {
-    unshare(1);
-}
-  '''
-  if cc.compiles(lxc_support_code, name: 'lxc support', args: '-D_GNU_SOURCE')
-    conf.set('WITH_LXC', 1)
-  elif get_option('driver_lxc').enabled()
-    error('Required kernel features for LXC were not found')
-  endif
+  conf.set('WITH_LXC', 1)
 elif get_option('driver_lxc').enabled()
   error('linux and remote_driver are required for LXC')
 endif
-- 
2.38.1



More information about the libvir-list mailing list