1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-03 01:17:41 +03:00

B #1815: Remove resource from VDC when erased

L #-: Derived virtual methods use override keyword

Co-authored-by: Pavel Czerny <pczerny@opennebula.systems>
This commit is contained in:
Ruben S. Montero 2019-07-05 17:23:21 +02:00
parent b9daad50b6
commit 217ff30a76
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
33 changed files with 465 additions and 332 deletions

View File

@ -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

View File

@ -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;
};
/* -------------------------------------------------------------------------- */

View File

@ -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

View File

@ -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<MarketPlaceAppPool *>(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<MarketPlacePool *>(pool)->create();

View File

@ -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:

View File

@ -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;
};

View File

@ -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<VMTemplate*>(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<VMTemplatePool *>(pool);
VirtualMachineTemplate * t = static_cast<VirtualMachineTemplate*>(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<VNTemplate*>(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<VNTemplatePool *>(pool);
VirtualNetworkTemplate * t = static_cast<VirtualNetworkTemplate*>(tmpl);
@ -187,12 +187,12 @@ public:
protected:
Template * clone_template(PoolObjectSQL* obj)
Template * clone_template(PoolObjectSQL* obj) override
{
return static_cast<Document*>(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<DocumentPool *>(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<SecurityGroup*>(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<SecurityGroupPool *>(pool);

View File

@ -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));

View File

@ -61,7 +61,7 @@ public:
~DatastoreEnable(){};
void request_execute(xmlrpc_c::paramList const& _paramList,
RequestAttributes& att);
RequestAttributes& att) override;
};
/* -------------------------------------------------------------------------- */

View File

@ -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<int> get_cluster_ids(PoolObjectSQL * object)
set<int> get_cluster_ids(PoolObjectSQL * object) override
{
return static_cast<VirtualNetwork*>(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<int> get_cluster_ids(PoolObjectSQL * object)
set<int> get_cluster_ids(PoolObjectSQL * object) override
{
set<int> 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<int> get_cluster_ids(PoolObjectSQL * object)
set<int> get_cluster_ids(PoolObjectSQL * object) override
{
return static_cast<Datastore*>(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;
};
/* ------------------------------------------------------------------------- */

View File

@ -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));

View File

@ -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;
};
/* -------------------------------------------------------------------------- */

View File

@ -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;
};
/* -------------------------------------------------------------------------- */

View File

@ -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;
};
/* -------------------------------------------------------------------------- */

View File

@ -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<VirtualMachine *>(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<Group*>(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<User*>(object)->to_xml_extended(str);
};

View File

@ -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)
{

View File

@ -57,7 +57,7 @@ public:
~MarketPlaceAppEnable(){};
void request_execute(xmlrpc_c::paramList const& _paramList,
RequestAttributes& att);
RequestAttributes& att) override;
};
/* -------------------------------------------------------------------------- */

View File

@ -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;
};
/* -------------------------------------------------------------------------- */

View File

@ -37,7 +37,7 @@ public:
~RequestManagerProxy(){};
void request_execute(xmlrpc_c::paramList const& _paramList,
RequestAttributes& att);
RequestAttributes& att) override;
void hide_argument(int arg)
{

View File

@ -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);
}

View File

@ -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;
};

View File

@ -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;
};
/* -------------------------------------------------------------------------- */

View File

@ -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));

View File

@ -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;

View File

@ -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;
};
/* -------------------------------------------------------------------------- */

View File

@ -94,7 +94,7 @@ public:
protected:
void request_execute(xmlrpc_c::paramList const& _paramList,
RequestAttributes& att);
RequestAttributes& att) override;
};
/* -------------------------------------------------------------------------- */

View File

@ -93,7 +93,7 @@ public:
protected:
void request_execute(xmlrpc_c::paramList const& _paramList,
RequestAttributes& att);
RequestAttributes& att) override;
};
#endif

View File

@ -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;
};
/* -------------------------------------------------------------------------- */

View File

@ -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;
};

View File

@ -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;
};
/* -------------------------------------------------------------------------- */

View File

@ -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;
};

View File

@ -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

View File

@ -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<Host *>(object);
@ -275,18 +277,47 @@ int HostDelete::drop(PoolObjectSQL * object, bool recursive,
string name = host->get_name();
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<int> 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();
@ -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);
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<int> vdcs;
std::vector<int>::iterator it;
std::string error;
std::vector<int> 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);
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<int> 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,8 +420,53 @@ 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<int> 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<User *>(object);
@ -412,8 +515,7 @@ 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 rc = RequestManagerDelete::drop(object, false, att);
@ -431,8 +533,7 @@ 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();
VirtualNetwork * vnet = static_cast<VirtualNetwork *>(object);
@ -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<int> 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<VirtualRouter *>(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();
@ -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<MarketPlace *>(object);
std::set<int> apps = mp->get_marketapp_ids();