Move VirtualBox driver into libvirtd

Change the build process & driver initialization so that the
VirtualBox driver is built into libvirtd, instead of libvirt.so
This change avoids the VirtualBox GPLv2-only license causing
compatibility problems with libvirt.so which is under the
GPLv2-or-later license.

NB this change prevents use of the VirtualBox driver on the
Windows platform, until such time as libvirtd can be made
to work there.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2013-05-15 11:31:36 +01:00
parent d7d7581b03
commit ba5f3c7c8e
4 changed files with 40 additions and 12 deletions

View File

@ -73,6 +73,9 @@
# ifdef WITH_UML # ifdef WITH_UML
# include "uml/uml_driver.h" # include "uml/uml_driver.h"
# endif # endif
# ifdef WITH_VBOX
# include "vbox/vbox_driver.h"
# endif
# ifdef WITH_NETWORK # ifdef WITH_NETWORK
# include "network/bridge_driver.h" # include "network/bridge_driver.h"
# endif # endif
@ -400,6 +403,9 @@ static void daemonInitialize(void)
# ifdef WITH_UML # ifdef WITH_UML
virDriverLoadModule("uml"); virDriverLoadModule("uml");
# endif # endif
# ifdef WITH_VBOX
virDriverLoadModule("vbox");
# endif
#else #else
# ifdef WITH_NETWORK # ifdef WITH_NETWORK
networkRegister(); networkRegister();
@ -434,6 +440,9 @@ static void daemonInitialize(void)
# ifdef WITH_UML # ifdef WITH_UML
umlRegister(); umlRegister();
# endif # endif
# ifdef WITH_VBOX
vboxRegister();
# endif
#endif #endif
} }

View File

@ -31,6 +31,18 @@ vbox+tcp://user@example.com/session (remote access, SASl/Kerberos)
vbox+ssh://user@example.com/session (remote access, SSH tunnelled) vbox+ssh://user@example.com/session (remote access, SSH tunnelled)
</pre> </pre>
<p>
<strong>NOTE: as of libvirt 1.0.6, the VirtualBox driver will always
run inside the libvirtd daemon, instead of being built-in to the
libvirt.so library directly. This change was required due to the
fact that VirtualBox code is LGPLv2-only licensed, which is not
compatible with the libvirt.so license of LGPLv2-or-later. The
daemon will be auto-started when the first connection to VirtualBox
is requested. This change also means that it will not be possible
to use VirtualBox URIs on the Windows platform, until additional
work is completed to get the libvirtd daemon working there.</strong>
</p>
<h2><a name="xmlconfig">Example domain XML config</a></h2> <h2><a name="xmlconfig">Example domain XML config</a></h2>
<pre> <pre>

View File

@ -958,12 +958,26 @@ libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
endif endif
if WITH_VBOX if WITH_VBOX
noinst_LTLIBRARIES += libvirt_driver_vbox_impl.la
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_vbox.la
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version
else
noinst_LTLIBRARIES += libvirt_driver_vbox.la noinst_LTLIBRARIES += libvirt_driver_vbox.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la # GPLv2-only license requries that it be linked into
libvirt_driver_vbox_la_CFLAGS = \ # libvirtd and *not* libvirt.so
-I$(top_srcdir)/src/conf $(AM_CFLAGS) #libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
libvirt_driver_vbox_la_LIBADD = $(DLOPEN_LIBS) $(MSCOM_LIBS) endif
libvirt_driver_vbox_la_SOURCES = $(VBOX_DRIVER_SOURCES)
libvirt_driver_vbox_impl_la_CFLAGS = \
-I$(top_srcdir)/src/conf \
$(AM_CFLAGS)
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_vbox_impl_la_LIBADD = $(DLOPEN_LIBS) $(MSCOM_LIBS)
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
endif endif
if WITH_XENAPI if WITH_XENAPI

View File

@ -81,9 +81,6 @@
#ifdef WITH_PHYP #ifdef WITH_PHYP
# include "phyp/phyp_driver.h" # include "phyp/phyp_driver.h"
#endif #endif
#ifdef WITH_VBOX
# include "vbox/vbox_driver.h"
#endif
#ifdef WITH_ESX #ifdef WITH_ESX
# include "esx/esx_driver.h" # include "esx/esx_driver.h"
#endif #endif
@ -465,10 +462,6 @@ virGlobalInit(void)
if (phypRegister() == -1) if (phypRegister() == -1)
goto error; goto error;
#endif #endif
#ifdef WITH_VBOX
if (vboxRegister() == -1)
goto error;
#endif
#ifdef WITH_ESX #ifdef WITH_ESX
if (esxRegister() == -1) if (esxRegister() == -1)
goto error; goto error;