]> xenbits.xensource.com Git - libvirt.git/commitdiff
Move VirtualBox driver into libvirtd
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 15 May 2013 10:31:36 +0000 (11:31 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 16 May 2013 15:28:53 +0000 (16:28 +0100)
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>
daemon/libvirtd.c
docs/drvvbox.html.in
src/Makefile.am
src/libvirt.c

index 1ac8e30466850d3439a2bd9e2465b8d39b01dca4..ae6a15c7bd0c79b1e22145ac8988581c878a23e1 100644 (file)
@@ -73,6 +73,9 @@
 # ifdef WITH_UML
 #  include "uml/uml_driver.h"
 # endif
+# ifdef WITH_VBOX
+#  include "vbox/vbox_driver.h"
+# endif
 # ifdef WITH_NETWORK
 #  include "network/bridge_driver.h"
 # endif
@@ -400,6 +403,9 @@ static void daemonInitialize(void)
 # ifdef WITH_UML
     virDriverLoadModule("uml");
 # endif
+# ifdef WITH_VBOX
+    virDriverLoadModule("vbox");
+# endif
 #else
 # ifdef WITH_NETWORK
     networkRegister();
@@ -434,6 +440,9 @@ static void daemonInitialize(void)
 # ifdef WITH_UML
     umlRegister();
 # endif
+# ifdef WITH_VBOX
+    vboxRegister();
+# endif
 #endif
 }
 
index d59da5783fff1c05d0abdd62ac0b1db06d82d1e7..4888dd2668f99fdacbccc0ad06cbfe0fe2c9250d 100644 (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)
 </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>
 
 <pre>
index 9a17f595d64ef9676606a87d027a6de039e8248c..4ca132032aee3cb106e197d3c51eb872d765761a 100644 (file)
@@ -958,12 +958,26 @@ libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
 endif
 
 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
-libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
-libvirt_driver_vbox_la_CFLAGS = \
-               -I$(top_srcdir)/src/conf $(AM_CFLAGS)
-libvirt_driver_vbox_la_LIBADD = $(DLOPEN_LIBS) $(MSCOM_LIBS)
-libvirt_driver_vbox_la_SOURCES = $(VBOX_DRIVER_SOURCES)
+# GPLv2-only license requries that it be linked into
+# libvirtd and *not* libvirt.so
+#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
+endif
+
+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
 
 if WITH_XENAPI
index 30f96461109d9b0a878d45e17cd7864de6891eff..4c018ecb8324962af6068fe4d9f713c085234d02 100644 (file)
@@ -81,9 +81,6 @@
 #ifdef WITH_PHYP
 # include "phyp/phyp_driver.h"
 #endif
-#ifdef WITH_VBOX
-# include "vbox/vbox_driver.h"
-#endif
 #ifdef WITH_ESX
 # include "esx/esx_driver.h"
 #endif
@@ -465,10 +462,6 @@ virGlobalInit(void)
     if (phypRegister() == -1)
         goto error;
 #endif
-#ifdef WITH_VBOX
-    if (vboxRegister() == -1)
-        goto error;
-#endif
 #ifdef WITH_ESX
     if (esxRegister() == -1)
         goto error;