[libvirt] [PATCH] Move VirtualBox driver into libvirtd

From: "Daniel P. Berrange" <berrange@redhat.com> 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 | 9 +++++++++ docs/drvvbox.html.in | 12 ++++++++++++ src/Makefile.am | 24 +++++++++++++++++++----- src/libvirt.c | 7 ------- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 1ac8e30..abb46ca 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -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_UML + 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 } diff --git a/docs/drvvbox.html.in b/docs/drvvbox.html.in index d59da57..e2a213c 100644 --- a/docs/drvvbox.html.in +++ b/docs/drvvbox.html.in @@ -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 GPLv2-only licensed, which is not + compatible with the libvirt.so license of GPLv2-or-later. The + daemon will be auto-started when the first connection to VirtualBox + is requested. This change also means it is no longer possible to + use the VirtualBox on the Windows platform, which lacks support + for the libvirtd daemon.</strong> + </p> + <h2><a name="xmlconfig">Example domain XML config</a></h2> <pre> diff --git a/src/Makefile.am b/src/Makefile.am index 6c626ac..8f26181 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -957,12 +957,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_xen.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 diff --git a/src/libvirt.c b/src/libvirt.c index 2b3515e..d0ec10a 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -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; -- 1.8.2.1

On 15.05.2013 12:33, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
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 | 9 +++++++++ docs/drvvbox.html.in | 12 ++++++++++++ src/Makefile.am | 24 +++++++++++++++++++----- src/libvirt.c | 7 ------- 4 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 1ac8e30..abb46ca 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -73,6 +73,9 @@ # ifdef WITH_UML # include "uml/uml_driver.h" # endif +#ifdef WITH_VBOX +# include "vbox/vbox_driver.h" +#endif
bad indent
# 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_UML
s/WITH_UML/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 }
diff --git a/docs/drvvbox.html.in b/docs/drvvbox.html.in index d59da57..e2a213c 100644 --- a/docs/drvvbox.html.in +++ b/docs/drvvbox.html.in @@ -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 GPLv2-only licensed, which is not + compatible with the libvirt.so license of GPLv2-or-later. The + daemon will be auto-started when the first connection to VirtualBox + is requested. This change also means it is no longer possible to + use the VirtualBox on the Windows platform, which lacks support + for the libvirtd daemon.</strong> + </p> + <h2><a name="xmlconfig">Example domain XML config</a></h2>
<pre> diff --git a/src/Makefile.am b/src/Makefile.am index 6c626ac..8f26181 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -957,12 +957,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_xen.la
Why libvirt_driver_xen.la? s/xen/vbox/
+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 diff --git a/src/libvirt.c b/src/libvirt.c index 2b3515e..d0ec10a 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -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;
Makes sense. ACK if you address the nits but please wait a moment before pushing so others can express themselves as well. Michal

On 05/15/2013 04:33 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
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.
Do we still know what is needed to get libvirtd working on Windows? But I agree that we need this change for the sake of GPLv3 users of libvirt.so.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- daemon/libvirtd.c | 9 +++++++++ docs/drvvbox.html.in | 12 ++++++++++++ src/Makefile.am | 24 +++++++++++++++++++----- src/libvirt.c | 7 ------- 4 files changed, 40 insertions(+), 12 deletions(-)
+ <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 GPLv2-only licensed, which is not + compatible with the libvirt.so license of GPLv2-or-later. The + daemon will be auto-started when the first connection to VirtualBox
In other words, the vbox:// URI is treated like qemu:///session, in that you don't have to have a libvirtd system daemon running?
+ is requested. This change also means it is no longer possible to + use the VirtualBox on the Windows platform, which lacks support + for the libvirtd daemon.</strong>
Maybe word this last sentence a bit more optimistically: This change also means that it is temporarily not possible to use VirtualBox URIs on the Windows platform, until additional work is completed to get the libvirtd daemon working there. Looks okay to me once you address Michal's findings. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 05/15/2013 12:33 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
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> --- [...] diff --git a/docs/drvvbox.html.in b/docs/drvvbox.html.in index d59da57..e2a213c 100644 --- a/docs/drvvbox.html.in +++ b/docs/drvvbox.html.in @@ -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 GPLv2-only licensed, which is not + compatible with the libvirt.so license of GPLv2-or-later. The
s/GPL/LGPL/ ? Martin
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Martin Kletzander
-
Michal Privoznik