[libvirt PATCH 094/351] meson: add network driver build option

Pavel Hrdina phrdina at redhat.com
Thu Jul 16 09:55:30 UTC 2020


Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 configure.ac              |  3 ---
 m4/virt-driver-network.m4 | 51 ---------------------------------------
 meson.build               | 11 +++++++++
 meson_options.txt         |  1 +
 4 files changed, 12 insertions(+), 54 deletions(-)
 delete mode 100644 m4/virt-driver-network.m4

diff --git a/configure.ac b/configure.ac
index fdc7755716c..2100beb582d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,10 +97,8 @@ dnl
 dnl Virtualization drivers check
 dnl
 
-LIBVIRT_DRIVER_ARG_NETWORK
 LIBVIRT_DRIVER_ARG_INTERFACE
 
-LIBVIRT_DRIVER_CHECK_NETWORK
 LIBVIRT_DRIVER_CHECK_INTERFACE
 
 
@@ -287,7 +285,6 @@ AC_MSG_NOTICE([=====================])
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Drivers])
 AC_MSG_NOTICE([])
-LIBVIRT_DRIVER_RESULT_NETWORK
 LIBVIRT_DRIVER_RESULT_INTERFACE
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Storage Drivers])
diff --git a/m4/virt-driver-network.m4 b/m4/virt-driver-network.m4
deleted file mode 100644
index b98ce07c9cb..00000000000
--- a/m4/virt-driver-network.m4
+++ /dev/null
@@ -1,51 +0,0 @@
-dnl The network 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_NETWORK], [
-  LIBVIRT_ARG_WITH([NETWORK], [with virtual network driver], [yes])
-])
-
-AC_DEFUN([LIBVIRT_DRIVER_CHECK_NETWORK], [
-  AC_REQUIRE([LIBVIRT_DRIVER_CHECK_LIBVIRTD])
-  AC_REQUIRE([LIBVIRT_DRIVER_CHECK_QEMU])
-  AC_REQUIRE([LIBVIRT_DRIVER_CHECK_LXC])
-
-  dnl there's no use compiling the network driver without the libvirt
-  dnl daemon, nor compiling it for macOS, where it breaks the compile
-
-  if test "$with_libvirtd" = "no" || test "$with_macos" = "yes"; then
-    with_network=no
-  fi
-
-  if test "$with_network" = "yes" ; then
-    AC_DEFINE_UNQUOTED([WITH_NETWORK], 1, [whether network driver is enabled])
-  fi
-  AM_CONDITIONAL([WITH_NETWORK], [test "$with_network" = "yes"])
-
-  with_bridge=no
-  if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then
-    with_bridge=yes
-    AC_DEFINE_UNQUOTED([WITH_BRIDGE], 1, [whether bridge code is needed])
-  fi
-  AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"])
-])
-
-AC_DEFUN([LIBVIRT_DRIVER_RESULT_NETWORK], [
-  LIBVIRT_RESULT([Network], [$with_network])
-])
diff --git a/meson.build b/meson.build
index eacfd57ee49..bbc74e32dd5 100644
--- a/meson.build
+++ b/meson.build
@@ -1683,6 +1683,12 @@ elif get_option('driver_lxc').enabled()
   error('linux and remote_driver are required for LXC')
 endif
 
+# there's no use compiling the network driver without the libvirt
+# daemon, nor compiling it for macOS, where it breaks the compile
+if not get_option('driver_network').disabled() and conf.has('WITH_LIBVIRTD') and host_machine.system() != 'darwin'
+  conf.set('WITH_NETWORK', 1)
+endif
+
 if not get_option('driver_openvz').disabled() and host_machine.system() == 'linux'
   conf.set('WITH_OPENVZ', 1)
 elif get_option('driver_openvz').enabled()
@@ -1836,6 +1842,10 @@ elif get_option('secdriver_selinux').enabled()
   error('You must install the libselinux development package in order to compile libvirt.')
 endif
 
+if conf.has('WITH_QEMU') or conf.has('WITH_LXC') or conf.has('WITH_NETWORK')
+  conf.set('WITH_BRIDGE', 1)
+endif
+
 
 # define top include directory
 
@@ -1868,6 +1878,7 @@ driver_summary = {
   'Bhyve': conf.has('WITH_BHYVE'),
   'Test': conf.has('WITH_TEST'),
   'Remote': conf.has('WITH_REMOTE'),
+  'Network': conf.has('WITH_NETWORK'),
   'Libvirtd': conf.has('WITH_LIBVIRTD'),
 }
 summary(driver_summary, section: 'Drivers', bool_yn: true)
diff --git a/meson_options.txt b/meson_options.txt
index fd370244f56..045c211ca46 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -53,6 +53,7 @@ option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hyper-V dr
 option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver')
 option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver')
 option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver')
+option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver')
 option('driver_openvz', type: 'feature', value: 'auto', description: 'OpenVZ driver')
 option('driver_qemu', type: 'feature', value: 'auto', description: 'QEMU/KVM driver')
 option('qemu_user', type: 'string', value: '', description: 'username to run QEMU system instance as')
-- 
2.26.2




More information about the libvir-list mailing list