[libvirt] [PATCH 1/2] [Plain text ] OpenNebula driver, libvirt-0.6.1
"Abel Míguez Rodríguez"
amiguezr at pdi.ucm.es
Wed Mar 18 21:26:01 UTC 2009
Hi all,
I'm sorry, I apologize for the format used.
thanks,
> Hi all,
> We have updated the OpenNebula Driver to libvirt version 0.6.1.
> Now, the ONE driver is build at the libvirtd daemon, that is the natural place for it.
> Please feel free to make any comment, to improve the driver's coherence with libvirt's structure.
> I split the Patches in two e-mais:
> [PATCH 1/2] includes the patches to be applied to libvirt's sources and building files.
> [PATCH 2/2] attached the "one driver" source files.
>All the patches are made to be applied at the git commit:
>"025b62" (Fix subsystem lookup for older HAL releases)
>Thanks,
>Abel Miguez
diff --git a/configure.in b/configure.in
index 413d27c..fd75a8d 100644
--- a/configure.in
+++ b/configure.in
@@ -184,6 +184,8 @@ AC_ARG_WITH([openvz],
[ --with-openvz add OpenVZ support (on)],[],[with_openvz=yes])
AC_ARG_WITH([lxc],
[ --with-lxc add Linux Container support (on)],[],[with_lxc=yes])
+AC_ARG_WITH([one],
+[ --with-one add ONE support (on)],[],[with_one=no])
AC_ARG_WITH([test],
[ --with-test add test driver support (on)],[],[with_test=yes])
AC_ARG_WITH([remote],
@@ -399,6 +401,17 @@ dnl check for kvm headers
dnl
AC_CHECK_HEADERS([linux/kvm.h])
+dnl OpenNebula driver Compilation setting
+dnl
+
+if test "$with_one" = "yes" ; then
+ LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_ONE -I$ONE_LOCATION/include"
+ ONE_LIBS="-L/usr/local/lib -lxmlrpc_client++ -lxmlrpc -lxmlrpc_util -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc++ -lxmlrpc_client -L$ONE_LOCATION/lib -loneapi"
+ AC_SUBST([ONE_LIBS])
+ AC_DEFINE_UNQUOTED([WITH_ONE],1,[whether Open Nebula Driver is enabled])
+fi
+AM_CONDITIONAL([WITH_ONE],[test "$with_one" = "yes"])
+
dnl Need to test if pkg-config exists
PKG_PROG_PKG_CONFIG
@@ -1345,6 +1358,7 @@ AC_MSG_NOTICE([ QEMU: $with_qemu])
AC_MSG_NOTICE([ UML: $with_uml])
AC_MSG_NOTICE([ OpenVZ: $with_openvz])
AC_MSG_NOTICE([ LXC: $with_lxc])
+AC_MSG_NOTICE([ ONE: $with_one])
AC_MSG_NOTICE([ Test: $with_test])
AC_MSG_NOTICE([ Remote: $with_remote])
AC_MSG_NOTICE([ Network: $with_network])
diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
index 2c3777d..cc98e45 100644
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -61,6 +61,7 @@ typedef enum {
VIR_FROM_UML, /* Error at the UML driver */
VIR_FROM_NODEDEV, /* Error from node device monitor */
VIR_FROM_XEN_INOTIFY, /* Error from xen inotify layer */
+ VIR_FROM_ONE, /* Error from ONE driver */
VIR_FROM_SECURITY, /* Error from security framework */
} virErrorDomain;
diff --git a/qemud/Makefile.am b/qemud/Makefile.am
index 924e8ad..9d7f61f 100644
--- a/qemud/Makefile.am
+++ b/qemud/Makefile.am
@@ -120,6 +120,10 @@ if WITH_UML
libvirtd_LDADD += ../src/libvirt_driver_uml.la
endif
+if WITH_ONE
+ libvirtd_LDADD += ../src/libvirt_driver_one.la
+endif
+
if WITH_STORAGE_DIR
libvirtd_LDADD += ../src/libvirt_driver_storage.la
endif
diff --git a/qemud/qemud.c b/qemud/qemud.c
index 4f04355..e1d6113 100644
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -78,6 +78,9 @@
#ifdef WITH_NETWORK
#include "network_driver.h"
#endif
+#ifdef WITH_ONE
+#include "one_driver.h"
+#endif
#ifdef WITH_STORAGE_DIR
#include "storage_driver.h"
#endif
@@ -841,6 +844,8 @@ static struct qemud_server *qemudInitialize(int sigread) {
virDriverLoadModule("qemu");
virDriverLoadModule("lxc");
virDriverLoadModule("uml");
+ virDriverLoadModule("one");
+
#else
#ifdef WITH_NETWORK
networkRegister();
@@ -861,6 +866,10 @@ static struct qemud_server *qemudInitialize(int sigread) {
#ifdef WITH_UML
umlRegister();
#endif
+#ifdef WITH_ONE
+ oneRegister ();
+#endif
+
#endif
virEventRegisterImpl(virEventAddHandleImpl,
diff --git a/src/Makefile.am b/src/Makefile.am
index d5aac11..a5c2084 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -137,6 +137,10 @@ UML_DRIVER_SOURCES = \
uml_conf.c uml_conf.h \
uml_driver.c uml_driver.h
+ONE_DRIVER_SOURCES = \
+ one_conf.c one_conf.h \
+ one_driver.c one_driver.h
+
NETWORK_DRIVER_SOURCES = \
network_driver.h network_driver.c
@@ -314,6 +318,22 @@ endif
libvirt_driver_uml_la_SOURCES = $(UML_DRIVER_SOURCES)
endif
+if WITH_ONE
+if WITH_DRIVER_MODULES
+mod_LTLIBRARIES += libvirt_driver_one.la
+else
+noinst_LTLIBRARIES += libvirt_driver_one.la
+# Stateful, so linked to daemon instead
+#libvirt_la_LIBADD += libvirt_driver_one.la
+endif
+libvirt_driver_one_la_LDFLAGS = $(ONE_LIBS)
+libvirt_driver_one_la_CFLAGS = "-DWITH_ONE"
+if WITH_DRIVER_MODULES
+libvirt_driver_one_la_LDFLAGS += -module -avoid-version
+endif
+libvirt_driver_one_la_SOURCES = $(ONE_DRIVER_SOURCES)
+endif
+
if WITH_NETWORK
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
@@ -402,6 +422,7 @@ EXTRA_DIST += \
$(QEMU_DRIVER_SOURCES) \
$(LXC_DRIVER_SOURCES) \
$(UML_DRIVER_SOURCES) \
+ $(ONE_DRIVER_SOURCES) \
$(OPENVZ_DRIVER_SOURCES) \
$(NETWORK_DRIVER_SOURCES) \
$(STORAGE_DRIVER_SOURCES) \
diff --git a/src/domain_conf.c b/src/domain_conf.c
index 5bf3483..e4d3249 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -54,7 +54,9 @@ VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST,
"ldom",
"test",
"vmware",
- "hyperv")
+ "hyperv",
+ "one")
+
VIR_ENUM_IMPL(virDomainBoot, VIR_DOMAIN_BOOT_LAST,
"fd",
diff --git a/src/domain_conf.h b/src/domain_conf.h
index dd61467..e8a2bff 100644
--- a/src/domain_conf.h
+++ b/src/domain_conf.h
@@ -48,6 +48,7 @@ enum virDomainVirtType {
VIR_DOMAIN_VIRT_TEST,
VIR_DOMAIN_VIRT_VMWARE,
VIR_DOMAIN_VIRT_HYPERV,
+ VIR_DOMAIN_VIRT_ONE,
VIR_DOMAIN_VIRT_LAST,
};
diff --git a/src/driver.h b/src/driver.h
index 62d6fbc..ed3eef7 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -20,6 +20,7 @@ typedef enum {
VIR_DRV_OPENVZ = 5,
VIR_DRV_LXC = 6,
VIR_DRV_UML = 7,
+ VIR_DRV_ONE = 8,
} virDrvNo;
diff --git a/src/libvirt.c b/src/libvirt.c
index bf3453a..cd4b5b7 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -830,6 +830,10 @@ virGetVersion(unsigned long *libVer, const char *type,
if (STRCASEEQ(type, "OpenVZ"))
*typeVer = LIBVIR_VERSION_NUMBER;
#endif
+#if WITH_ONE
+ if (STRCASEEQ(type, "ONE"))
+ *typeVer = LIBVIR_VERSION_NUMBER;
+#endif
#if WITH_UML
if (STRCASEEQ(type, "UML"))
*typeVer = LIBVIR_VERSION_NUMBER;
----
Distributed System Architecture Group
(http://dsa-research.org)
GridWay, http://www.gridway.org
OpenNEbula, http://www.opennebula.org
More information about the libvir-list
mailing list