Re: [libvirt] [PATCH RFC 1/2] make: Drop building without driver modules

2017-07-27 Thread Daniel P. Berrange
On Wed, Jul 26, 2017 at 10:12:13PM +0200, Peter Krempa wrote:
> Driver modules proved to be reliable for a long time. Since support for
> not building modules complicates the code and makefiles drop the support
> for not building drivers as modules.
> ---
> 
> Notes:
> This was suggested a while ago by Dan:
> 
> https://www.redhat.com/archives/libvir-list/2017-March/msg00917.html
> 
> I actually did not try to build this on windows, since I don't have the
> environment ready (do we actually even build the daemon on windows?).

We don't build the daemon on Win32. If we did ever want todo that, Win32
has an equivalent to dlopen we could use, so modules aren't a blocker for
that.

> daemon/Makefile.am|  57 ---
> daemon/libvirtd.c |  54 +--
> m4/virt-driver-modules.m4 |  24 +++
> src/Makefile.am   | 158 --
> src/driver.c  |   8 +--
> src/storage/storage_backend.c |  11 +--
> src/vbox/vbox_driver.c|   2 +-
> src/vbox/vbox_driver.h|   6 +-
> tests/Makefile.am |   6 --
> tests/testutils.c |   2 -
> tools/virsh.c |   3 -
> 11 files changed, 21 insertions(+), 310 deletions(-)
>

Reviewed-by: Daniel P. Berrange 

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH RFC 1/2] make: Drop building without driver modules

2017-07-26 Thread Peter Krempa
Driver modules proved to be reliable for a long time. Since support for
not building modules complicates the code and makefiles drop the support
for not building drivers as modules.
---

Notes:
This was suggested a while ago by Dan:

https://www.redhat.com/archives/libvir-list/2017-March/msg00917.html

I actually did not try to build this on windows, since I don't have the
environment ready (do we actually even build the daemon on windows?).

It simplifies the next patch so I thought it may be the right time to do 
this.

 daemon/Makefile.am|  57 ---
 daemon/libvirtd.c |  54 +--
 m4/virt-driver-modules.m4 |  24 +++
 src/Makefile.am   | 158 --
 src/driver.c  |   8 +--
 src/storage/storage_backend.c |  11 +--
 src/vbox/vbox_driver.c|   2 +-
 src/vbox/vbox_driver.h|   6 +-
 tests/Makefile.am |   6 --
 tests/testutils.c |   2 -
 tools/virsh.c |   3 -
 11 files changed, 21 insertions(+), 310 deletions(-)

diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index d02ab33bd..697778e56 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -208,63 +208,6 @@ libvirtd_LDADD += \
../src/libvirt_driver_remote.la \
$(NULL)

-if ! WITH_DRIVER_MODULES
-if WITH_QEMU
-libvirtd_LDADD += ../src/libvirt_driver_qemu.la
-if WITH_DTRACE_PROBES
-libvirtd_LDADD += ../src/libvirt_qemu_probes.lo
-endif WITH_DTRACE_PROBES
-endif WITH_QEMU
-
-if WITH_LXC
-libvirtd_LDADD += ../src/libvirt_driver_lxc.la
-endif WITH_LXC
-
-if WITH_XEN
-libvirtd_LDADD += ../src/libvirt_driver_xen.la
-endif WITH_XEN
-
-if WITH_LIBXL
-libvirtd_LDADD += ../src/libvirt_driver_libxl.la
-endif WITH_LIBXL
-
-if WITH_UML
-libvirtd_LDADD += ../src/libvirt_driver_uml.la
-endif WITH_UML
-
-if WITH_VBOX
-libvirtd_LDADD += ../src/libvirt_driver_vbox.la
-endif WITH_VBOX
-
-if WITH_VZ
-libvirtd_LDADD += ../src/libvirt_driver_vz.la
-endif WITH_VZ
-
-if WITH_STORAGE
-libvirtd_LDADD += ../src/libvirt_driver_storage.la
-endif WITH_STORAGE
-
-if WITH_NETWORK
-libvirtd_LDADD += ../src/libvirt_driver_network.la
-endif WITH_NETWORK
-
-if WITH_INTERFACE
-libvirtd_LDADD += ../src/libvirt_driver_interface.la
-endif WITH_INTERFACE
-
-if WITH_NODE_DEVICES
-libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
-endif WITH_NODE_DEVICES
-
-if WITH_SECRETS
-libvirtd_LDADD += ../src/libvirt_driver_secret.la
-endif WITH_SECRETS
-
-if WITH_NWFILTER
-libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
-endif WITH_NWFILTER
-endif ! WITH_DRIVER_MODULES
-
 libvirtd_LDADD += ../src/libvirt.la

 if WITH_POLKIT
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index a55845873..7e5d7af69 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -60,52 +60,7 @@
 #include "virgettext.h"
 #include "util/virnetdevopenvswitch.h"

-#ifdef WITH_DRIVER_MODULES
-# include "driver.h"
-#else
-# ifdef WITH_QEMU
-#  include "qemu/qemu_driver.h"
-# endif
-# ifdef WITH_LXC
-#  include "lxc/lxc_driver.h"
-# endif
-# ifdef WITH_XEN
-#  include "xen/xen_driver.h"
-# endif
-# ifdef WITH_LIBXL
-#  include "libxl/libxl_driver.h"
-# endif
-# ifdef WITH_UML
-#  include "uml/uml_driver.h"
-# endif
-# ifdef WITH_VBOX
-#  include "vbox/vbox_driver.h"
-# endif
-# ifdef WITH_BHYVE
-#  include "bhyve/bhyve_driver.h"
-# endif
-# ifdef WITH_NETWORK
-#  include "network/bridge_driver.h"
-# endif
-# ifdef WITH_INTERFACE
-#  include "interface/interface_driver.h"
-# endif
-# ifdef WITH_STORAGE
-#  include "storage/storage_driver.h"
-# endif
-# ifdef WITH_NODE_DEVICES
-#  include "node_device/node_device_driver.h"
-# endif
-# ifdef WITH_SECRETS
-#  include "secret/secret_driver.h"
-# endif
-# ifdef WITH_NWFILTER
-#  include "nwfilter/nwfilter_driver.h"
-# endif
-#endif
-#ifdef WITH_VZ
-# include "vz/vz_driver.h"
-#endif
+#include "driver.h"

 #include "configmake.h"

@@ -341,13 +296,8 @@ static int daemonErrorLogFilter(virErrorPtr err, int 
priority)
 }


-#ifdef WITH_DRIVER_MODULES
-# define VIR_DAEMON_LOAD_MODULE(func, module) \
+#define VIR_DAEMON_LOAD_MODULE(func, module) \
 virDriverLoadModule(module, #func)
-#else
-# define VIR_DAEMON_LOAD_MODULE(func, module) \
-func()
-#endif
 static void daemonInitialize(void)
 {
 /*
diff --git a/m4/virt-driver-modules.m4 b/m4/virt-driver-modules.m4
index ba65c3ba6..8bf8ecf2b 100644
--- a/m4/virt-driver-modules.m4
+++ b/m4/virt-driver-modules.m4
@@ -19,7 +19,7 @@ dnl

 AC_DEFUN([LIBVIRT_ARG_DRIVER_MODULES], [
   LIBVIRT_ARG_WITH([DRIVER_MODULES], [build drivers as loadable modules],
-   [check])
+   [yes])
 ])

 AC_DEFUN([LIBVIRT_CHECK_DRIVER_MODULES], [
@@ -27,28 +27,26 @@ AC_DEFUN([LIBVIRT_CHECK_DRIVER_MODULES], [

   if test "$with_libvirtd" = "no" ; then
 with_driver_modules=no
+  else
+if test "$with_driver_modules" = "no"; then
+  AC_MSG_ERROR([B