[libvirt] [PATCH 1/2] [Plain text ] OpenNebula driver, libvirt-0.6.1

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

On Wed, Mar 18, 2009 at 10:26:01PM +0100, "Abel M?guez Rodr?guez" wrote:
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)
I've applied these patches and tried to build, but there's a number of compilation problems cc1: warnings being treated as errors virterror.c: In function 'virErrorDomainName': virterror.c:81: error: enumeration value 'VIR_FROM_ONE' not handled in switch cc1: warnings being treated as errors one_conf.c: In function 'oneSubmitVM': one_conf.c:119: error: implicit declaration of function 'c_oneAllocate' one_conf.c:119: error: nested extern declaration of 'c_oneAllocate' one_conf.c: In function 'xmlOneTemplate': one_conf.c:146: error: unused variable 'buf' cc1: warnings being treated as errors one_driver.c: In function 'oneDomainGetInfo': one_driver.c:334: error: implicit declaration of function 'c_oneVmInfo' one_driver.c:334: error: nested extern declaration of 'c_oneVmInfo' one_driver.c: In function 'oneDomainStart': one_driver.c:410: error: unused variable 'logfile' one_driver.c:409: error: unused variable 'rc' one_driver.c: In function 'oneDomainShutdown': one_driver.c:496: error: implicit declaration of function 'c_oneShutdown' one_driver.c:496: error: nested extern declaration of 'c_oneShutdown' one_driver.c:505: error: too many arguments for format one_driver.c: In function 'oneDomainDestroy': one_driver.c:536: error: too many arguments for format one_driver.c: In function 'oneDomainSuspend': one_driver.c:565: error: implicit declaration of function 'c_oneSuspend' one_driver.c:565: error: nested extern declaration of 'c_oneSuspend' one_driver.c: In function 'oneDomainResume': one_driver.c:598: error: implicit declaration of function 'c_oneResume' one_driver.c:598: error: nested extern declaration of 'c_oneResume' one_driver.c: In function 'oneStartup': one_driver.c:634: error: implicit declaration of function 'c_oneStart' one_driver.c:634: error: nested extern declaration of 'c_oneStart' one_driver.c:623: error: unused variable 'i' one_driver.c: In function 'oneShutdown': one_driver.c:659: error: implicit declaration of function 'c_oneFree' one_driver.c:659: error: nested extern declaration of 'c_oneFree' one_driver.c: At top level: one_driver.c:742: error: initialization from incompatible pointer type one_driver.c:760: error: missing initializer one_driver.c:760: error: (near initialization for 'oneDriver.nodeDeviceDettach') make: *** [one_driver.lo] Error 1 If you run the 'configure' or 'autogen.sh' passing --enable-compile-warnings=error then you'll see these problems during compilation. Also, when running 'make syntax-check' there are a number of new failures introduced by this patch, when trailing whitespace in the files src/Makefile.am:142: one_driver.c one_driver.h src/domain_conf.c:59: src/libvirt.c:836:#endif Makefile.maint: found trailing blank(s) make: *** [sc_trailing_blank] Error 1
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;
This patch all basically looks sane for integration into libvirt driver code, aside from the warnings I mention above. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Wed, Mar 18, 2009 at 10:26:01PM +0100, "Abel M?guez Rodr?guez" wrote:
+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"
Can you tell me which XML RPC library you're using which provides these ELF libraries ? Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
"Abel Míguez Rodríguez"
-
Daniel P. Berrange