diff --git a/include/Nebula.h b/include/Nebula.h index 2dace61736..3acc32a8b5 100644 --- a/include/Nebula.h +++ b/include/Nebula.h @@ -217,10 +217,16 @@ public: string get_system_ds_path() { Datastore * ds; - string system_ds_path; + string system_ds_path = ""; ds = dspool->get(DatastorePool::SYSTEM_DS_ID, true); + if ( ds == 0 ) + { + NebulaLog::log("DaS", Log::ERROR, "Can not get system datastore"); + return system_ds_path; + } + system_ds_path = ds->get_base_path(); ds->unlock(); @@ -235,10 +241,16 @@ public: string get_system_ds_tm_mad() { Datastore * ds; - string tm_mad; + string tm_mad = ""; ds = dspool->get(DatastorePool::SYSTEM_DS_ID, true); + if ( ds == 0 ) + { + NebulaLog::log("DaS", Log::ERROR, "Can not get system datastore"); + return tm_mad; + } + tm_mad = ds->get_tm_mad(); ds->unlock(); @@ -253,16 +265,23 @@ public: string get_system_ds_name() { Datastore * ds; - string name; + string name = ""; ds = dspool->get(DatastorePool::SYSTEM_DS_ID, true); + if ( ds == 0 ) + { + NebulaLog::log("DaS", Log::ERROR, "Can not get system datastore"); + return name; + } + name = ds->get_name(); ds->unlock(); return name; }; + /** * Returns the path of the log file for a VM, depending where OpenNebula is * installed, diff --git a/src/vm/History.cc b/src/vm/History.cc index f06a208ca3..747b057be0 100644 --- a/src/vm/History.cc +++ b/src/vm/History.cc @@ -91,7 +91,6 @@ void History::non_persistent_data() { ostringstream os; string vm_lhome; - string vm_rhome; Nebula& nd = Nebula::instance(); // ----------- Local Locations ------------