diff --git a/include/Request.h b/include/Request.h index e6d3677a8a..aad5915c9b 100644 --- a/include/Request.h +++ b/include/Request.h @@ -235,8 +235,8 @@ protected: * @param _paramlist list of XML parameters * @param _retval value to be returned to the client */ - virtual void execute(xmlrpc_c::paramList const& _paramList, - const xmlrpc_c::callInfo * _callInfoP, xmlrpc_c::value * const _retval); + void execute(xmlrpc_c::paramList const& _paramList, + const xmlrpc_c::callInfo * _callInfoP, xmlrpc_c::value * const _retval) override; /** * Actual Execution method for the request. Must be implemented by the diff --git a/include/RequestManagerAcl.h b/include/RequestManagerAcl.h index 1e92bb865c..41089d1f39 100644 --- a/include/RequestManagerAcl.h +++ b/include/RequestManagerAcl.h @@ -68,7 +68,7 @@ public: ~AclAddRule(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -86,7 +86,7 @@ public: ~AclDelRule(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -104,7 +104,7 @@ public: ~AclInfo(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerAllocate.h b/include/RequestManagerAllocate.h index b2a2faf0c4..e52a674f66 100644 --- a/include/RequestManagerAllocate.h +++ b/include/RequestManagerAllocate.h @@ -50,8 +50,8 @@ protected: /* -------------------------------------------------------------------- */ - virtual void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + void request_execute(xmlrpc_c::paramList const& _paramList, + RequestAttributes& att) override; virtual bool allocate_authorization(xmlrpc_c::paramList const& _paramList, Template *obj_template, RequestAttributes& att, @@ -140,7 +140,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new VirtualMachineTemplate; }; @@ -148,11 +148,11 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; bool allocate_authorization(xmlrpc_c::paramList const& paramList, Template *obj_template, RequestAttributes& att, - PoolObjectAuth *cluster_perms); + PoolObjectAuth *cluster_perms) override; }; /* ------------------------------------------------------------------------- */ @@ -176,7 +176,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new VirtualNetworkTemplate; }; @@ -186,9 +186,9 @@ public: int& id, RequestAttributes& att, int cluster_id, - const string& cluster_name); + const string& cluster_name) override; - int get_cluster_id(xmlrpc_c::paramList const& paramList) + int get_cluster_id(xmlrpc_c::paramList const& paramList) override { return RequestManagerAllocate::get_cluster_id(paramList, 2); }; @@ -196,7 +196,7 @@ public: int add_to_cluster( Cluster* cluster, int id, - string& error_msg) + string& error_msg) override { return clpool->add_to_cluster(PoolObjectSQL::NET, cluster, id, error_msg); }; @@ -224,7 +224,7 @@ public: /* --------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -248,7 +248,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new VirtualMachineTemplate; }; @@ -256,11 +256,11 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; bool allocate_authorization(xmlrpc_c::paramList const& paramList, Template *obj_template, RequestAttributes& att, - PoolObjectAuth *cluster_perms); + PoolObjectAuth *cluster_perms) override; }; class VirtualNetworkTemplateAllocate : public RequestManagerAllocate @@ -281,7 +281,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new VirtualMachineTemplate; }; @@ -289,11 +289,11 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; bool allocate_authorization(xmlrpc_c::paramList const& paramList, Template *obj_template, RequestAttributes& att, - PoolObjectAuth *cluster_perms); + PoolObjectAuth *cluster_perms) override; }; /* ------------------------------------------------------------------------- */ @@ -322,9 +322,9 @@ public: int& id, RequestAttributes& att, int cluster_id, - const string& cluster_name); + const string& cluster_name) override; - int get_cluster_id(xmlrpc_c::paramList const& paramList) + int get_cluster_id(xmlrpc_c::paramList const& paramList) override { return RequestManagerAllocate::get_cluster_id(paramList, 4); }; @@ -332,7 +332,7 @@ public: int add_to_cluster( Cluster* cluster, int id, - string& error_msg) + string& error_msg) override { return clpool->add_to_cluster(PoolObjectSQL::HOST, cluster, id, error_msg);; }; @@ -363,11 +363,11 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; bool allocate_authorization(xmlrpc_c::paramList const& paramList, Template *obj_template, RequestAttributes& att, - PoolObjectAuth *cluster_perms); + PoolObjectAuth *cluster_perms) override; private: GroupPool * gpool; }; @@ -396,7 +396,7 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; private: VdcPool * vdcpool; @@ -423,7 +423,7 @@ public: /* -------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new DatastoreTemplate; }; @@ -433,9 +433,9 @@ public: int& id, RequestAttributes& att, int cluster_id, - const string& cluster_name); + const string& cluster_name) override; - int get_cluster_id(xmlrpc_c::paramList const& paramList) + int get_cluster_id(xmlrpc_c::paramList const& paramList) override { return RequestManagerAllocate::get_cluster_id(paramList, 2); }; @@ -443,7 +443,7 @@ public: int add_to_cluster( Cluster* cluster, int id, - string& error_msg) + string& error_msg) override { return clpool->add_to_cluster(PoolObjectSQL::DATASTORE, cluster, id, error_msg); }; @@ -471,7 +471,7 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -495,7 +495,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new Template; }; @@ -503,7 +503,7 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -528,9 +528,9 @@ public: /* --------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; - Template * get_object_template() + Template * get_object_template() override { return new Template; }; @@ -538,7 +538,7 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -562,7 +562,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new Template; }; @@ -594,7 +594,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new Template; }; @@ -602,7 +602,7 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; }; @@ -627,7 +627,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new Template; }; @@ -635,11 +635,11 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; bool allocate_authorization(xmlrpc_c::paramList const& paramList, Template *obj_template, RequestAttributes& att, - PoolObjectAuth *cluster_perms); + PoolObjectAuth *cluster_perms) override; }; /* ------------------------------------------------------------------------- */ @@ -663,7 +663,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new MarketPlaceTemplate; }; @@ -671,7 +671,7 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& _paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -696,7 +696,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new MarketPlaceAppTemplate; }; @@ -704,7 +704,7 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& _paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; private: MarketPlacePool * mppool; }; @@ -730,7 +730,7 @@ public: /* --------------------------------------------------------------------- */ - Template * get_object_template() + Template * get_object_template() override { return new Template; }; @@ -738,7 +738,7 @@ public: Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList, Template * tmpl, int& id, - RequestAttributes& att); + RequestAttributes& att) override; }; #endif diff --git a/include/RequestManagerAllocateDB.h b/include/RequestManagerAllocateDB.h index f47585061b..35949cac12 100644 --- a/include/RequestManagerAllocateDB.h +++ b/include/RequestManagerAllocateDB.h @@ -31,13 +31,13 @@ protected: auth_op = AuthRequest::MANAGE; }; - virtual ~RequestManagerAllocateDB(){}; + ~RequestManagerAllocateDB(){}; virtual PoolObjectSQL * create(const std::string& xml) = 0; /* -------------------------------------------------------------------- */ - void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& att) + void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& att) override { std::string xml = xmlrpc_c::value_string(pl.getString(1)); @@ -75,11 +75,11 @@ public: pool = Nebula::instance().get_apppool(); }; - virtual ~MarketPlaceAppAllocateDB(){}; + ~MarketPlaceAppAllocateDB(){}; /* -------------------------------------------------------------------- */ - PoolObjectSQL * create(const std::string& xml) + PoolObjectSQL * create(const std::string& xml) override { PoolObjectSQL * app = static_cast(pool)->create(); @@ -101,11 +101,11 @@ public: pool = Nebula::instance().get_marketpool(); }; - virtual ~MarketPlaceAllocateDB(){}; + ~MarketPlaceAllocateDB(){}; /* -------------------------------------------------------------------- */ - PoolObjectSQL * create(const std::string& xml) + PoolObjectSQL * create(const std::string& xml) override { PoolObjectSQL * mp = static_cast(pool)->create(); diff --git a/include/RequestManagerChmod.h b/include/RequestManagerChmod.h index 53c19a2593..925a5a2a2d 100644 --- a/include/RequestManagerChmod.h +++ b/include/RequestManagerChmod.h @@ -38,7 +38,7 @@ protected: /* -------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; virtual ErrorCode chmod(PoolSQL * pool, int oid, int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, @@ -237,8 +237,8 @@ public: ~VirtualRouterChmod(){}; - virtual void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + void request_execute(xmlrpc_c::paramList const& _paramList, + RequestAttributes& att) override; private: diff --git a/include/RequestManagerChown.h b/include/RequestManagerChown.h index 807cef193a..43f358b008 100644 --- a/include/RequestManagerChown.h +++ b/include/RequestManagerChown.h @@ -50,8 +50,8 @@ protected: /* -------------------------------------------------------------------- */ - virtual void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + void request_execute(xmlrpc_c::paramList const& _paramList, + RequestAttributes& att) override; PoolObjectSQL * get_and_quota(int oid, int new_uid, @@ -98,7 +98,7 @@ public: ~VirtualMachineChown(){}; - int check_name_unique(int oid, int noid, RequestAttributes& att) + int check_name_unique(int oid, int noid, RequestAttributes& att) override { return 0; }; @@ -198,10 +198,10 @@ public: /* -------------------------------------------------------------------- */ - virtual void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + void request_execute(xmlrpc_c::paramList const& _paramList, + RequestAttributes& att) override; - int check_name_unique(int oid, int noid, RequestAttributes& att) + int check_name_unique(int oid, int noid, RequestAttributes& att) override { return 0; }; @@ -224,7 +224,7 @@ public: ~DatastoreChown(){}; - int check_name_unique(int oid, int noid, RequestAttributes& att) + int check_name_unique(int oid, int noid, RequestAttributes& att) override { return 0; }; @@ -247,7 +247,7 @@ public: ~DocumentChown(){}; - int check_name_unique(int oid, int noid, RequestAttributes& att) + int check_name_unique(int oid, int noid, RequestAttributes& att) override { return 0; }; @@ -306,7 +306,7 @@ public: ~MarketPlaceChown(){}; - int check_name_unique(int oid, int noid, RequestAttributes& att) + int check_name_unique(int oid, int noid, RequestAttributes& att) override { return 0; }; diff --git a/include/RequestManagerClone.h b/include/RequestManagerClone.h index eccab5a0f2..3fbdb66d0e 100644 --- a/include/RequestManagerClone.h +++ b/include/RequestManagerClone.h @@ -39,7 +39,7 @@ protected: /* -------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; /* -------------------------------------------------------------------- */ /* Especialization Functions for specific Clone actions */ @@ -100,14 +100,14 @@ public: protected: ErrorCode clone(int source_id, const string &name, int &new_id, - bool recursive, const string& s_a, RequestAttributes& att); + bool recursive, const string& s_a, RequestAttributes& att) override; - Template * clone_template(PoolObjectSQL* obj) + Template * clone_template(PoolObjectSQL* obj) override { return static_cast(obj)->clone_template(); }; - int pool_allocate(int sid, Template * tmpl, int& id, RequestAttributes& att) + int pool_allocate(int sid, Template * tmpl, int& id, RequestAttributes& att) override { VMTemplatePool * tpool = static_cast(pool); VirtualMachineTemplate * t = static_cast(tmpl); @@ -116,7 +116,7 @@ protected: t, &id, att.resp_msg); }; - ErrorCode merge(Template * tmpl, const string &s_a, RequestAttributes& att) + ErrorCode merge(Template * tmpl, const string &s_a, RequestAttributes& att) override { VMTemplateInstantiate vm_instantiate; @@ -151,12 +151,12 @@ public: protected: - Template * clone_template(PoolObjectSQL* obj) + Template * clone_template(PoolObjectSQL* obj) override { return static_cast(obj)->clone_template(); }; - int pool_allocate(int sid, Template * tmpl, int& id, RequestAttributes& att) + int pool_allocate(int sid, Template * tmpl, int& id, RequestAttributes& att) override { VNTemplatePool * tpool = static_cast(pool); VirtualNetworkTemplate * t = static_cast(tmpl); @@ -187,12 +187,12 @@ public: protected: - Template * clone_template(PoolObjectSQL* obj) + Template * clone_template(PoolObjectSQL* obj) override { return static_cast(obj)->clone_template(); }; - int pool_allocate(int sid, Template * tmpl, int& id, RequestAttributes& att) + int pool_allocate(int sid, Template * tmpl, int& id, RequestAttributes& att) override { DocumentPool * docpool = static_cast(pool); Document * doc = docpool->get_ro(sid); @@ -231,12 +231,12 @@ public: protected: - Template * clone_template(PoolObjectSQL* obj) + Template * clone_template(PoolObjectSQL* obj) override { return static_cast(obj)->clone_template(); }; - int pool_allocate(int sid, Template * tmpl, int& id, RequestAttributes& att) + int pool_allocate(int sid, Template * tmpl, int& id, RequestAttributes& att) override { SecurityGroupPool * sg = static_cast(pool); diff --git a/include/RequestManagerCluster.h b/include/RequestManagerCluster.h index 2888f4fb46..4ca1fadc82 100644 --- a/include/RequestManagerCluster.h +++ b/include/RequestManagerCluster.h @@ -151,7 +151,7 @@ public: ~ClusterAddHost(){}; void request_execute(xmlrpc_c::paramList const& paramList, - RequestAttributes& att) + RequestAttributes& att) override { int cluster_id = xmlrpc_c::value_int(paramList.getInt(1)); int object_id = xmlrpc_c::value_int(paramList.getInt(2)); @@ -174,7 +174,7 @@ public: ~ClusterDelHost(){}; void request_execute(xmlrpc_c::paramList const& paramList, - RequestAttributes& att) + RequestAttributes& att) override { // First param is ignored, as objects can be assigned to only // one cluster @@ -202,17 +202,17 @@ public: virtual int add_object( Cluster* cluster, int id, - string& error_msg) + string& error_msg) override { return clpool->add_to_cluster(PoolObjectSQL::DATASTORE, cluster, id, error_msg); }; - virtual int del_object(Cluster* cluster, int id, string& error_msg) + virtual int del_object(Cluster* cluster, int id, string& error_msg) override { return clpool->del_from_cluster(PoolObjectSQL::DATASTORE, cluster, id, error_msg); }; - virtual void get(int oid, PoolObjectSQL ** object, Clusterable ** cluster_obj) + virtual void get(int oid, PoolObjectSQL ** object, Clusterable ** cluster_obj) override { Datastore * ds = dspool->get(oid); @@ -235,7 +235,7 @@ public: ~ClusterAddDatastore(){}; void request_execute(xmlrpc_c::paramList const& paramList, - RequestAttributes& att) + RequestAttributes& att) override { int cluster_id = xmlrpc_c::value_int(paramList.getInt(1)); int object_id = xmlrpc_c::value_int(paramList.getInt(2)); @@ -259,7 +259,7 @@ public: ~ClusterDelDatastore(){}; void request_execute(xmlrpc_c::paramList const& paramList, - RequestAttributes& att) + RequestAttributes& att) override { int cluster_id = xmlrpc_c::value_int(paramList.getInt(1)); int object_id = xmlrpc_c::value_int(paramList.getInt(2)); @@ -287,17 +287,17 @@ public: virtual int add_object( Cluster* cluster, int id, - string& error_msg) + string& error_msg) override { return clpool->add_to_cluster(PoolObjectSQL::NET, cluster, id, error_msg); }; - virtual int del_object(Cluster* cluster, int id, string& error_msg) + virtual int del_object(Cluster* cluster, int id, string& error_msg) override { return clpool->del_from_cluster(PoolObjectSQL::NET, cluster, id, error_msg); }; - virtual void get(int oid, PoolObjectSQL ** object, Clusterable ** cluster_obj) + virtual void get(int oid, PoolObjectSQL ** object, Clusterable ** cluster_obj) override { VirtualNetwork * vnet = vnpool->get(oid); @@ -320,7 +320,7 @@ public: ~ClusterAddVNet(){}; void request_execute(xmlrpc_c::paramList const& paramList, - RequestAttributes& att) + RequestAttributes& att) override { int cluster_id = xmlrpc_c::value_int(paramList.getInt(1)); int object_id = xmlrpc_c::value_int(paramList.getInt(2)); @@ -344,7 +344,7 @@ public: ~ClusterDelVNet(){}; void request_execute(xmlrpc_c::paramList const& paramList, - RequestAttributes& att) + RequestAttributes& att) override { int cluster_id = xmlrpc_c::value_int(paramList.getInt(1)); int object_id = xmlrpc_c::value_int(paramList.getInt(2)); diff --git a/include/RequestManagerDatastore.h b/include/RequestManagerDatastore.h index d39a085b6f..c35052e567 100644 --- a/include/RequestManagerDatastore.h +++ b/include/RequestManagerDatastore.h @@ -61,7 +61,7 @@ public: ~DatastoreEnable(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerDelete.h b/include/RequestManagerDelete.h index cf6ac55c06..013e77667b 100644 --- a/include/RequestManagerDelete.h +++ b/include/RequestManagerDelete.h @@ -57,7 +57,7 @@ protected: void request_execute(xmlrpc_c::paramList const& paramList, - RequestAttributes& att); + RequestAttributes& att) override; ErrorCode delete_object(int oid, bool recursive, RequestAttributes& att, AuthRequest::Operation auth); @@ -110,7 +110,7 @@ public: protected: - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -157,17 +157,17 @@ public: protected: - set get_cluster_ids(PoolObjectSQL * object) + set get_cluster_ids(PoolObjectSQL * object) override { return static_cast(object)->get_cluster_ids(); }; - int del_from_cluster(Cluster* cluster, int id, string& error_msg) + int del_from_cluster(Cluster* cluster, int id, string& error_msg) override { return clpool->del_from_cluster(PoolObjectSQL::NET, cluster, id, error_msg); }; - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -192,11 +192,11 @@ public: }; void request_execute(xmlrpc_c::paramList const& paramList, - RequestAttributes& att); + RequestAttributes& att) override; protected: - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -218,7 +218,7 @@ public: protected: - set get_cluster_ids(PoolObjectSQL * object) + set get_cluster_ids(PoolObjectSQL * object) override { set ids; @@ -227,12 +227,12 @@ protected: return ids; }; - int del_from_cluster(Cluster* cluster, int id, string& error_msg) + int del_from_cluster(Cluster* cluster, int id, string& error_msg) override { return clpool->del_from_cluster(PoolObjectSQL::HOST, cluster, id, error_msg); }; - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -255,7 +255,7 @@ public: protected: - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -281,7 +281,7 @@ protected: GroupPool * gpool; - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -303,15 +303,17 @@ public: /* -------------------------------------------------------------------- */ - set get_cluster_ids(PoolObjectSQL * object) + set get_cluster_ids(PoolObjectSQL * object) override { return static_cast(object)->get_cluster_ids(); }; - int del_from_cluster(Cluster* cluster, int id, string& error_msg) + int del_from_cluster(Cluster* cluster, int id, string& error_msg) override { return clpool->del_from_cluster(PoolObjectSQL::DATASTORE, cluster, id, error_msg); }; + + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -333,7 +335,7 @@ public: protected: - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -373,7 +375,7 @@ public: protected: - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -395,7 +397,7 @@ public: protected: - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -434,7 +436,7 @@ public: ~VirtualRouterDelete(){}; protected: - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -456,7 +458,7 @@ public: protected: - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -478,7 +480,7 @@ public: protected: - int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att); + int drop(PoolObjectSQL * obj, bool resive, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ diff --git a/include/RequestManagerDropDB.h b/include/RequestManagerDropDB.h index bdbcef3f11..30eb058bbe 100644 --- a/include/RequestManagerDropDB.h +++ b/include/RequestManagerDropDB.h @@ -35,7 +35,7 @@ protected: /* -------------------------------------------------------------------- */ - void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& att) + void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& att) override { std::string error; int oid = xmlrpc_c::value_int(pl.getInt(1)); diff --git a/include/RequestManagerGroup.h b/include/RequestManagerGroup.h index f1637d77b2..e550580dd2 100644 --- a/include/RequestManagerGroup.h +++ b/include/RequestManagerGroup.h @@ -40,7 +40,7 @@ protected: auth_object = PoolObjectSQL::GROUP; }; - virtual ~RequestManagerGroup(){}; + ~RequestManagerGroup(){}; virtual void request_execute(xmlrpc_c::paramList const& _paramList, RequestAttributes& att) = 0; @@ -63,7 +63,7 @@ public: ~GroupSetQuota(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -73,7 +73,7 @@ class GroupEditAdmin : public Request { public: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; protected: GroupEditAdmin( const string& method_name, @@ -107,7 +107,7 @@ public: ~GroupAddAdmin(){}; - int edit_admin(Group* group, int user_id, string& error_msg); + int edit_admin(Group* group, int user_id, string& error_msg) override; }; /* ------------------------------------------------------------------------- */ @@ -123,7 +123,7 @@ public: ~GroupDelAdmin(){}; - int edit_admin(Group* group, int user_id, string& error_msg); + int edit_admin(Group* group, int user_id, string& error_msg) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerHost.h b/include/RequestManagerHost.h index 350a8d9e9b..5edcc7b121 100644 --- a/include/RequestManagerHost.h +++ b/include/RequestManagerHost.h @@ -70,7 +70,7 @@ public: ~HostStatus(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -90,7 +90,7 @@ public: ~HostMonitoring(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerImage.h b/include/RequestManagerImage.h index e0a4d61755..979bf14b48 100644 --- a/include/RequestManagerImage.h +++ b/include/RequestManagerImage.h @@ -64,7 +64,7 @@ public: protected: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -85,7 +85,7 @@ public: protected: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -103,7 +103,7 @@ public: protected: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -126,7 +126,7 @@ public: protected: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -144,7 +144,7 @@ public: protected: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -162,7 +162,7 @@ public: protected: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -180,7 +180,7 @@ public: protected: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerInfo.h b/include/RequestManagerInfo.h index cbdcb8d4bf..e29ecf0613 100644 --- a/include/RequestManagerInfo.h +++ b/include/RequestManagerInfo.h @@ -42,8 +42,8 @@ protected: /* -------------------------------------------------------------------- */ - virtual void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + void request_execute(xmlrpc_c::paramList const& _paramList, + RequestAttributes& att) override; /* -------------------------------------------------------------------- */ @@ -73,7 +73,7 @@ public: /* -------------------------------------------------------------------- */ - void to_xml(RequestAttributes& att, PoolObjectSQL * object, string& str) + void to_xml(RequestAttributes& att, PoolObjectSQL * object, string& str) override { static_cast(object)->to_xml_extended(str); }; @@ -99,7 +99,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -122,7 +122,7 @@ public: /* -------------------------------------------------------------------- */ - void to_xml(RequestAttributes& att, PoolObjectSQL * object, string& str); + void to_xml(RequestAttributes& att, PoolObjectSQL * object, string& str) override; }; /* ------------------------------------------------------------------------- */ @@ -146,7 +146,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; @@ -166,7 +166,6 @@ public: }; ~ImageInfo(){}; - }; /* ------------------------------------------------------------------------- */ @@ -206,7 +205,7 @@ public: /* -------------------------------------------------------------------- */ - void to_xml(RequestAttributes& att, PoolObjectSQL * object, string& str) + void to_xml(RequestAttributes& att, PoolObjectSQL * object, string& str) override { static_cast(object)->to_xml_extended(str); }; @@ -231,7 +230,7 @@ public: /* -------------------------------------------------------------------- */ - void to_xml(RequestAttributes& att, PoolObjectSQL * object, string& str) + void to_xml(RequestAttributes& att, PoolObjectSQL * object, string& str) override { static_cast(object)->to_xml_extended(str); }; diff --git a/include/RequestManagerLock.h b/include/RequestManagerLock.h index fb231b038f..3bce1f4c2d 100644 --- a/include/RequestManagerLock.h +++ b/include/RequestManagerLock.h @@ -41,7 +41,7 @@ protected: /* -------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; int lock_db(PoolObjectSQL * object, const int owner, const int req_id, const int level) { @@ -67,7 +67,7 @@ protected: /* -------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; int unlock_db(PoolObjectSQL * object, const int owner, const int req_id) { diff --git a/include/RequestManagerMarketPlaceApp.h b/include/RequestManagerMarketPlaceApp.h index 12094253f0..64c3c46cf3 100644 --- a/include/RequestManagerMarketPlaceApp.h +++ b/include/RequestManagerMarketPlaceApp.h @@ -57,7 +57,7 @@ public: ~MarketPlaceAppEnable(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerPoolInfoFilter.h b/include/RequestManagerPoolInfoFilter.h index b0e9cf3b37..d4ba612b74 100644 --- a/include/RequestManagerPoolInfoFilter.h +++ b/include/RequestManagerPoolInfoFilter.h @@ -77,8 +77,8 @@ protected: /* -------------------------------------------------------------------- */ - virtual void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + void request_execute( + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; /* -------------------------------------------------------------------- */ @@ -142,7 +142,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -185,7 +185,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -210,7 +210,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -235,7 +235,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -276,7 +276,7 @@ public: ~VirtualNetworkPoolInfo(){}; void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -339,7 +339,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -364,7 +364,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -388,7 +388,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -412,7 +412,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -436,7 +436,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -460,7 +460,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -484,7 +484,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -508,7 +508,7 @@ public: /* -------------------------------------------------------------------- */ void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + xmlrpc_c::paramList const& paramList, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -548,7 +548,7 @@ public: ~VdcPoolInfo(){}; - void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& att); + void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -588,7 +588,7 @@ public: ~MarketPlacePoolInfo(){}; - void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& att); + void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerProxy.h b/include/RequestManagerProxy.h index 80d9bd7a1d..0b445b0aba 100644 --- a/include/RequestManagerProxy.h +++ b/include/RequestManagerProxy.h @@ -37,7 +37,7 @@ public: ~RequestManagerProxy(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; void hide_argument(int arg) { diff --git a/include/RequestManagerRename.h b/include/RequestManagerRename.h index cc24f60066..e7cdd81e76 100644 --- a/include/RequestManagerRename.h +++ b/include/RequestManagerRename.h @@ -39,12 +39,12 @@ protected: auth_op = AuthRequest::MANAGE; }; - virtual ~RequestManagerRename(){}; + ~RequestManagerRename(){}; /* -------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; /** * Gets and object by name and owner. Default implementation returns no @@ -128,13 +128,13 @@ public: ~VirtualMachineRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return -1; } - int extra_updates(PoolObjectSQL * obj) + int extra_updates(PoolObjectSQL * obj) override { VirtualMachine * vm; @@ -168,7 +168,7 @@ public: ~TemplateRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name, uid); } @@ -191,7 +191,7 @@ public: ~VirtualNetworkTemplateRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name, uid); } @@ -214,7 +214,7 @@ public: ~VirtualNetworkRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name, uid); } @@ -236,7 +236,7 @@ public: ~ImageRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name, uid); } @@ -258,7 +258,7 @@ public: ~DocumentRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return -1; } @@ -280,12 +280,12 @@ public: ~ClusterRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name); } - void batch_rename(int oid); + void batch_rename(int oid) override; }; /* ------------------------------------------------------------------------- */ @@ -304,12 +304,12 @@ public: ~DatastoreRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name); } - void batch_rename(int oid); + void batch_rename(int oid) override; }; /* ------------------------------------------------------------------------- */ @@ -330,12 +330,12 @@ public: ~HostRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name); } - void batch_rename(int oid); + void batch_rename(int oid) override; }; /* ------------------------------------------------------------------------- */ @@ -354,7 +354,7 @@ public: ~ZoneRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name); } @@ -376,7 +376,7 @@ public: ~SecurityGroupRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name, uid); } @@ -398,7 +398,7 @@ public: ~VdcRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name); } @@ -420,7 +420,7 @@ public: ~VirtualRouterRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return -1; } @@ -442,12 +442,12 @@ public: ~MarketPlaceRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name); } - void batch_rename(int oid); + void batch_rename(int oid) override; }; /* ------------------------------------------------------------------------- */ @@ -466,7 +466,7 @@ public: ~MarketPlaceAppRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name, uid); } @@ -488,7 +488,7 @@ public: ~VMGroupRename(){}; - int exist(const string& name, int uid) + int exist(const string& name, int uid) override { return pool->exist(name, uid); } diff --git a/include/RequestManagerSecurityGroup.h b/include/RequestManagerSecurityGroup.h index c8ecc067de..9877648043 100644 --- a/include/RequestManagerSecurityGroup.h +++ b/include/RequestManagerSecurityGroup.h @@ -35,7 +35,7 @@ public: ~SecurityGroupCommit(){}; - void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& att); + void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& att) override; }; diff --git a/include/RequestManagerSystem.h b/include/RequestManagerSystem.h index 4d8433ba96..c7638c34b5 100644 --- a/include/RequestManagerSystem.h +++ b/include/RequestManagerSystem.h @@ -55,7 +55,7 @@ public: ~SystemVersion(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -73,7 +73,7 @@ public: ~SystemConfig(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -91,7 +91,7 @@ public: ~SystemSql(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -109,7 +109,7 @@ public: ~SystemSqlQuery(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; private: class select_cb : public Callbackable @@ -152,7 +152,7 @@ public: ~UserQuotaInfo(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -172,7 +172,7 @@ public: ~GroupQuotaInfo(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -193,7 +193,7 @@ protected: ~QuotaUpdate(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; virtual int set_default_quota(Template *tmpl, string& error) = 0; @@ -213,9 +213,9 @@ public: auth_op = AuthRequest::ADMIN; }; - int set_default_quota(Template *tmpl, string& error); + int set_default_quota(Template *tmpl, string& error) override; - const DefaultQuotas* get_default_quota(); + const DefaultQuotas* get_default_quota() override; }; /* ------------------------------------------------------------------------- */ @@ -231,9 +231,9 @@ public: auth_op = AuthRequest::ADMIN; }; - int set_default_quota(Template *tmpl, string& error); + int set_default_quota(Template *tmpl, string& error) override; - const DefaultQuotas* get_default_quota(); + const DefaultQuotas* get_default_quota() override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerUpdateDB.h b/include/RequestManagerUpdateDB.h index 975cd965d0..2cd2d73327 100644 --- a/include/RequestManagerUpdateDB.h +++ b/include/RequestManagerUpdateDB.h @@ -31,12 +31,12 @@ protected: auth_op = AuthRequest::MANAGE; }; - virtual ~RequestManagerUpdateDB(){}; + ~RequestManagerUpdateDB(){}; /* ---------------------------------------------------------------------- */ virtual void request_execute(xmlrpc_c::paramList const& pl, - RequestAttributes& att) + RequestAttributes& att) override { int oid = xmlrpc_c::value_int(pl.getInt(1)); std::string xml = xmlrpc_c::value_string(pl.getString(2)); @@ -145,8 +145,8 @@ public: ~ZoneUpdateDB(){}; - virtual void request_execute(xmlrpc_c::paramList const& pl, - RequestAttributes& att) + void request_execute(xmlrpc_c::paramList const& pl, + RequestAttributes& att) override { int oid = xmlrpc_c::value_int(pl.getInt(1)); std::string xml = xmlrpc_c::value_string(pl.getString(2)); diff --git a/include/RequestManagerUpdateTemplate.h b/include/RequestManagerUpdateTemplate.h index 44a8b49d80..38c8c09b60 100644 --- a/include/RequestManagerUpdateTemplate.h +++ b/include/RequestManagerUpdateTemplate.h @@ -41,7 +41,7 @@ protected: /* -------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; virtual int replace_template(PoolObjectSQL * object, const string & tmpl, const RequestAttributes &att, string &error_str); @@ -116,7 +116,7 @@ public: ~VirtualMachineUpdateTemplate(){}; - int extra_updates(PoolObjectSQL * obj) + int extra_updates(PoolObjectSQL * obj) override { VirtualMachine * vm; diff --git a/include/RequestManagerUser.h b/include/RequestManagerUser.h index 1d9195e14a..14d2339937 100644 --- a/include/RequestManagerUser.h +++ b/include/RequestManagerUser.h @@ -46,7 +46,7 @@ protected: void request_execute( xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; virtual int user_action(int user_id, xmlrpc_c::paramList const& _paramList, @@ -76,7 +76,7 @@ public: int user_action(int user_id, xmlrpc_c::paramList const& _paramList, RequestAttributes& att, - string& err); + string& err) override; }; /* ------------------------------------------------------------------------- */ @@ -99,7 +99,7 @@ public: int user_action(int user_id, xmlrpc_c::paramList const& _paramList, RequestAttributes& att, - string& err); + string& err) override; }; /* ------------------------------------------------------------------------- */ @@ -121,7 +121,7 @@ public: int user_action(int user_id, xmlrpc_c::paramList const& _paramList, RequestAttributes& att, - string& err); + string& err) override; }; /* ------------------------------------------------------------------------- */ @@ -146,7 +146,7 @@ public: void request_execute( xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -173,7 +173,7 @@ public: void request_execute( xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; protected: @@ -205,7 +205,7 @@ public: int user_id, int group_id, xmlrpc_c::paramList const& _paramList, - string& error_str); + string& error_str) override; }; /* ------------------------------------------------------------------------- */ @@ -225,7 +225,7 @@ public: int user_id, int group_id, xmlrpc_c::paramList const& _paramList, - string& error_str); + string& error_str) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerVMTemplate.h b/include/RequestManagerVMTemplate.h index 55bfc8c9ee..4964ccb3a7 100644 --- a/include/RequestManagerVMTemplate.h +++ b/include/RequestManagerVMTemplate.h @@ -94,7 +94,7 @@ public: protected: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerVNTemplate.h b/include/RequestManagerVNTemplate.h index 2a6ecedcd0..d4f64af99d 100644 --- a/include/RequestManagerVNTemplate.h +++ b/include/RequestManagerVNTemplate.h @@ -93,7 +93,7 @@ public: protected: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; #endif diff --git a/include/RequestManagerVdc.h b/include/RequestManagerVdc.h index 6c804ca9fb..06b77b4c9b 100644 --- a/include/RequestManagerVdc.h +++ b/include/RequestManagerVdc.h @@ -70,7 +70,7 @@ public: ~VdcAddGroup(){}; int edit_group( - Vdc* vdc, int group_id, string& error_msg); + Vdc* vdc, int group_id, string& error_msg) override; }; /* ------------------------------------------------------------------------- */ @@ -85,7 +85,7 @@ public: ~VdcDelGroup(){}; int edit_group( - Vdc* vdc, int group_id, string& error_msg); + Vdc* vdc, int group_id, string& error_msg) override; }; /* ------------------------------------------------------------------------- */ @@ -143,7 +143,7 @@ public: ~VdcAddCluster(){}; - int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg); + int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg) override; }; /* ------------------------------------------------------------------------- */ @@ -158,7 +158,7 @@ public: ~VdcDelCluster(){}; - int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg); + int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg) override; }; /* ------------------------------------------------------------------------- */ @@ -172,7 +172,7 @@ public: ~VdcAddHost(){}; - int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg); + int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg) override; }; /* ------------------------------------------------------------------------- */ @@ -186,7 +186,7 @@ public: ~VdcDelHost(){}; - int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg); + int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg) override; }; /* ------------------------------------------------------------------------- */ @@ -201,7 +201,7 @@ public: ~VdcAddDatastore(){}; - int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg); + int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg) override; }; /* ------------------------------------------------------------------------- */ @@ -216,7 +216,7 @@ public: ~VdcDelDatastore(){}; - int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg); + int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg) override; }; /* ------------------------------------------------------------------------- */ @@ -231,7 +231,7 @@ public: ~VdcAddVNet(){}; - int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg); + int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg) override; }; /* ------------------------------------------------------------------------- */ @@ -246,7 +246,7 @@ public: ~VdcDelVNet(){}; - int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg); + int edit_resource(Vdc* vdc, int zone_id, int res_id, string& error_msg) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerVirtualMachine.h b/include/RequestManagerVirtualMachine.h index e6c5a9ef6e..22e25615de 100644 --- a/include/RequestManagerVirtualMachine.h +++ b/include/RequestManagerVirtualMachine.h @@ -123,7 +123,7 @@ public: ~VirtualMachineAction(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -143,7 +143,7 @@ public: ~VirtualMachineDeploy(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -162,7 +162,7 @@ public: ~VirtualMachineMigrate(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -181,7 +181,7 @@ public: ~VirtualMachineDiskSaveas(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -200,8 +200,8 @@ public: ~VirtualMachineMonitoring(){}; - void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + void request_execute(xmlrpc_c::paramList const& paramList, + RequestAttributes& att) override; virtual bool is_locked(xmlrpc_c::paramList const& paramList, RequestAttributes& att){ return false; @@ -236,7 +236,7 @@ public: protected: void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -256,7 +256,7 @@ public: ~VirtualMachineDetach(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -286,7 +286,8 @@ public: protected: - void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& ra); + void request_execute(xmlrpc_c::paramList const& pl, + RequestAttributes& ra) override; }; @@ -316,7 +317,8 @@ public: ErrorCode request_execute(int id, int nic_id, RequestAttributes& att); protected: - void request_execute(xmlrpc_c::paramList const& pl, RequestAttributes& ra); + void request_execute(xmlrpc_c::paramList const& pl, + RequestAttributes& ra) override; }; /* -------------------------------------------------------------------------- */ @@ -335,7 +337,7 @@ public: ~VirtualMachineResize(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -357,7 +359,7 @@ public: ~VirtualMachineSnapshotCreate(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -379,7 +381,7 @@ public: ~VirtualMachineSnapshotRevert(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -401,7 +403,7 @@ public: ~VirtualMachineSnapshotDelete(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -417,7 +419,7 @@ public: ~VirtualMachineRecover(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ @@ -442,8 +444,8 @@ public: /* -------------------------------------------------------------------- */ - void request_execute( - xmlrpc_c::paramList const& paramList, RequestAttributes& att); + void request_execute(xmlrpc_c::paramList const& paramList, + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ @@ -466,7 +468,7 @@ public: ~VirtualMachineDiskSnapshotCreate(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; private: ImagePool* ipool; @@ -491,7 +493,7 @@ public: ~VirtualMachineDiskSnapshotRevert(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ @@ -514,7 +516,7 @@ public: ~VirtualMachineDiskSnapshotDelete(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; private: ImagePool* ipool; @@ -539,7 +541,7 @@ public: ~VirtualMachineDiskSnapshotRename(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ @@ -558,7 +560,7 @@ public: ~VirtualMachineUpdateConf(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; class VirtualMachineDiskResize : public RequestManagerVirtualMachine @@ -577,7 +579,7 @@ public: ~VirtualMachineDiskResize(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; private: ImagePool* ipool; }; diff --git a/include/RequestManagerVirtualNetwork.h b/include/RequestManagerVirtualNetwork.h index a057175399..a524fa471f 100644 --- a/include/RequestManagerVirtualNetwork.h +++ b/include/RequestManagerVirtualNetwork.h @@ -45,7 +45,7 @@ protected: /* -------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; virtual int leases_action(VirtualNetwork * vn, VirtualNetworkTemplate * tmpl, @@ -74,7 +74,7 @@ public: int leases_action(VirtualNetwork * vn, VirtualNetworkTemplate * tmpl, RequestAttributes& att, - string& error_str) + string& error_str) override { return vn->add_ar(tmpl, error_str); } @@ -101,10 +101,10 @@ public: auth_op = AuthRequest::ADMIN; }; - virtual ~VirtualNetworkRmAddressRange(){}; + ~VirtualNetworkRmAddressRange(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* ------------------------------------------------------------------------- */ @@ -128,7 +128,7 @@ public: ~VirtualNetworkFreeAddressRange(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att) + RequestAttributes& att) override { VirtualNetworkRmAddressRange::request_execute(_paramList, att); } @@ -152,7 +152,7 @@ public: int leases_action(VirtualNetwork * vn, VirtualNetworkTemplate * tmpl, RequestAttributes& att, - string& error_str) + string& error_str) override { if (!att.is_admin()) { @@ -179,7 +179,7 @@ public: int leases_action(VirtualNetwork * vn, VirtualNetworkTemplate * tmpl, RequestAttributes& att, - string& error_str) + string& error_str) override { return vn->hold_leases(tmpl, error_str); } @@ -199,7 +199,7 @@ public: int leases_action(VirtualNetwork * vn, VirtualNetworkTemplate * tmpl, RequestAttributes& att, - string& error_str) + string& error_str) override { return vn->free_leases(tmpl, error_str); } @@ -224,7 +224,7 @@ public: ~VirtualNetworkReserve(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ diff --git a/include/RequestManagerVirtualRouter.h b/include/RequestManagerVirtualRouter.h index 6fda3aab5e..6e6e4a44b0 100644 --- a/include/RequestManagerVirtualRouter.h +++ b/include/RequestManagerVirtualRouter.h @@ -64,7 +64,7 @@ public: ~VirtualRouterInstantiate(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; @@ -84,7 +84,7 @@ public: ~VirtualRouterAttachNic(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; @@ -103,7 +103,7 @@ public: ~VirtualRouterDetachNic(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; diff --git a/include/RequestManagerZone.h b/include/RequestManagerZone.h index c8ca6441d5..e4b9bf10d8 100644 --- a/include/RequestManagerZone.h +++ b/include/RequestManagerZone.h @@ -62,7 +62,7 @@ public: ~ZoneAddServer(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ @@ -78,7 +78,7 @@ public: ~ZoneDeleteServer(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ @@ -94,7 +94,7 @@ public: ~ZoneResetServer(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ @@ -114,7 +114,7 @@ public: ~ZoneReplicateLog(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ @@ -132,7 +132,7 @@ public: ~ZoneVoteRequest(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ @@ -150,7 +150,7 @@ public: ~ZoneRaftStatus(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; /* -------------------------------------------------------------------------- */ @@ -169,7 +169,7 @@ public: ~ZoneReplicateFedLog(){}; void request_execute(xmlrpc_c::paramList const& _paramList, - RequestAttributes& att); + RequestAttributes& att) override; }; #endif diff --git a/src/rm/RequestManagerDelete.cc b/src/rm/RequestManagerDelete.cc index 57953e10cb..7db2088d46 100644 --- a/src/rm/RequestManagerDelete.cc +++ b/src/rm/RequestManagerDelete.cc @@ -116,7 +116,7 @@ void ImageDelete::request_execute(xmlrpc_c::paramList const& paramList, /* ------------------------------------------------------------------------- */ Request::ErrorCode RequestManagerDelete::delete_object(int oid, - bool recursive, RequestAttributes& att, AuthRequest::Operation auth) + bool recursive, RequestAttributes& att, AuthRequest::Operation auth) { string err; ErrorCode ec; @@ -141,7 +141,7 @@ Request::ErrorCode RequestManagerDelete::delete_object(int oid, if ( rc != 0 ) { att.resp_msg = "Cannot delete " + object_name(auth_object) + ". " - + att.resp_msg; + + att.resp_msg; return ACTION; } @@ -155,40 +155,40 @@ Request::ErrorCode RequestManagerDelete::delete_object(int oid, /* ------------------------------------------------------------------------- */ int RequestManagerDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) + RequestAttributes& att) { set cluster_ids = get_cluster_ids(object); - int oid = object->get_oid(); + int oid = object->get_oid(); int rc = pool->drop(object, att.resp_msg); object->unlock(); - if ( rc != 0 ) + if ( rc != 0 ) { - return rc; + return rc; } - set::iterator it; + set::iterator it; - for(it = cluster_ids.begin(); it != cluster_ids.end(); it++) - { - Cluster * cluster = clpool->get(*it); + for(it = cluster_ids.begin(); it != cluster_ids.end(); it++) + { + Cluster * cluster = clpool->get(*it); - if( cluster != 0 ) - { - rc = del_from_cluster(cluster, oid, att.resp_msg); + if( cluster != 0 ) + { + rc = del_from_cluster(cluster, oid, att.resp_msg); - if ( rc < 0 ) - { - cluster->unlock(); - return rc; - } + if ( rc < 0 ) + { + cluster->unlock(); + return rc; + } - cluster->unlock(); - } - } + cluster->unlock(); + } + } return rc; } @@ -197,7 +197,7 @@ int RequestManagerDelete::drop(PoolObjectSQL * object, bool recursive, /* ------------------------------------------------------------------------- */ int TemplateDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) + RequestAttributes& att) { vector vdisks; vector::iterator i; @@ -206,17 +206,17 @@ int TemplateDelete::drop(PoolObjectSQL * object, bool recursive, if (recursive) { - static_cast(object)->clone_disks(vdisks); + static_cast(object)->clone_disks(vdisks); disks.init(vdisks, false); } - int rc = RequestManagerDelete::drop(object, false, att); + int rc = RequestManagerDelete::drop(object, false, att); - if ( rc != 0 ) - { - return rc; - } + if ( rc != 0 ) + { + return rc; + } else if ( !recursive ) { return 0; @@ -225,7 +225,7 @@ int TemplateDelete::drop(PoolObjectSQL * object, bool recursive, set error_ids; set img_ids; - ImageDelete img_delete; + ImageDelete img_delete; disks.get_image_ids(img_ids, att.uid); @@ -255,10 +255,12 @@ int TemplateDelete::drop(PoolObjectSQL * object, bool recursive, /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int HostDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int HostDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { - InformationManager * im = Nebula::instance().get_im(); + Nebula& nd = Nebula::instance(); + InformationManager * im = nd.get_im(); + + std::string error; Host* host = static_cast(object); @@ -273,25 +275,54 @@ int HostDelete::drop(PoolObjectSQL * object, bool recursive, string im_mad = host->get_im_mad(); string name = host->get_name(); - int oid = host->get_oid(); + int oid = host->get_oid(); - RequestManagerDelete::drop(object, false, att); + int rc = RequestManagerDelete::drop(object, false, att); im->stop_monitor(oid, name, im_mad); - return 0; + if (rc != 0) + { + return rc; + } + + // Remove host from VDC + int zone_id = nd.get_zone_id(); + VdcPool * vdcpool = nd.get_vdcpool(); + + std::vector vdcs; + + vdcpool->list(vdcs); + + for (int vdcId : vdcs) + { + Vdc * vdc = vdcpool->get(vdcId); + + if ( vdc == 0 ) + { + continue; + } + + if ( vdc->del_host(zone_id, oid, error) == 0 ) + { + vdcpool->update(vdc); + } + + vdc->unlock(); + } + + return rc; } /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int ImageDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int ImageDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { Nebula& nd = Nebula::instance(); ImageManager * imagem = nd.get_imagem(); - int oid = object->get_oid(); + int oid = object->get_oid(); object->unlock(); @@ -301,30 +332,29 @@ int ImageDelete::drop(PoolObjectSQL * object, bool recursive, /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int GroupDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int GroupDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { - int oid= object->get_oid(); - int rc = RequestManagerDelete::drop(object, false, att); + int oid = object->get_oid(); + int rc = RequestManagerDelete::drop(object, false, att); - if ( rc == 0 ) + if ( rc != 0 ) { - aclm->del_gid_rules(oid); + return rc; } + aclm->del_gid_rules(oid); + Nebula& nd = Nebula::instance(); VdcPool * vdcpool = nd.get_vdcpool(); - std::vector vdcs; - std::vector::iterator it; - std::string error; + std::vector vdcs; vdcpool->list(vdcs); - for (it = vdcs.begin() ; it != vdcs.end() ; ++it) + for (int vdcId : vdcs) { - Vdc * vdc = vdcpool->get(*it); + Vdc * vdc = vdcpool->get(vdcId); if ( vdc == 0 ) { @@ -345,15 +375,43 @@ int GroupDelete::drop(PoolObjectSQL * object, bool recursive, /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int ClusterDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int DatastoreDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { - int oid= object->get_oid(); - int rc = RequestManagerDelete::drop(object, false, att); + int oid = object->get_oid(); - if ( rc == 0 ) + int rc = RequestManagerDelete::drop(object, r, att); + + if (rc != 0) { - aclm->del_cid_rules(oid); + return rc; + } + + // Remove datastore from vdc + Nebula& nd = Nebula::instance(); + int zone_id = nd.get_zone_id(); + + VdcPool * vdcpool = nd.get_vdcpool(); + + std::string error; + std::vector vdcs; + + vdcpool->list(vdcs); + + for (int vdcId : vdcs) + { + Vdc * vdc = vdcpool->get(vdcId); + + if ( vdc == 0 ) + { + continue; + } + + if ( vdc->del_datastore(zone_id, oid, error) == 0 ) + { + vdcpool->update(vdc); + } + + vdc->unlock(); } return rc; @@ -362,15 +420,60 @@ int ClusterDelete::drop(PoolObjectSQL * object, bool recursive, /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int UserDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int ClusterDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) +{ + int oid = object->get_oid(); + int rc = RequestManagerDelete::drop(object, false, att); + + if (rc != 0) + { + return rc; + } + + aclm->del_cid_rules(oid); + + // Remove cluster from VDC + Nebula& nd = Nebula::instance(); + int zone_id = nd.get_zone_id(); + + VdcPool * vdcpool = nd.get_vdcpool(); + + std::string error; + std::vector vdcs; + + vdcpool->list(vdcs); + + for (int vdcId : vdcs) + { + Vdc * vdc = vdcpool->get(vdcId); + + if ( vdc == 0 ) + { + continue; + } + + if ( vdc->del_cluster(zone_id, oid, error) == 0 ) + { + vdcpool->update(vdc); + } + + vdc->unlock(); + } + + return rc; +} + +/* ------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ + +int UserDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { User * user = static_cast(object); set group_set = user->get_groups(); set::iterator it; - int oid = user->get_oid(); + int oid = user->get_oid(); if (oid == 0) { @@ -412,10 +515,9 @@ int UserDelete::drop(PoolObjectSQL * object, bool recursive, /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int ZoneDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int ZoneDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { - int oid= object->get_oid(); + int oid= object->get_oid(); int rc = RequestManagerDelete::drop(object, false, att); if ( rc == 0 ) @@ -431,10 +533,9 @@ int ZoneDelete::drop(PoolObjectSQL * object, bool recursive, /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int VirtualNetworkDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int VirtualNetworkDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { - int oid= object->get_oid(); + int oid = object->get_oid(); VirtualNetwork * vnet = static_cast(object); if ( vnet->get_used() > 0 ) @@ -483,14 +584,46 @@ int VirtualNetworkDelete::drop(PoolObjectSQL * object, bool recursive, } } + if (rc != 0) + { + return rc; + } + + // Remove virtual network from VDC + Nebula& nd = Nebula::instance(); + int zone_id = nd.get_zone_id(); + + VdcPool * vdcpool = nd.get_vdcpool(); + + std::string error; + std::vector vdcs; + + vdcpool->list(vdcs); + + for (int vdcId : vdcs) + { + Vdc * vdc = vdcpool->get(vdcId); + + if ( vdc == 0 ) + { + continue; + } + + if ( vdc->del_vnet(zone_id, oid, error) == 0 ) + { + vdcpool->update(vdc); + } + + vdc->unlock(); + } + return rc; } /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int SecurityGroupDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int SecurityGroupDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { if (object->get_oid() == 0) { @@ -518,8 +651,7 @@ int SecurityGroupDelete::drop(PoolObjectSQL * object, bool recursive, /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int VirtualRouterDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int VirtualRouterDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { VirtualRouter * vr = static_cast(object); @@ -538,8 +670,7 @@ int VirtualRouterDelete::drop(PoolObjectSQL * object, bool recursive, /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int MarketPlaceAppDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int MarketPlaceAppDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { Nebula& nd = Nebula::instance(); @@ -550,7 +681,7 @@ int MarketPlaceAppDelete::drop(PoolObjectSQL * object, bool recursive, int mp_id = app->get_market_id(); int zone_id = app->get_zone_id(); - int oid = app->get_oid(); + int oid = app->get_oid(); app->unlock(); @@ -593,8 +724,7 @@ int MarketPlaceAppDelete::drop(PoolObjectSQL * object, bool recursive, /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -int MarketPlaceDelete::drop(PoolObjectSQL * object, bool recursive, - RequestAttributes& att) +int MarketPlaceDelete::drop(PoolObjectSQL * object, bool r, RequestAttributes& att) { MarketPlace * mp = static_cast(object); std::set apps = mp->get_marketapp_ids();