diff --git a/include/Driver.h b/include/Driver.h index 67ffa1a562..a2ab32f308 100644 --- a/include/Driver.h +++ b/include/Driver.h @@ -49,6 +49,7 @@ public: : cmd(c) , arg(a) , concurrency(ct) + , pid(-1) {} ~Driver() @@ -142,12 +143,12 @@ private: std::string arg; - int concurrency = 0; + int concurrency; /** * Process ID of the driver */ - pid_t pid = -1; + pid_t pid; /** * Class to read lines from the stream @@ -222,9 +223,7 @@ void Driver if (!success) { kill(pid, SIGKILL); - } - - pid = -1; + }; } /* -------------------------------------------------------------------------- */ diff --git a/include/DriverManager.h b/include/DriverManager.h index 0681fe7487..cd559d77b6 100644 --- a/include/DriverManager.h +++ b/include/DriverManager.h @@ -32,10 +32,7 @@ public: { } - virtual ~DriverManager() - { - stop(1); - } + virtual ~DriverManager() = default; int load_driver(const VectorAttribute* mad_config); @@ -120,11 +117,11 @@ int DriverManager::load_driver(const VectorAttribute* mad_config) mad_config->vector_value("THREADS", threads, 0); - NebulaLog::info("DrM", " Loading driver: " + name); + NebulaLog::info("DrM", "Loading driver: " + name); if (exec.empty()) { - NebulaLog::error("DrM", " Empty executable for driver: " + name); + NebulaLog::error("DrM", "\tEmpty executable for driver: " + name); return -1; } @@ -135,7 +132,7 @@ int DriverManager::load_driver(const VectorAttribute* mad_config) if (access(exec.c_str(), F_OK) != 0) { - NebulaLog::error("DrM", " File not exists: " + exec); + NebulaLog::error("DrM", "File not exists: " + exec); return -1; } @@ -144,11 +141,11 @@ int DriverManager::load_driver(const VectorAttribute* mad_config) if (rc.second) { - NebulaLog::info("DrM", " Driver loaded: " + name); + NebulaLog::info("DrM", "\tDriver loaded: " + name); } else { - NebulaLog::error("DrM", " Driver already exists: " + name); + NebulaLog::error("DrM", "\tDriver already exists: " + name); return -1; } @@ -253,8 +250,6 @@ int DriverManager::add(const std::string& name, std::unique_ptr driver) if (!rc.second) { // Driver already exists - NebulaLog::error("DrM", " Driver already exists: " + name); - return -1; } diff --git a/include/Listener.h b/include/Listener.h index 2ffc399713..b3e8513d83 100644 --- a/include/Listener.h +++ b/include/Listener.h @@ -134,13 +134,6 @@ public: virtual ~Listener() { - if (!end) - { - end = true; - - cond.notify_one(); - } - join_thread(); } diff --git a/src/nebula/Nebula.cc b/src/nebula/Nebula.cc index e95c1894ca..523ddfafd9 100644 --- a/src/nebula/Nebula.cc +++ b/src/nebula/Nebula.cc @@ -1237,7 +1237,7 @@ void Nebula::start(bool bootstrap_only) return; error_mad: - NebulaLog::log("ONE", Log::ERROR, "Could not load driver, exiting..."); + NebulaLog::log("ONE", Log::ERROR, "Could not load driver"); throw runtime_error("Could not load an OpenNebula driver"); } diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index 448c96a074..8fff83604e 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -2593,7 +2593,7 @@ int VirtualMachineManager::load_drivers(const vector& _m one_util::toupper(type); - oss << " Loading driver: " << name << " (" << type << ")"; + oss << "\tLoading driver: " << name << " (" << type << ")"; NebulaLog::log("VMM", Log::INFO, oss); @@ -2616,7 +2616,7 @@ int VirtualMachineManager::load_drivers(const vector& _m else { oss.str(""); - oss << " Unknown driver type: " << type; + oss << "\tUnknown driver type: " << type; NebulaLog::log("VMM",Log::ERROR,oss); @@ -2631,7 +2631,7 @@ int VirtualMachineManager::load_drivers(const vector& _m } oss.str(""); - oss << " Driver " << name << " loaded."; + oss << "\tDriver " << name << " loaded."; NebulaLog::log("VMM",Log::INFO,oss); } diff --git a/src/vmm/VirtualMachineManagerDriver.cc b/src/vmm/VirtualMachineManagerDriver.cc index e9f7239082..ccd3d582c5 100644 --- a/src/vmm/VirtualMachineManagerDriver.cc +++ b/src/vmm/VirtualMachineManagerDriver.cc @@ -76,14 +76,14 @@ VirtualMachineManagerDriver::VirtualMachineManagerDriver( if ( error_msg != nullptr ) { - oss << " Error loading driver configuration file " << cfile << + oss << "Error loading driver configuration file " << cfile << " : " << error_msg; free(error_msg); } else { - oss << " Error loading driver configuration file " << cfile; + oss << "Error loading driver configuration file " << cfile; } NebulaLog::log("VMM", Log::ERROR, oss); @@ -128,7 +128,7 @@ VirtualMachineManagerDriver::VirtualMachineManagerDriver( } else { - NebulaLog::log("VMM", Log::INFO, " Using default imported VMs actions"); + NebulaLog::log("VMM", Log::INFO, "Using default imported VMs actions"); it = attrs.find("NAME"); @@ -158,7 +158,7 @@ VirtualMachineManagerDriver::VirtualMachineManagerDriver( if ( VMActions::action_from_str(action, id) != 0 ) { - NebulaLog::log("VMM", Log::ERROR, " Wrong action: " + action); + NebulaLog::log("VMM", Log::ERROR, "Wrong action: " + action); continue; } @@ -177,7 +177,7 @@ VirtualMachineManagerDriver::VirtualMachineManagerDriver( if (exec.empty()) { - NebulaLog::error("VMM", " Empty executable for driver: " + name); + NebulaLog::error("VMM", "\tEmpty executable for driver: " + name); return; } @@ -188,7 +188,7 @@ VirtualMachineManagerDriver::VirtualMachineManagerDriver( if (access(exec.c_str(), F_OK) != 0) { - NebulaLog::error("VMM", " File not exists: " + exec); + NebulaLog::error("VMM", "File not exists: " + exec); } cmd_(exec);