]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add libvirtd driver build option
authorPavel Hrdina <phrdina@redhat.com>
Tue, 16 Jun 2020 21:47:29 +0000 (23:47 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:00 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
configure.ac
m4/virt-driver-libvirtd.m4 [deleted file]
meson.build
meson_options.txt

index 36d71e9c71dc53ba06795de29c8230573e13d3c9..cdd13bea02ab4611144f664495e3fd1e3d60c81e 100644 (file)
@@ -87,16 +87,6 @@ AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
 AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"])
 AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"])
 
-if test "$with_win" = "yes" ; then
-  # We don't support the daemon yet
-  with_libvirtd=no
-fi
-
-# The daemon requires remote support.  Likewise, if we are not using
-# RPC, we don't need several libraries.
-if test "$with_remote" = "no" ; then
-  with_libvirtd=no
-fi
 # Stateful drivers are useful only when building the daemon.
 if test "$with_libvirtd" = "no" ; then
   with_qemu=no
@@ -130,7 +120,6 @@ LIBVIRT_DRIVER_ARG_BHYVE
 LIBVIRT_DRIVER_ARG_ESX
 LIBVIRT_DRIVER_ARG_HYPERV
 LIBVIRT_DRIVER_ARG_TEST
-LIBVIRT_DRIVER_ARG_LIBVIRTD
 LIBVIRT_DRIVER_ARG_NETWORK
 LIBVIRT_DRIVER_ARG_INTERFACE
 
@@ -145,7 +134,6 @@ LIBVIRT_DRIVER_CHECK_BHYVE
 LIBVIRT_DRIVER_CHECK_ESX
 LIBVIRT_DRIVER_CHECK_HYPERV
 LIBVIRT_DRIVER_CHECK_TEST
-LIBVIRT_DRIVER_CHECK_LIBVIRTD
 LIBVIRT_DRIVER_CHECK_NETWORK
 LIBVIRT_DRIVER_CHECK_INTERFACE
 
@@ -351,7 +339,6 @@ LIBVIRT_DRIVER_RESULT_VZ
 LIBVIRT_DRIVER_RESULT_BHYVE
 LIBVIRT_DRIVER_RESULT_TEST
 LIBVIRT_DRIVER_RESULT_NETWORK
-LIBVIRT_DRIVER_RESULT_LIBVIRTD
 LIBVIRT_DRIVER_RESULT_INTERFACE
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Storage Drivers])
diff --git a/m4/virt-driver-libvirtd.m4 b/m4/virt-driver-libvirtd.m4
deleted file mode 100644 (file)
index 090f953..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-dnl The libvirtd driver
-dnl
-dnl Copyright (C) 2016 Red Hat, Inc.
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library.  If not, see
-dnl <http://www.gnu.org/licenses/>.
-dnl
-
-AC_DEFUN([LIBVIRT_DRIVER_ARG_LIBVIRTD], [
-  LIBVIRT_ARG_WITH_FEATURE([LIBVIRTD], [libvirtd], [yes])
-])
-
-AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBVIRTD], [
-  if test "$with_libvirtd" = "yes" ; then
-    AC_DEFINE_UNQUOTED([WITH_LIBVIRTD], 1, [whether libvirtd daemon is enabled])
-  fi
-  AM_CONDITIONAL([WITH_LIBVIRTD], [test "$with_libvirtd" = "yes"])
-])
-
-AC_DEFUN([LIBVIRT_DRIVER_RESULT_LIBVIRTD], [
-  LIBVIRT_RESULT([Libvirtd], [$with_libvirtd])
-])
index 0d59d6f45fcd86ecdb7008530a2a8267f6c17807..881e8981a7b78d98a7951b73aaafe161718dd357 100644 (file)
@@ -1567,6 +1567,28 @@ endif
 remote_default_mode = get_option('remote_default_mode').to_upper()
 conf.set('REMOTE_DRIVER_MODE_DEFAULT', 'REMOTE_DRIVER_MODE_@0@'.format(remote_default_mode))
 
+if not get_option('driver_libvirtd').disabled()
+  use_libvirtd = true
+
+  if host_machine.system() == 'windows'
+    use_libvirtd = false
+    if get_option('driver_libvirtd').enabled()
+      error('libvirtd daemon is not supported on windows')
+    endif
+  endif
+
+  if not conf.has('WITH_REMOTE')
+    use_libvirtd = false
+    if get_option('driver_libvirtd').enabled()
+      error('remote driver is required for libvirtd daemon')
+    endif
+  endif
+
+  if use_libvirtd
+    conf.set('WITH_LIBVIRTD', 1)
+  endif
+endif
+
 
 # define top include directory
 
@@ -1588,6 +1610,7 @@ configure_file(output: 'meson-config.h', configuration: conf)
 
 driver_summary = {
   'Remote': conf.has('WITH_REMOTE'),
+  'Libvirtd': conf.has('WITH_LIBVIRTD'),
 }
 summary(driver_summary, section: 'Drivers', bool_yn: true)
 
index e445050abf7c2cb5402ac786292afd154defa0c5..571b5ff66be7d9c2a937badbb7c731dbb42c5342 100644 (file)
@@ -48,5 +48,6 @@ option('yajl', type: 'feature', value: 'auto', description: 'yajl support')
 
 
 # build driver options
+option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver')
 option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver')
 option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode')