From beae0776c344334d3503529751aab8a1e75915ea Mon Sep 17 00:00:00 2001 From: juanmont Date: Tue, 26 Sep 2017 18:30:13 +0200 Subject: [PATCH] B #5405: unified functionality for free vm resources in a single function (#498) --- include/DispatchManager.h | 10 ++++- src/dm/DispatchManager.cc | 1 + src/dm/DispatchManagerActions.cc | 30 +++++++++++++-- src/dm/DispatchManagerStates.cc | 66 +------------------------------- 4 files changed, 37 insertions(+), 70 deletions(-) diff --git a/include/DispatchManager.h b/include/DispatchManager.h index 6f42c6fee7..797c620fbf 100644 --- a/include/DispatchManager.h +++ b/include/DispatchManager.h @@ -21,6 +21,7 @@ #include "HostPool.h" #include "VirtualMachinePool.h" #include "VirtualRouterPool.h" +#include "ClusterPool.h" using namespace std; @@ -82,7 +83,7 @@ class DispatchManager : public ActionListener public: DispatchManager(): - hpool(0), vmpool(0), vrouterpool(0), tm(0), vmm(0), lcm(0), imagem(0) + hpool(0), vmpool(0), clpool(0), vrouterpool(0), tm(0), vmm(0), lcm(0), imagem(0) { am.addListener(this); }; @@ -497,7 +498,12 @@ private: VirtualMachinePool * vmpool; /** - * Pointer to the Virtual Machine Pool, to access hosts + * Pointer to the Cluster Pool + */ + ClusterPool * clpool; + + /** + * Pointer to the Virtual Router Pool */ VirtualRouterPool * vrouterpool; diff --git a/src/dm/DispatchManager.cc b/src/dm/DispatchManager.cc index 128d479cb5..5c9a32a66b 100644 --- a/src/dm/DispatchManager.cc +++ b/src/dm/DispatchManager.cc @@ -109,6 +109,7 @@ void DispatchManager::init_managers() hpool = nd.get_hpool(); vmpool = nd.get_vmpool(); + clpool = nd.get_clpool(); vrouterpool = nd.get_vrouterpool(); } diff --git a/src/dm/DispatchManagerActions.cc b/src/dm/DispatchManagerActions.cc index d4ce82ee0b..ba19b069b0 100644 --- a/src/dm/DispatchManagerActions.cc +++ b/src/dm/DispatchManagerActions.cc @@ -214,19 +214,33 @@ void DispatchManager::free_vm_resources(VirtualMachine * vm) Template* tmpl; vector