diff --git a/README.md b/README.md index ddd0e2410b..2480dac71f 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ distributed data center infrastructures. Complete documentation can be found at - http://opennebula.org/documentation:rel2.0 + http://opennebula.org/documentation:rel2.4 ## INSTALLATION @@ -111,7 +111,7 @@ where **install_options** can be one or more of: ## CONFIGURATION -Information on how to configure OpenNebula is located at http://opennebula.org/documentation:rel2.0 +Information on how to configure OpenNebula is located at http://opennebula.org/documentation:rel2.4 ## CONTACT diff --git a/include/Nebula.h b/include/Nebula.h index 8a814387be..4d9dd55df4 100644 --- a/include/Nebula.h +++ b/include/Nebula.h @@ -38,7 +38,9 @@ #include "AuthManager.h" #include "ImageManager.h" -class Nebula +#include "Callbackable.h" + +class Nebula : public Callbackable { public: @@ -228,6 +230,11 @@ public: return "OpenNebula 2.3.0"; }; + static int db_version() + { + return 1; + }; + void start(); void get_configuration_attribute( @@ -436,6 +443,28 @@ private: // --------------------------------------------------------------- friend void nebula_signal_handler (int sig); + + /** + * Bootstraps the database control tables + */ + void bootstrap(); + + /** + * Callback function to TODO + * @param _loaded_db_version TODO + * @param num the number of columns read from the DB + * @param names the column names + * @param vaues the column values + * @return 0 on success + */ + int select_cb(void *_loaded_db_version, int num, char **values, + char **names); + + /* + * TODO + * @return 0 ok, -1 version mismatch, -2 needs bootstrap + */ + int check_db_version(); }; #endif /*NEBULA_H_*/ diff --git a/include/PoolSQL.h b/include/PoolSQL.h index fef4fee546..1031b9ca1f 100644 --- a/include/PoolSQL.h +++ b/include/PoolSQL.h @@ -47,7 +47,7 @@ public: * counter). If null the OID counter is not updated. * @param with_uid the Pool objects have an owner id (uid) */ - PoolSQL(SqlDB * _db, const char * table); + PoolSQL(SqlDB * _db, const char * _table); virtual ~PoolSQL(); @@ -189,6 +189,11 @@ private: */ int lastOID; + /** + * Tablename for this pool + */ + string table; + /** * The pool is implemented with a Map of SQL object pointers, using the * OID as key. @@ -253,6 +258,11 @@ private: return key.str(); }; + /** + * Inserts the last oid into the pool_control table + */ + void update_lastOID(); + /* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */ diff --git a/install.sh b/install.sh index b2283b3547..a8d5f03190 100755 --- a/install.sh +++ b/install.sh @@ -181,6 +181,7 @@ LIB_DIRS="$LIB_LOCATION/ruby \ $LIB_LOCATION/ruby/cloud/econe \ $LIB_LOCATION/ruby/cloud/econe/views \ $LIB_LOCATION/ruby/cloud/occi \ + $LIB_LOCATION/onedb \ $LIB_LOCATION/tm_commands \ $LIB_LOCATION/tm_commands/nfs \ $LIB_LOCATION/tm_commands/ssh \ @@ -258,9 +259,13 @@ INSTALL_FILES=( LIB_FILES:$LIB_LOCATION RUBY_LIB_FILES:$LIB_LOCATION/ruby RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula + MAD_RUBY_LIB_FILES:$LIB_LOCATION/ruby + MAD_RUBY_LIB_FILES:$LIB_LOCATION/remotes + MAD_RUBY_LIB_FILES:$VAR_LOCATION/remotes MAD_SH_LIB_FILES:$LIB_LOCATION/sh MAD_SH_LIB_FILES:$LIB_LOCATION/remotes MAD_SH_LIB_FILES:$VAR_LOCATION/remotes + ONEDB_MIGRATOR_FILES:$LIB_LOCATION/onedb MADS_LIB_FILES:$LIB_LOCATION/mads IM_PROBES_FILES:$VAR_LOCATION/remotes/im IM_PROBES_KVM_FILES:$VAR_LOCATION/remotes/im/kvm.d @@ -366,6 +371,7 @@ BIN_FILES="src/nebula/oned \ src/cli/onecluster \ src/cli/onetemplate \ src/cli/onegroup \ + src/cli/onedb \ share/scripts/one \ src/authm_mad/oneauth" @@ -418,11 +424,12 @@ RUBY_OPENNEBULA_LIB_FILES="src/oca/ruby/OpenNebula/Host.rb \ #----------------------------------------------------------------------------- -# MAD ShellScript library files, to be installed under $LIB_LOCATION/sh +# MAD Script library files, to be installed under $LIB_LOCATION/