Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
configure.ac | 13 -------------
m4/virt-driver-libvirtd.m4 | 33 ---------------------------------
meson.build | 23 +++++++++++++++++++++++
meson_options.txt | 1 +
4 files changed, 24 insertions(+), 46 deletions(-)
delete mode 100644 m4/virt-driver-libvirtd.m4
diff --git a/configure.ac b/configure.ac
index e9a684b1b58..25250fd2c4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
@@ -353,7 +341,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
index 090f9532f94..00000000000
--- a/m4/virt-driver-libvirtd.m4
+++ /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])
-])
diff --git a/meson.build b/meson.build
index 6c31ae6c848..4aae01f62e5 100644
--- a/meson.build
+++ b/meson.build
@@ -1549,6 +1549,28 @@ endif
remote_default_mode = get_option('remote_default_mode').to_upper()
conf.set('REMOTE_DRIVER_MODE_DEFAULT',
'REMOTE_DRIVER_MODE_@0(a)'.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
@@ -1570,6 +1592,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)
diff --git a/meson_options.txt b/meson_options.txt
index 4360540bf5a..8731f78defe 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -47,5 +47,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')
--
2.26.2