mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-11 04:58:16 +03:00
(cherry picked from commit 4a9662a5510fb238ff77086ce554845a26d59a38) (cherry picked from commit d7b7303f8f8c040e3018f77c5f4136b1596b700e)
This commit is contained in:
parent
81512242e3
commit
8e7ff2ed36
@ -39,7 +39,7 @@ public:
|
||||
* @param error_msg description if error
|
||||
* @return 0 on success
|
||||
*/
|
||||
int from_vattr(VectorAttribute * attr, std::string& error_msg);
|
||||
int from_vattr(VectorAttribute * attr, std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Sets the given range of addresses (by index) as used
|
||||
@ -50,7 +50,7 @@ public:
|
||||
* @return 0 if success
|
||||
*/
|
||||
int allocate_addr(unsigned int index, unsigned int rsize,
|
||||
std::string& error_msg);
|
||||
std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Gets a range of free addresses
|
||||
@ -61,7 +61,7 @@ public:
|
||||
* @return 0 if success
|
||||
*/
|
||||
int get_addr(unsigned int& index, unsigned int rsize,
|
||||
std::string& error_msg);
|
||||
std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Sets the given address (by index) as free
|
||||
@ -70,7 +70,7 @@ public:
|
||||
*
|
||||
* @return 0 if success
|
||||
*/
|
||||
int free_addr(unsigned int index, std::string& msg);
|
||||
int free_addr(unsigned int index, std::string& msg) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
* @param error_msg description if error
|
||||
* @return 0 on success
|
||||
*/
|
||||
int from_vattr(VectorAttribute * attr, std::string& error_msg)
|
||||
int from_vattr(VectorAttribute * attr, std::string& error_msg) override
|
||||
{
|
||||
return AddressRange::from_attr(attr, error_msg);
|
||||
}
|
||||
@ -53,7 +53,7 @@ public:
|
||||
* @return 0 if success
|
||||
*/
|
||||
int allocate_addr(unsigned int index, unsigned int rsize,
|
||||
std::string& error_msg)
|
||||
std::string& error_msg) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -67,7 +67,7 @@ public:
|
||||
* @return 0 if success
|
||||
*/
|
||||
int get_addr(unsigned int& index, unsigned int rsize,
|
||||
std::string& error_msg)
|
||||
std::string& error_msg) override
|
||||
{
|
||||
if ( rsize == 1 )
|
||||
{
|
||||
@ -84,7 +84,7 @@ public:
|
||||
*
|
||||
* @return 0 if success
|
||||
*/
|
||||
int free_addr(unsigned int index, std::string& msg)
|
||||
int free_addr(unsigned int index, std::string& msg) override
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
|
@ -320,7 +320,7 @@ private:
|
||||
* @param string with reserved bits
|
||||
*/
|
||||
|
||||
void set_reserved_bit(std::string& reserved)
|
||||
void set_reserved_bit(const std::string& reserved)
|
||||
{
|
||||
std::vector<std::string> strings;
|
||||
std::vector<std::string> range;
|
||||
|
@ -360,7 +360,7 @@ class empty_cb : public Callbackable
|
||||
public:
|
||||
void set_callback(Callback _cb, void * _arg = 0){};
|
||||
|
||||
bool isCallBackSet()
|
||||
bool isCallBackSet() override
|
||||
{
|
||||
return false;
|
||||
};
|
||||
|
@ -27,7 +27,7 @@ class ClusterPool : public PoolSQL
|
||||
public:
|
||||
ClusterPool(SqlDB * db,
|
||||
const VectorAttribute * vnc_conf,
|
||||
std::vector<const SingleAttribute *>& encrypted_attrs);
|
||||
const std::vector<const SingleAttribute *>& encrypted_attrs);
|
||||
|
||||
~ClusterPool(){};
|
||||
|
||||
@ -162,7 +162,7 @@ public:
|
||||
* -2 object is a system cluster (ID < 100)
|
||||
* -3 Cluster's User IDs set is not empty
|
||||
*/
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg);
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Bootstraps the database table(s) associated to the Cluster pool
|
||||
@ -192,7 +192,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "CLUSTER_POOL", "body",
|
||||
one_db::cluster_table, where,
|
||||
@ -267,7 +267,7 @@ private:
|
||||
* Factory method to produce objects
|
||||
* @return a pointer to the new object
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new Cluster(-1,"",0, &vnc_conf);
|
||||
};
|
||||
|
@ -36,17 +36,17 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// Encrypted attributes interface implementation
|
||||
// -------------------------------------------------------------------------
|
||||
virtual void encrypt(const std::string& one_key)
|
||||
void encrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::encrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
virtual void decrypt(const std::string& one_key)
|
||||
void decrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::decrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
static void parse_encrypted(std::vector<const SingleAttribute *>& ea)
|
||||
static void parse_encrypted(const std::vector<const SingleAttribute *>& ea)
|
||||
{
|
||||
Template::parse_encrypted(ea, encrypted);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class DatastorePool : public PoolSQL
|
||||
public:
|
||||
DatastorePool(SqlDB * db,
|
||||
const std::vector<const SingleAttribute *>& _inherit_attrs,
|
||||
std::vector<const SingleAttribute *>& encrypted_attrs);
|
||||
const std::vector<const SingleAttribute *>& encrypted_attrs);
|
||||
|
||||
~DatastorePool(){};
|
||||
|
||||
@ -126,7 +126,7 @@ public:
|
||||
* @return 0 on success, -1 DB error
|
||||
* -3 Datastore's Image IDs set is not empty
|
||||
*/
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg);
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Bootstraps the database table(s) associated to the Datastore pool
|
||||
@ -149,7 +149,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "DATASTORE_POOL", "body", one_db::ds_table,
|
||||
where, sid, eid, desc);
|
||||
@ -205,7 +205,7 @@ private:
|
||||
* Factory method to produce objects
|
||||
* @return a pointer to the new object
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
std::set<int> empty;
|
||||
|
||||
|
@ -36,17 +36,17 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// Encrypted attributes interface implementation
|
||||
// -------------------------------------------------------------------------
|
||||
virtual void encrypt(const std::string& one_key)
|
||||
void encrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::encrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
virtual void decrypt(const std::string& one_key)
|
||||
void decrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::decrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
static void parse_encrypted(std::vector<const SingleAttribute *>& ea)
|
||||
static void parse_encrypted(const std::vector<const SingleAttribute *>& ea)
|
||||
{
|
||||
Template::parse_encrypted(ea, encrypted);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class DocumentPool : public PoolSQL
|
||||
{
|
||||
public:
|
||||
|
||||
DocumentPool(SqlDB * db, std::vector<const SingleAttribute *>& ea) :
|
||||
DocumentPool(SqlDB * db, const std::vector<const SingleAttribute *>& ea) :
|
||||
PoolSQL(db, one_db::doc_table) {
|
||||
DocumentTemplate::parse_encrypted(ea);
|
||||
};
|
||||
@ -103,7 +103,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "DOCUMENT_POOL", "body", one_db::doc_table,
|
||||
where, sid, eid, desc);
|
||||
@ -123,7 +123,7 @@ private:
|
||||
* Factory method to produce Image objects
|
||||
* @return a pointer to the new Image
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new Document(-1,-1,-1,"","",0,0,0);
|
||||
};
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
Template::decrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
static void parse_encrypted(std::vector<const SingleAttribute *>& ea)
|
||||
static void parse_encrypted(const std::vector<const SingleAttribute *>& ea)
|
||||
{
|
||||
Template::parse_encrypted(ea, encrypted);
|
||||
}
|
||||
|
@ -73,22 +73,22 @@ public:
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* Attribute Interface */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
std::string marshall(const char * _sep = 0) const
|
||||
std::string marshall(const char * _sep = 0) const override
|
||||
{
|
||||
return va->marshall(_sep);
|
||||
};
|
||||
|
||||
void to_xml(std::ostringstream& s) const
|
||||
void to_xml(std::ostringstream& s) const override
|
||||
{
|
||||
return va->to_xml(s);
|
||||
};
|
||||
|
||||
void to_json(std::ostringstream& s) const
|
||||
void to_json(std::ostringstream& s) const override
|
||||
{
|
||||
return va->to_json(s);
|
||||
};
|
||||
|
||||
void to_token(std::ostringstream& s) const
|
||||
void to_token(std::ostringstream& s) const override
|
||||
{
|
||||
return va->to_token(s);
|
||||
};
|
||||
@ -110,7 +110,7 @@ protected:
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* Attribute Interface */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void unmarshall(const std::string& sattr, const char * _sep = 0)
|
||||
void unmarshall(const std::string& sattr, const char * _sep = 0) override
|
||||
{
|
||||
va->unmarshall(sattr, _sep);
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ private:
|
||||
/**
|
||||
* Creates federation replica thread objects
|
||||
*/
|
||||
ReplicaThread * thread_factory(int follower_id);
|
||||
ReplicaThread * thread_factory(int follower_id) override;
|
||||
|
||||
/**
|
||||
* Controls access to the zone list and server data
|
||||
|
@ -26,7 +26,7 @@ class GroupPool : public PoolSQL
|
||||
public:
|
||||
|
||||
GroupPool(SqlDB * db, bool is_federation_slave,
|
||||
std::vector<const SingleAttribute *>& restricted_attrs);
|
||||
const std::vector<const SingleAttribute *>& restricted_attrs);
|
||||
|
||||
~GroupPool() = default;
|
||||
|
||||
@ -120,7 +120,7 @@ public:
|
||||
* @param user pointer to Group
|
||||
* @return 0 on success
|
||||
*/
|
||||
int update(PoolObjectSQL * objsql);
|
||||
int update(PoolObjectSQL * objsql) override;
|
||||
|
||||
/**
|
||||
* Update a particular Group's Quotas
|
||||
@ -139,7 +139,7 @@ public:
|
||||
* -2 object is a system group (ID < 100)
|
||||
* -3 Group's User IDs set is not empty
|
||||
*/
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg);
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Bootstraps the database table(s) associated to the Group pool
|
||||
@ -162,7 +162,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where,
|
||||
int sid, int eid, bool desc);
|
||||
int sid, int eid, bool desc) override;
|
||||
|
||||
private:
|
||||
|
||||
@ -170,7 +170,7 @@ private:
|
||||
* Factory method to produce objects
|
||||
* @return a pointer to the new object
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new Group(-1,"");
|
||||
};
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
return Template::check_restricted(rs_attr, restricted);
|
||||
}
|
||||
|
||||
static void parse_restricted(std::vector<const SingleAttribute *>& ra)
|
||||
static void parse_restricted(const std::vector<const SingleAttribute *>& ra)
|
||||
{
|
||||
Template::parse_restricted(ra, restricted);
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ private:
|
||||
* @param db pointer to the database.
|
||||
* @return 0 on success.
|
||||
*/
|
||||
int insert(SqlDB * db, std::string& error_str)
|
||||
int insert(SqlDB * db, std::string& error_str) override
|
||||
{
|
||||
error_str.clear();
|
||||
|
||||
@ -137,14 +137,14 @@ private:
|
||||
* @param db pointer to the database.
|
||||
* @return 0 on success.
|
||||
*/
|
||||
int select(SqlDB * db);
|
||||
int select(SqlDB * db) override;
|
||||
|
||||
/**
|
||||
* Updates the history record
|
||||
* @param db pointer to the database.
|
||||
* @return 0 on success.
|
||||
*/
|
||||
int update(SqlDB * db)
|
||||
int update(SqlDB * db) override
|
||||
{
|
||||
return insert_replace(db, true);
|
||||
}
|
||||
@ -154,7 +154,7 @@ private:
|
||||
* @param db pointer to the database.
|
||||
* @return 0 on success.
|
||||
*/
|
||||
int drop(SqlDB * db);
|
||||
int drop(SqlDB * db) override;
|
||||
|
||||
/**
|
||||
* Execute an INSERT or REPLACE Sql query.
|
||||
|
@ -74,7 +74,7 @@ public:
|
||||
* @param xml the resulting XML string
|
||||
* @return a reference to the generated string
|
||||
*/
|
||||
std::string& to_xml(std::string& xml) const
|
||||
std::string& to_xml(std::string& xml) const override
|
||||
{
|
||||
return _to_xml(xml, false);
|
||||
}
|
||||
@ -105,7 +105,7 @@ private:
|
||||
/**
|
||||
* Factory method for Hook templates
|
||||
*/
|
||||
std::unique_ptr<Template> get_new_template() const
|
||||
std::unique_ptr<Template> get_new_template() const override
|
||||
{
|
||||
return std::make_unique<Template>();
|
||||
}
|
||||
@ -117,13 +117,13 @@ private:
|
||||
*
|
||||
* @return 0 on success, -1 otherwise
|
||||
*/
|
||||
int from_xml(const std::string &xml_str);
|
||||
int from_xml(const std::string &xml_str) override;
|
||||
|
||||
/* Checks the mandatory templates attrbutes
|
||||
* @param error string describing the error if any
|
||||
* @return 0 on success
|
||||
*/
|
||||
int post_update_template(std::string& error);
|
||||
int post_update_template(std::string& error) override;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Hook Attributes
|
||||
|
@ -32,8 +32,9 @@ public:
|
||||
/**
|
||||
* Function to build a XML message for an API hook
|
||||
*/
|
||||
static std::string format_message(const std::string& method, ParamList& paramList,
|
||||
const RequestAttributes& att);
|
||||
static std::string format_message(const std::string& method,
|
||||
const ParamList& paramList,
|
||||
const RequestAttributes& att);
|
||||
|
||||
/**
|
||||
* Check if an api call is supported or not.
|
||||
@ -62,7 +63,7 @@ private:
|
||||
* @param error_str string with error information
|
||||
* @return 0 on success
|
||||
*/
|
||||
int parse_template(Template *tmpl, std::string& error_str);
|
||||
int parse_template(Template *tmpl, std::string& error_str) override;
|
||||
|
||||
/**
|
||||
* Rebuilds the object from a template
|
||||
@ -70,7 +71,7 @@ private:
|
||||
*
|
||||
* @return 0 on success, -1 otherwise
|
||||
*/
|
||||
int from_template(const Template * tmpl, std::string& error);
|
||||
int from_template(const Template * tmpl, std::string& error) override;
|
||||
|
||||
/* Checks the mandatory template attributes
|
||||
* @param tmpl The hook template
|
||||
@ -78,7 +79,7 @@ private:
|
||||
*
|
||||
* @return 0 on success
|
||||
*/
|
||||
int post_update_template(Template * tmpl, std::string& error);
|
||||
int post_update_template(Template * tmpl, std::string& error) override;
|
||||
|
||||
/**
|
||||
* Check if an api call does exist in the XMLRPC server.
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
*
|
||||
* @return 0 on success
|
||||
*/
|
||||
int add(int hkid, int rc, std::string &xml_result);
|
||||
int add(int hkid, int rc, const std::string &xml_result);
|
||||
|
||||
/**
|
||||
* Retries a given execution for a host, using the same execution context
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "HOOK_POOL", "body", one_db::hook_table,
|
||||
where, sid, eid, desc);
|
||||
@ -94,7 +94,7 @@ public:
|
||||
* Factory method to produce Hook objects
|
||||
* @return a pointer to the new VN
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new Hook(0);
|
||||
};
|
||||
|
@ -50,7 +50,7 @@ private:
|
||||
* @param error_str string with error information
|
||||
* @return 0 on success
|
||||
*/
|
||||
int parse_template(Template *tmpl, std::string& error_str);
|
||||
int parse_template(Template *tmpl, std::string& error_str) override;
|
||||
|
||||
/**
|
||||
* Rebuilds the object from a template
|
||||
@ -58,14 +58,14 @@ private:
|
||||
*
|
||||
* @return 0 on success, -1 otherwise
|
||||
*/
|
||||
int from_template(const Template * tmpl, std::string& error);
|
||||
int from_template(const Template * tmpl, std::string& error) override;
|
||||
|
||||
/* Checks the mandatory template attributes
|
||||
* @param tmpl The hook template
|
||||
* @param error string describing the error if any
|
||||
* @return 0 on success
|
||||
*/
|
||||
int post_update_template(Template * tmpl, std::string& error);
|
||||
int post_update_template(Template * tmpl, std::string& error) override;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Hook API Attributes
|
||||
|
@ -50,7 +50,7 @@ private:
|
||||
* @param error_str string with error information
|
||||
* @return 0 on success
|
||||
*/
|
||||
int parse_template(Template *tmpl, std::string& error_str);
|
||||
int parse_template(Template *tmpl, std::string& error_str) override;
|
||||
|
||||
/**
|
||||
* Rebuilds the object from a template
|
||||
@ -58,14 +58,14 @@ private:
|
||||
*
|
||||
* @return 0 on success, -1 otherwise
|
||||
*/
|
||||
int from_template(const Template * tmpl, std::string& error);
|
||||
int from_template(const Template * tmpl, std::string& error) override;
|
||||
|
||||
/* Checks the mandatory template attributes
|
||||
* @param tmpl The hook template
|
||||
* @param error string describing the error if any
|
||||
* @return 0 on success
|
||||
*/
|
||||
int post_update_template(Template * tmpl, std::string& error);
|
||||
int post_update_template(Template * tmpl, std::string& error) override;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Hook API Attributes
|
||||
|
@ -51,7 +51,7 @@ private:
|
||||
* @param error_str string with error information
|
||||
* @return 0 on success
|
||||
*/
|
||||
int parse_template(Template *tmpl, std::string& error_str);
|
||||
int parse_template(Template *tmpl, std::string& error_str) override;
|
||||
|
||||
/**
|
||||
* Rebuilds the object from a template
|
||||
@ -59,14 +59,14 @@ private:
|
||||
*
|
||||
* @return 0 on success, -1 otherwise
|
||||
*/
|
||||
int from_template(const Template * tmpl, std::string& error);
|
||||
int from_template(const Template * tmpl, std::string& error) override;
|
||||
|
||||
/* Checks the mandatory template attributes
|
||||
* @param tmpl The hook template
|
||||
* @param error string describing the error if any
|
||||
* @return 0 on success
|
||||
*/
|
||||
int post_update_template(Template * tmpl, std::string& error);
|
||||
int post_update_template(Template * tmpl, std::string& error) override;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Hook API Attributes
|
||||
|
@ -50,7 +50,7 @@ private:
|
||||
* @param error_str string with error information
|
||||
* @return 0 on success
|
||||
*/
|
||||
int parse_template(Template *tmpl, std::string& error_str);
|
||||
int parse_template(Template *tmpl, std::string& error_str) override;
|
||||
|
||||
/**
|
||||
* Rebuilds the object from a template
|
||||
@ -58,14 +58,14 @@ private:
|
||||
*
|
||||
* @return 0 on success, -1 otherwise
|
||||
*/
|
||||
int from_template(const Template * tmpl, std::string& error);
|
||||
int from_template(const Template * tmpl, std::string& error) override;
|
||||
|
||||
/* Checks the mandatory template attributes
|
||||
* @param tmpl The hook template
|
||||
* @param error string describing the error if any
|
||||
* @return 0 on success
|
||||
*/
|
||||
int post_update_template(Template * tmpl, std::string& error);
|
||||
int post_update_template(Template * tmpl, std::string& error) override;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Hook API Attributes
|
||||
|
@ -32,7 +32,7 @@
|
||||
class HostPool : public PoolSQL
|
||||
{
|
||||
public:
|
||||
HostPool(SqlDB * db, std::vector<const SingleAttribute *>& secrets);
|
||||
HostPool(SqlDB * db, const std::vector<const SingleAttribute *>& secrets);
|
||||
|
||||
~HostPool() = default;
|
||||
|
||||
@ -185,7 +185,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg)
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg) override
|
||||
{
|
||||
Host * host = static_cast<Host *>(objsql);
|
||||
|
||||
@ -210,7 +210,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "HOST_POOL", "body", one_db::host_table,
|
||||
where, sid, eid, desc);
|
||||
@ -269,7 +269,7 @@ private:
|
||||
* Factory method to produce Host objects
|
||||
* @return a pointer to the new Host
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new Host(-1,"","","",-1,"");
|
||||
};
|
||||
|
@ -35,17 +35,17 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// Encrypted attributes interface implementation
|
||||
// -------------------------------------------------------------------------
|
||||
virtual void encrypt(const std::string& one_key)
|
||||
void encrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::encrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
virtual void decrypt(const std::string& one_key)
|
||||
void decrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::decrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
static void parse_encrypted(std::vector<const SingleAttribute *>& ea)
|
||||
static void parse_encrypted(const std::vector<const SingleAttribute *>& ea)
|
||||
{
|
||||
Template::parse_encrypted(ea, encrypted);
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ public:
|
||||
const std::string& __default_type,
|
||||
const std::string& __default_dev_prefix,
|
||||
const std::string& __default_cdrom_dev_prefix,
|
||||
std::vector<const SingleAttribute *>& restricted_attrs,
|
||||
std::vector<const SingleAttribute *>& encrypted_attrs,
|
||||
const std::vector<const SingleAttribute *>& restricted_attrs,
|
||||
const std::vector<const SingleAttribute *>& encrypted_attrs,
|
||||
const std::vector<const SingleAttribute *>& inherit_attrs);
|
||||
|
||||
~ImagePool(){};
|
||||
@ -88,7 +88,7 @@ public:
|
||||
std::string& error_str);
|
||||
|
||||
/**
|
||||
* Updates an Image in the data base. It also updates the previous state
|
||||
* Updates an Image in the data base. It also updates the previous state
|
||||
* after executing the hooks.
|
||||
* @param objsql a pointer to the VM
|
||||
*
|
||||
@ -167,7 +167,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "IMAGE_POOL", "body", one_db::image_table,
|
||||
where, sid, eid, desc);
|
||||
@ -259,7 +259,7 @@ private:
|
||||
* Factory method to produce Image objects
|
||||
* @return a pointer to the new Image
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new Image(-1,-1,"","",0,0);
|
||||
};
|
||||
|
@ -53,17 +53,17 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// Restricted attributes interface implementation
|
||||
// -------------------------------------------------------------------------
|
||||
virtual bool check_restricted(std::string& rs_attr, const Template* base)
|
||||
bool check_restricted(std::string& rs_attr, const Template* base) override
|
||||
{
|
||||
return Template::check_restricted(rs_attr, base, restricted);
|
||||
}
|
||||
|
||||
virtual bool check_restricted(std::string& rs_attr)
|
||||
bool check_restricted(std::string& rs_attr) override
|
||||
{
|
||||
return Template::check_restricted(rs_attr, restricted);
|
||||
}
|
||||
|
||||
static void parse_restricted(std::vector<const SingleAttribute *>& ra)
|
||||
static void parse_restricted(const std::vector<const SingleAttribute *>& ra)
|
||||
{
|
||||
Template::parse_restricted(ra, restricted);
|
||||
}
|
||||
@ -71,17 +71,17 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// Encrypted attributes interface implementation
|
||||
// -------------------------------------------------------------------------
|
||||
virtual void encrypt(const std::string& one_key)
|
||||
void encrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::encrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
virtual void decrypt(const std::string& one_key)
|
||||
void decrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::decrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
static void parse_encrypted(std::vector<const SingleAttribute *>& ea)
|
||||
static void parse_encrypted(const std::vector<const SingleAttribute *>& ea)
|
||||
{
|
||||
Template::parse_encrypted(ea, encrypted);
|
||||
}
|
||||
|
@ -115,10 +115,10 @@ public:
|
||||
|
||||
virtual ~FileLog();
|
||||
|
||||
virtual void log(
|
||||
void log(
|
||||
const char * module,
|
||||
const MessageType type,
|
||||
const char * message);
|
||||
const char * message) override;
|
||||
|
||||
private:
|
||||
std::string log_file_name;
|
||||
@ -142,7 +142,7 @@ public:
|
||||
void log(
|
||||
const char * module,
|
||||
const MessageType type,
|
||||
const char * message)
|
||||
const char * message) override
|
||||
{
|
||||
std::lock_guard <std::mutex> lock(log_mutex);
|
||||
FileLog::log(module,type,message);
|
||||
@ -173,7 +173,7 @@ public:
|
||||
void log(
|
||||
const char * module,
|
||||
const MessageType type,
|
||||
const char * message);
|
||||
const char * message) override;
|
||||
|
||||
private:
|
||||
std::string resource_label;
|
||||
@ -200,7 +200,7 @@ public:
|
||||
void log(
|
||||
const char * module,
|
||||
const MessageType type,
|
||||
const char * message);
|
||||
const char * message) override;
|
||||
|
||||
/**
|
||||
* Return the associated syslog level
|
||||
|
@ -126,7 +126,7 @@ public:
|
||||
* @return 0 on sucess, -1 on failure
|
||||
*/
|
||||
int insert_log_record(uint64_t index, unsigned int term,
|
||||
std::ostringstream& sql, time_t timestamp, uint64_t fed_index,
|
||||
const std::ostringstream& sql, time_t timestamp, uint64_t fed_index,
|
||||
bool replace);
|
||||
|
||||
/**
|
||||
@ -146,7 +146,7 @@ public:
|
||||
* @param raft attributes in XML format
|
||||
* @return 0 on success
|
||||
*/
|
||||
int update_raft_state(const std::string& name, std::string& raft_xml);
|
||||
int update_raft_state(const std::string& name, const std::string& raft_xml);
|
||||
|
||||
/**
|
||||
* Returns the raft state attributes as stored in the log
|
||||
@ -169,12 +169,12 @@ public:
|
||||
* This function replicates the DB changes on followers before updating
|
||||
* the DB state
|
||||
*/
|
||||
int exec_wr(std::ostringstream& cmd)
|
||||
int exec_wr(std::ostringstream& cmd) override
|
||||
{
|
||||
return _exec_wr(cmd, UINT64_MAX);
|
||||
}
|
||||
|
||||
int exec_wr(std::ostringstream& cmd, Callbackable* obj)
|
||||
int exec_wr(std::ostringstream& cmd, Callbackable* obj) override
|
||||
{
|
||||
return exec_wr(cmd);
|
||||
}
|
||||
@ -189,32 +189,32 @@ public:
|
||||
return _exec_wr(cmd, index);
|
||||
}
|
||||
|
||||
int exec_local_wr(std::ostringstream& cmd)
|
||||
int exec_local_wr(std::ostringstream& cmd) override
|
||||
{
|
||||
return db->exec_local_wr(cmd);
|
||||
}
|
||||
|
||||
int exec_rd(std::ostringstream& cmd, Callbackable* obj)
|
||||
int exec_rd(std::ostringstream& cmd, Callbackable* obj) override
|
||||
{
|
||||
return db->exec_rd(cmd, obj);
|
||||
}
|
||||
|
||||
char * escape_str(const std::string& str) const
|
||||
char * escape_str(const std::string& str) const override
|
||||
{
|
||||
return db->escape_str(str);
|
||||
}
|
||||
|
||||
void free_str(char * str) const
|
||||
void free_str(char * str) const override
|
||||
{
|
||||
db->free_str(str);
|
||||
}
|
||||
|
||||
bool supports(SqlDB::SqlFeature ft) const
|
||||
bool supports(SqlDB::SqlFeature ft) const override
|
||||
{
|
||||
return db->supports(ft);
|
||||
}
|
||||
|
||||
std::string limit_string(int start_id, int end_id) const
|
||||
std::string limit_string(int start_id, int end_id) const override
|
||||
{
|
||||
return db->limit_string(start_id, end_id);
|
||||
}
|
||||
@ -264,13 +264,13 @@ public:
|
||||
*
|
||||
* @return pointer to the non-federated logDB
|
||||
*/
|
||||
virtual SqlDB * get_local_db()
|
||||
SqlDB * get_local_db() override
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
protected:
|
||||
int exec_ext(std::ostringstream& cmd, Callbackable *obj, bool quiet)
|
||||
int exec_ext(std::ostringstream& cmd, Callbackable *obj, bool quiet) override
|
||||
{
|
||||
return SqlDB::INTERNAL;
|
||||
};
|
||||
@ -382,7 +382,7 @@ private:
|
||||
*
|
||||
* @return -1 on failure, index of the inserted record on success
|
||||
*/
|
||||
uint64_t insert_log_record(unsigned int term, std::ostringstream& sql,
|
||||
uint64_t insert_log_record(unsigned int term, const std::ostringstream& sql,
|
||||
time_t timestamp, uint64_t fed_index);
|
||||
};
|
||||
|
||||
@ -397,29 +397,29 @@ public:
|
||||
|
||||
virtual ~FedLogDB(){};
|
||||
|
||||
int exec_wr(std::ostringstream& cmd);
|
||||
int exec_wr(std::ostringstream& cmd) override;
|
||||
|
||||
int exec_local_wr(std::ostringstream& cmd)
|
||||
int exec_local_wr(std::ostringstream& cmd) override
|
||||
{
|
||||
return _logdb->exec_local_wr(cmd);
|
||||
}
|
||||
|
||||
int exec_rd(std::ostringstream& cmd, Callbackable* obj)
|
||||
int exec_rd(std::ostringstream& cmd, Callbackable* obj) override
|
||||
{
|
||||
return _logdb->exec_rd(cmd, obj);
|
||||
}
|
||||
|
||||
char * escape_str(const std::string& str) const
|
||||
char * escape_str(const std::string& str) const override
|
||||
{
|
||||
return _logdb->escape_str(str);
|
||||
}
|
||||
|
||||
void free_str(char * str) const
|
||||
void free_str(char * str) const override
|
||||
{
|
||||
_logdb->free_str(str);
|
||||
}
|
||||
|
||||
bool supports(SqlDB::SqlFeature ft) const
|
||||
bool supports(SqlDB::SqlFeature ft) const override
|
||||
{
|
||||
return _logdb->supports(ft);
|
||||
}
|
||||
@ -431,13 +431,13 @@ public:
|
||||
*
|
||||
* @return pointer to the non-federated logDB
|
||||
*/
|
||||
virtual SqlDB * get_local_db()
|
||||
SqlDB * get_local_db() override
|
||||
{
|
||||
return _logdb->get_local_db();
|
||||
}
|
||||
|
||||
protected:
|
||||
int exec_ext(std::ostringstream& cmd, Callbackable *obj, bool quiet)
|
||||
int exec_ext(std::ostringstream& cmd, Callbackable *obj, bool quiet) override
|
||||
{
|
||||
return SqlDB::INTERNAL;
|
||||
};
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
* @param error_msg Error reason, if any
|
||||
* @return 0 on success, -1 DB error
|
||||
*/
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg);
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Imports an app into the marketplace, as reported by the monitor driver
|
||||
@ -154,7 +154,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "MARKETPLACEAPP_POOL", "body",
|
||||
one_db::mp_app_table, where, sid, eid, desc);
|
||||
@ -164,13 +164,13 @@ public:
|
||||
* @param zone pointer to Zone
|
||||
* @return 0 on success
|
||||
*/
|
||||
int update(PoolObjectSQL * objsql);
|
||||
int update(PoolObjectSQL * objsql) override;
|
||||
|
||||
/**
|
||||
* Factory method to produce objects
|
||||
* @return a pointer to the new object
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new MarketPlaceApp(-1,-1,"","", 0, 0);
|
||||
};
|
||||
|
@ -86,7 +86,7 @@ public:
|
||||
* @param objsql points to the market
|
||||
* @return 0 on success
|
||||
*/
|
||||
int update(PoolObjectSQL * objsql);
|
||||
int update(PoolObjectSQL * objsql) override;
|
||||
|
||||
/**
|
||||
* Drops the MarketPlace data in the data base. The object mutex SHOULD be
|
||||
@ -95,7 +95,7 @@ public:
|
||||
* @param error_msg Error reason, if any
|
||||
* @return 0 on success, -1 DB error -3 MarketPlace's App ID set not empty
|
||||
*/
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg);
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Bootstraps the database table(s) associated to the MarketPlace pool
|
||||
@ -118,7 +118,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "MARKETPLACE_POOL", "body", one_db::mp_table,
|
||||
where, sid, eid, desc);
|
||||
@ -139,7 +139,7 @@ public:
|
||||
* Factory method to produce objects
|
||||
* @return a pointer to the new object
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new MarketPlace(-1,-1,"","", 0, 0);
|
||||
};
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
const std::string& _database,
|
||||
const std::string& _encoding,
|
||||
int _connections,
|
||||
std::string& _compare_binary);
|
||||
const std::string& _compare_binary);
|
||||
|
||||
~MySqlDB();
|
||||
|
||||
@ -60,13 +60,13 @@ public:
|
||||
* @param str the string to be escaped
|
||||
* @return a valid SQL string or NULL in case of failure
|
||||
*/
|
||||
char * escape_str(const std::string& str) const;
|
||||
char * escape_str(const std::string& str) const override;
|
||||
|
||||
/**
|
||||
* Frees a previously scaped string
|
||||
* @param str pointer to the str
|
||||
*/
|
||||
void free_str(char * str) const
|
||||
void free_str(char * str) const override
|
||||
{
|
||||
delete[] str;
|
||||
}
|
||||
|
@ -272,13 +272,15 @@ public:
|
||||
* Frees a vector of XMLNodes, as returned by the get_nodes function
|
||||
* @param content the vector of xmlNodePtr
|
||||
*/
|
||||
void free_nodes(std::vector<xmlNodePtr>& content) const
|
||||
static void free_nodes(std::vector<xmlNodePtr>& content)
|
||||
{
|
||||
for (auto it : content)
|
||||
{
|
||||
xmlFreeNode(it);
|
||||
}
|
||||
};
|
||||
|
||||
content.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the object representation with a new XML document. Previous
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
/**
|
||||
* Parse and loads the configuration in the template
|
||||
*/
|
||||
virtual int load_configuration();
|
||||
int load_configuration() override;
|
||||
|
||||
/**
|
||||
* Returns action set from a string of actions seperated by commas
|
||||
@ -84,12 +84,12 @@ private:
|
||||
/**
|
||||
* Sets the defaults value for the template
|
||||
*/
|
||||
void set_conf_default();
|
||||
void set_conf_default() override;
|
||||
|
||||
/**
|
||||
* Sets the defaults value for multiple attributes
|
||||
*/
|
||||
void set_multiple_conf_default();
|
||||
void set_multiple_conf_default() override;
|
||||
|
||||
/**
|
||||
* register the multiple configuration attributes and clean the
|
||||
|
@ -88,32 +88,32 @@ protected:
|
||||
*/
|
||||
class QuotaDecorator : public QuotaInterface
|
||||
{
|
||||
virtual bool check(Template* tmpl, Quotas& default_quotas, std::string& error)
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& error) override
|
||||
{
|
||||
return quota->check(tmpl, default_quotas, error);
|
||||
}
|
||||
|
||||
virtual void del(Template* tmpl)
|
||||
void del(Template* tmpl) override
|
||||
{
|
||||
return quota->del(tmpl);
|
||||
}
|
||||
|
||||
virtual int set(std::vector<VectorAttribute*> * quotas, std::string& error)
|
||||
int set(std::vector<VectorAttribute*> * quotas, std::string& error) override
|
||||
{
|
||||
return quota->set(quotas, error);
|
||||
}
|
||||
|
||||
virtual bool update(Template * tmpl, Quotas& default_quotas, std::string& error)
|
||||
bool update(Template * tmpl, Quotas& default_quotas, std::string& error) override
|
||||
{
|
||||
return quota->update(tmpl, default_quotas, error);
|
||||
}
|
||||
|
||||
virtual const char * get_quota_name() const
|
||||
const char * get_quota_name() const override
|
||||
{
|
||||
return quota->get_quota_name();
|
||||
}
|
||||
|
||||
virtual int get_quota(const std::string& id, VectorAttribute **va)
|
||||
int get_quota(const std::string& id, VectorAttribute **va) override
|
||||
{
|
||||
return quota->get_quota(id, va);
|
||||
}
|
||||
@ -142,7 +142,7 @@ public:
|
||||
*
|
||||
* @return 0 on success -1 otherwise
|
||||
*/
|
||||
int set(std::vector<VectorAttribute*> * quotas, std::string& error);
|
||||
int set(std::vector<VectorAttribute*> * quotas, std::string& error) override;
|
||||
|
||||
/**
|
||||
* Check if a resource update in usage counters will exceed the
|
||||
@ -152,7 +152,7 @@ public:
|
||||
* @param error string
|
||||
* @return true if the operation can be performed
|
||||
*/
|
||||
virtual bool update(Template * tmpl, Quotas& default_quotas, std::string& error)
|
||||
bool update(Template * tmpl, Quotas& default_quotas, std::string& error) override
|
||||
{
|
||||
error = "Update operation for quotas not supported.";
|
||||
return false;
|
||||
@ -161,7 +161,7 @@ public:
|
||||
/**
|
||||
* Returns the name that identifies the quota in a template
|
||||
*/
|
||||
const char * get_quota_name() const
|
||||
const char * get_quota_name() const override
|
||||
{
|
||||
return template_name;
|
||||
}
|
||||
@ -172,7 +172,7 @@ public:
|
||||
* @param va The quota, if it is found
|
||||
* @return 0 on success, -1 if not found
|
||||
*/
|
||||
virtual int get_quota(const std::string& id, VectorAttribute **va)
|
||||
int get_quota(const std::string& id, VectorAttribute **va) override
|
||||
{
|
||||
std::map<std::string, Attribute *>::iterator it;
|
||||
return get_quota(id, va, it);
|
||||
|
@ -54,13 +54,13 @@ public:
|
||||
* @param error string
|
||||
* @return true if the operation can be performed
|
||||
*/
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& error);
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& error) override;
|
||||
|
||||
/**
|
||||
* Decrement usage counters when deallocating image
|
||||
* @param tmpl template for the resource
|
||||
*/
|
||||
void del(Template* tmpl);
|
||||
void del(Template* tmpl) override;
|
||||
|
||||
protected:
|
||||
|
||||
@ -75,7 +75,7 @@ protected:
|
||||
*/
|
||||
int get_default_quota(const std::string& id,
|
||||
Quotas& default_quotas,
|
||||
VectorAttribute **va);
|
||||
VectorAttribute **va) override;
|
||||
|
||||
static const char * DS_METRICS[];
|
||||
|
||||
|
@ -52,13 +52,13 @@ public:
|
||||
* @param error string
|
||||
* @return true if the operation can be performed
|
||||
*/
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& error);
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& error) override;
|
||||
|
||||
/**
|
||||
* Decrement usage counters when deallocating image
|
||||
* @param tmpl template for the resource
|
||||
*/
|
||||
void del(Template* tmpl);
|
||||
void del(Template* tmpl) override;
|
||||
|
||||
protected:
|
||||
|
||||
@ -73,7 +73,7 @@ protected:
|
||||
*/
|
||||
int get_default_quota(const std::string& id,
|
||||
Quotas& default_quotas,
|
||||
VectorAttribute **va);
|
||||
VectorAttribute **va) override;
|
||||
|
||||
static const char * IMAGE_METRICS[];
|
||||
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
* @param error string
|
||||
* @return true if the operation can be performed
|
||||
*/
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& err)
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& err) override
|
||||
{
|
||||
return check(PoolObjectSQL::VM, tmpl, default_quotas, err);
|
||||
}
|
||||
@ -56,7 +56,7 @@ public:
|
||||
* the object type to accounto for FLOATING IP addresses or not
|
||||
* @param tmpl template for the resource
|
||||
*/
|
||||
void del(Template* tmpl)
|
||||
void del(Template* tmpl) override
|
||||
{
|
||||
del(PoolObjectSQL::VM, tmpl);
|
||||
}
|
||||
@ -73,7 +73,7 @@ protected:
|
||||
*/
|
||||
int get_default_quota(const std::string& id,
|
||||
Quotas& default_quotas,
|
||||
VectorAttribute **va);
|
||||
VectorAttribute **va) override;
|
||||
|
||||
static const char * NET_METRICS[];
|
||||
|
||||
@ -120,14 +120,14 @@ public:
|
||||
|
||||
virtual ~QuotaNetworkVirtualRouter(){};
|
||||
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& err)
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& err) override
|
||||
{
|
||||
QuotaNetwork * qn = static_cast<QuotaNetwork *>(quota);
|
||||
|
||||
return qn->check(PoolObjectSQL::VROUTER, tmpl, default_quotas, err);
|
||||
}
|
||||
|
||||
void del(Template* tmpl)
|
||||
void del(Template* tmpl) override
|
||||
{
|
||||
QuotaNetwork * qn = static_cast<QuotaNetwork *>(quota);
|
||||
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
* @param error string
|
||||
* @return true if the operation can be performed
|
||||
*/
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& error);
|
||||
bool check(Template* tmpl, Quotas& default_quotas, std::string& error) override;
|
||||
|
||||
/**
|
||||
* Check if the resource update (change in MEMORY or CPU) will exceed the
|
||||
@ -73,13 +73,13 @@ public:
|
||||
* @param error string
|
||||
* @return true if the operation can be performed
|
||||
*/
|
||||
bool update(Template * tmpl, Quotas& default_quotas, std::string& error);
|
||||
bool update(Template * tmpl, Quotas& default_quotas, std::string& error) override;
|
||||
|
||||
/**
|
||||
* Decrement usage counters when deallocating image
|
||||
* @param tmpl template for the resource
|
||||
*/
|
||||
void del(Template* tmpl);
|
||||
void del(Template* tmpl) override;
|
||||
|
||||
/**
|
||||
* Gets a quota, overrides base to not to use ID.
|
||||
@ -88,7 +88,7 @@ public:
|
||||
*
|
||||
* @return a pointer to the quota or 0 if not found
|
||||
*/
|
||||
int get_quota(const std::string& id, VectorAttribute **va);
|
||||
int get_quota(const std::string& id, VectorAttribute **va) override;
|
||||
|
||||
protected:
|
||||
|
||||
@ -104,7 +104,7 @@ protected:
|
||||
int get_quota(
|
||||
const std::string& id,
|
||||
VectorAttribute **va,
|
||||
std::map<std::string, Attribute *>::iterator& it)
|
||||
std::map<std::string, Attribute *>::iterator& it) override
|
||||
{
|
||||
it = attributes.begin();
|
||||
return get_quota(id, va);
|
||||
@ -122,7 +122,7 @@ protected:
|
||||
int get_default_quota(
|
||||
const std::string& id,
|
||||
Quotas& default_quotas,
|
||||
VectorAttribute **va);
|
||||
VectorAttribute **va) override;
|
||||
|
||||
static const char * VM_METRICS[];
|
||||
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
* @param db pointer to the db
|
||||
* @return 0 on success
|
||||
*/
|
||||
int drop(SqlDB * db);
|
||||
int drop(SqlDB * db) override;
|
||||
|
||||
protected:
|
||||
|
||||
@ -96,14 +96,14 @@ private:
|
||||
* @param db pointer to the db
|
||||
* @return 0 on success
|
||||
*/
|
||||
int select(SqlDB * db);
|
||||
int select(SqlDB * db) override;
|
||||
|
||||
/**
|
||||
* Writes the Quotas in the database.
|
||||
* @param db pointer to the db
|
||||
* @return 0 on success
|
||||
*/
|
||||
int insert(SqlDB *db, std::string& error_str)
|
||||
int insert(SqlDB *db, std::string& error_str) override
|
||||
{
|
||||
return insert_replace(db, false, error_str);
|
||||
};
|
||||
@ -113,7 +113,7 @@ private:
|
||||
* @param db pointer to the db
|
||||
* @return 0 on success
|
||||
*/
|
||||
int update(SqlDB *db)
|
||||
int update(SqlDB *db) override
|
||||
{
|
||||
std::string error_str;
|
||||
return insert_replace(db, true, error_str);
|
||||
@ -173,17 +173,17 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
const char * table() const
|
||||
const char * table() const override
|
||||
{
|
||||
return one_db::group_quotas_db_table;
|
||||
};
|
||||
|
||||
const char * table_names() const
|
||||
const char * table_names() const override
|
||||
{
|
||||
return one_db::group_quotas_db_names;
|
||||
};
|
||||
|
||||
const char * table_oid_column() const
|
||||
const char * table_oid_column() const override
|
||||
{
|
||||
return one_db::group_quotas_db_oid_column;
|
||||
};
|
||||
@ -219,17 +219,17 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
const char * table() const
|
||||
const char * table() const override
|
||||
{
|
||||
return one_db::user_quotas_db_table;
|
||||
};
|
||||
|
||||
const char * table_names() const
|
||||
const char * table_names() const override
|
||||
{
|
||||
return one_db::user_quotas_db_names;
|
||||
};
|
||||
|
||||
const char * table_oid_column() const
|
||||
const char * table_oid_column() const override
|
||||
{
|
||||
return one_db::user_quotas_db_oid_column;
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
delete rp_vm;
|
||||
};
|
||||
|
||||
void register_policies(const SchedulerTemplate& conf)
|
||||
void register_policies(const SchedulerTemplate& conf) override
|
||||
{
|
||||
rp_host = new RankHostPolicy(hpool, conf.get_policy(), 1.0);
|
||||
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
virtual ~RaftReplicaManager(){};
|
||||
|
||||
private:
|
||||
ReplicaThread * thread_factory(int follower_id);
|
||||
ReplicaThread * thread_factory(int follower_id) override;
|
||||
};
|
||||
|
||||
class HeartBeatManager : public ReplicaManager
|
||||
@ -112,7 +112,7 @@ public:
|
||||
virtual ~HeartBeatManager(){};
|
||||
|
||||
private:
|
||||
ReplicaThread * thread_factory(int follower_id);
|
||||
ReplicaThread * thread_factory(int follower_id) override;
|
||||
};
|
||||
|
||||
#endif /*REPLICA_MANAGER_H_*/
|
||||
|
@ -106,7 +106,7 @@ private:
|
||||
/**
|
||||
* Specific logic for the replicate process
|
||||
*/
|
||||
int replicate();
|
||||
int replicate() override;
|
||||
|
||||
/**
|
||||
* Pointers to other components
|
||||
@ -133,7 +133,7 @@ private:
|
||||
/**
|
||||
* Specific logic for the replicate process
|
||||
*/
|
||||
int replicate();
|
||||
int replicate() override;
|
||||
|
||||
/**
|
||||
* Pointers to other components
|
||||
@ -162,7 +162,7 @@ private:
|
||||
/**
|
||||
* Specific logic for the replicate process
|
||||
*/
|
||||
int replicate();
|
||||
int replicate() override;
|
||||
|
||||
/**
|
||||
* Pointers to other components
|
||||
|
@ -455,7 +455,7 @@ protected:
|
||||
* @return true if the user is authorized.
|
||||
*/
|
||||
static bool quota_authorization(Template * tmpl, Quotas::QuotaType qtype,
|
||||
RequestAttributes& att, std::string& error_str);
|
||||
const RequestAttributes& att, std::string& error_str);
|
||||
|
||||
/**
|
||||
* Performs rollback on usage counters for a previous quota check operation
|
||||
@ -464,7 +464,7 @@ protected:
|
||||
* @param att the specific request attributes
|
||||
*/
|
||||
static void quota_rollback(Template * tmpl, Quotas::QuotaType qtype,
|
||||
RequestAttributes& att);
|
||||
const RequestAttributes& att);
|
||||
|
||||
/**
|
||||
* @param tmpl describing the object
|
||||
@ -477,16 +477,16 @@ private:
|
||||
/* Functions to manage user and group quotas */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
static bool user_quota_authorization(Template * tmpl, Quotas::QuotaType qtype,
|
||||
RequestAttributes& att, std::string& error_str);
|
||||
const RequestAttributes& att, std::string& error_str);
|
||||
|
||||
static bool group_quota_authorization(Template * tmpl, Quotas::QuotaType qtype,
|
||||
RequestAttributes& att, std::string& error_str);
|
||||
const RequestAttributes& att, std::string& error_str);
|
||||
|
||||
static void user_quota_rollback(Template * tmpl, Quotas::QuotaType qtype,
|
||||
RequestAttributes& att);
|
||||
const RequestAttributes& att);
|
||||
|
||||
static void group_quota_rollback(Template * tmpl, Quotas::QuotaType qtype,
|
||||
RequestAttributes& att);
|
||||
const RequestAttributes& att);
|
||||
|
||||
/**
|
||||
* Builds an XML-RPC response updating retval. After calling this function
|
||||
|
@ -43,11 +43,6 @@ protected:
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
AclManager * aclm;
|
||||
};
|
||||
|
||||
|
@ -588,7 +588,7 @@ public:
|
||||
Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& paramList,
|
||||
std::unique_ptr<Template> tmpl,
|
||||
int& id,
|
||||
RequestAttributes& att);
|
||||
RequestAttributes& att) override;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@ -781,7 +781,7 @@ public:
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
std::unique_ptr<Template> get_object_template() const
|
||||
std::unique_ptr<Template> get_object_template() const override
|
||||
{
|
||||
return std::make_unique<Template>();
|
||||
};
|
||||
@ -789,7 +789,7 @@ public:
|
||||
Request::ErrorCode pool_allocate(xmlrpc_c::paramList const& _paramList,
|
||||
std::unique_ptr<Template> tmpl,
|
||||
int& id,
|
||||
RequestAttributes& att);
|
||||
RequestAttributes& att) override;
|
||||
|
||||
|
||||
};
|
||||
|
@ -103,7 +103,7 @@ protected:
|
||||
|
||||
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,
|
||||
int other_m, int other_a, bool recursive, RequestAttributes& att);
|
||||
int other_m, int other_a, bool recursive, RequestAttributes& att) override;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -54,9 +54,6 @@ protected:
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
|
||||
void add_generic(
|
||||
int cluster_id,
|
||||
int object_id,
|
||||
|
@ -39,12 +39,8 @@ protected:
|
||||
auth_object = PoolObjectSQL::DATASTORE;
|
||||
auth_op = AuthRequest::MANAGE;
|
||||
};
|
||||
|
||||
~RequestManagerDatastore() = default;
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -39,9 +39,6 @@ protected:
|
||||
};
|
||||
|
||||
~RequestManagerGroup(){};
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -40,11 +40,6 @@ protected:
|
||||
};
|
||||
|
||||
~RequestManagerHook() = default;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@ -62,8 +57,7 @@ public:
|
||||
~HookRetry() = default;
|
||||
|
||||
void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att);
|
||||
|
||||
RequestAttributes& att) override;
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -40,11 +40,6 @@ protected:
|
||||
};
|
||||
|
||||
~RequestManagerHost(){};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -41,11 +41,6 @@ protected:
|
||||
};
|
||||
|
||||
~RequestManagerImage(){};
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -439,7 +439,7 @@ public:
|
||||
|
||||
protected:
|
||||
void to_xml(RequestAttributes& att, PoolObjectSQL * object,
|
||||
std::string& str)
|
||||
std::string& str) override
|
||||
{
|
||||
(static_cast<Hook *>(object))->to_xml_extended(str);
|
||||
};
|
||||
|
@ -29,11 +29,6 @@ protected:
|
||||
const std::string& help, const std::string& params);
|
||||
|
||||
~RequestManagerMarketPlaceApp() = default;
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -515,7 +515,7 @@ public:
|
||||
|
||||
~HookRename() = default;
|
||||
|
||||
int exist(const std::string& name, int uid)
|
||||
int exist(const std::string& name, int uid) override
|
||||
{
|
||||
return pool->exist(name, uid);
|
||||
}
|
||||
|
@ -36,11 +36,6 @@ protected:
|
||||
};
|
||||
|
||||
~RequestManagerSystem(){};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -157,7 +157,6 @@ public:
|
||||
|
||||
if ( ec == SUCCESS )
|
||||
{
|
||||
std::vector<int> zids;
|
||||
success_response(oid, att);
|
||||
}
|
||||
else
|
||||
|
@ -40,11 +40,6 @@ protected:
|
||||
};
|
||||
|
||||
~RequestManagerVMTemplate(){};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -31,9 +31,6 @@ protected:
|
||||
const std::string& params);
|
||||
|
||||
~RequestManagerVNTemplate() = default;
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -34,7 +34,7 @@ class VdcEditGroup : public Request
|
||||
{
|
||||
public:
|
||||
void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att);
|
||||
RequestAttributes& att) override;
|
||||
|
||||
protected:
|
||||
VdcEditGroup(const std::string& method_name,
|
||||
@ -99,7 +99,7 @@ class VdcEditResource : public Request
|
||||
{
|
||||
public:
|
||||
void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att);
|
||||
RequestAttributes& att) override;
|
||||
|
||||
protected:
|
||||
VdcEditResource(const std::string& method_name,
|
||||
|
@ -44,9 +44,6 @@ protected:
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
|
||||
// Authorize the request, set failure_response message
|
||||
bool vm_authorization(int id,
|
||||
ImageTemplate * tmpl,
|
||||
|
@ -31,9 +31,6 @@ protected:
|
||||
const std::string& params);
|
||||
|
||||
~RequestManagerVirtualRouter() = default;
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -41,11 +41,6 @@ protected:
|
||||
};
|
||||
|
||||
~RequestManagerZone(){};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
virtual void request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
RequestAttributes& att) = 0;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -112,7 +112,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "SECURITY_GROUP_POOL", "body", one_db::sg_table,
|
||||
where, sid, eid, desc);
|
||||
@ -126,7 +126,7 @@ public:
|
||||
* @param sgs security group ID set
|
||||
* @param rules Security Group rules will be added at the end of this vector
|
||||
*/
|
||||
void get_security_group_rules(int vmid, std::set<int>& sgs,
|
||||
void get_security_group_rules(int vmid, const std::set<int>& sgs,
|
||||
std::vector<VectorAttribute*> &rules)
|
||||
{
|
||||
for (auto sg : sgs)
|
||||
@ -153,7 +153,7 @@ private:
|
||||
* Factory method to produce objects
|
||||
* @return a pointer to the new object
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new SecurityGroup(-1,-1,"","",0,0);
|
||||
};
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
|
||||
line_sz += rc;
|
||||
|
||||
const char * eom = strchr(cur_ptr, '\n');
|
||||
eom = strchr(cur_ptr, '\n');
|
||||
|
||||
if ( eom == 0)
|
||||
{
|
||||
|
@ -672,7 +672,7 @@ private:
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void _set(std::vector<T *>& values)
|
||||
void _set(const std::vector<T *>& values)
|
||||
{
|
||||
for (auto v : values)
|
||||
{
|
||||
|
@ -79,8 +79,8 @@ public:
|
||||
int prolog_transfer_command(
|
||||
VirtualMachine * vm,
|
||||
const VirtualMachineDisk* disk,
|
||||
std::string& system_tm_mad,
|
||||
std::string& opennebula_hostname,
|
||||
const std::string& system_tm_mad,
|
||||
const std::string& opennebula_hostname,
|
||||
std::ostream& xfr,
|
||||
std::ostringstream& error);
|
||||
|
||||
@ -98,7 +98,7 @@ public:
|
||||
int prolog_context_command(
|
||||
VirtualMachine * vm,
|
||||
const std::string& token_password,
|
||||
std::string& system_tm_mad,
|
||||
const std::string& system_tm_mad,
|
||||
int& disk_id,
|
||||
std::ostream& xfr);
|
||||
|
||||
@ -226,7 +226,7 @@ private:
|
||||
// -------------------------------------------------------------------------
|
||||
static const int drivers_timeout = 10;
|
||||
|
||||
void finalize_action()
|
||||
void finalize_action() override
|
||||
{
|
||||
DriverManager::stop(drivers_timeout);
|
||||
};
|
||||
|
@ -40,8 +40,8 @@ class UserPool : public PoolSQL
|
||||
public:
|
||||
|
||||
UserPool(SqlDB * db, time_t __session_expiration_time, bool is_slave,
|
||||
std::vector<const SingleAttribute *>& restricted_attrs,
|
||||
std::vector<const SingleAttribute *>& encrypted_attrs);
|
||||
const std::vector<const SingleAttribute *>& restricted_attrs,
|
||||
const std::vector<const SingleAttribute *>& encrypted_attrs);
|
||||
|
||||
~UserPool() = default;
|
||||
|
||||
@ -68,7 +68,7 @@ public:
|
||||
* @param error_msg Error reason, if any
|
||||
* @return 0 on success, -1 DB error
|
||||
*/
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg);
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Gets an object from the pool (if needed the object is loaded from the
|
||||
@ -160,7 +160,7 @@ public:
|
||||
* @param user pointer to User
|
||||
* @return 0 on success
|
||||
*/
|
||||
int update(PoolObjectSQL * objsql);
|
||||
int update(PoolObjectSQL * objsql) override;
|
||||
|
||||
/**
|
||||
* Update a particular User's Quotas
|
||||
@ -218,7 +218,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where,
|
||||
int sid, int eid, bool desc);
|
||||
int sid, int eid, bool desc) override;
|
||||
|
||||
/**
|
||||
* Name for the OpenNebula core authentication process
|
||||
@ -316,7 +316,7 @@ private:
|
||||
* Factory method to produce User objects
|
||||
* @return a pointer to the new User
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new User(-1,-1,"","","",UserPool::CORE_AUTH,true);
|
||||
};
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
return Template::check_restricted(rs_attr, restricted);
|
||||
}
|
||||
|
||||
static void parse_restricted(std::vector<const SingleAttribute *>& ra)
|
||||
static void parse_restricted(const std::vector<const SingleAttribute *>& ra)
|
||||
{
|
||||
Template::parse_restricted(ra, restricted);
|
||||
}
|
||||
@ -50,17 +50,17 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// Encrypted attributes interface implementation
|
||||
// -------------------------------------------------------------------------
|
||||
virtual void encrypt(const std::string& one_key)
|
||||
void encrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::encrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
virtual void decrypt(const std::string& one_key)
|
||||
void decrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::decrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
static void parse_encrypted(std::vector<const SingleAttribute *>& ea)
|
||||
static void parse_encrypted(const std::vector<const SingleAttribute *>& ea)
|
||||
{
|
||||
Template::parse_encrypted(ea, encrypted);
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "VM_GROUP_POOL", "body",
|
||||
one_db::vm_group_table, where, sid, eid, desc);
|
||||
@ -146,7 +146,7 @@ private:
|
||||
* Factory method to produce objects
|
||||
* @return a pointer to the new object
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new VMGroup(-1,-1,"","",0,0);
|
||||
};
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "VMTEMPLATE_POOL", "body",
|
||||
one_db::vm_template_table, where, sid, eid, desc);
|
||||
@ -110,7 +110,7 @@ private:
|
||||
* Factory method to produce Image objects
|
||||
* @return a pointer to the new Image
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new VMTemplate(-1,-1,-1,"","",0,0);
|
||||
};
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "VNTEMPLATE_POOL", "body",
|
||||
one_db::vn_template_table, where, sid, eid, desc);
|
||||
@ -110,7 +110,7 @@ private:
|
||||
* Factory method to produce VNTemplate objects
|
||||
* @return a pointer to the new VNTemplate
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new VNTemplate(-1,-1,-1,"","",0,0);
|
||||
};
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
* @param vdc pointer to Vdc
|
||||
* @return 0 on success
|
||||
*/
|
||||
int update(PoolObjectSQL * objsql);
|
||||
int update(PoolObjectSQL * objsql) override;
|
||||
|
||||
/**
|
||||
* Drops the Vdc from the data base. The object mutex SHOULD be
|
||||
@ -74,7 +74,7 @@ public:
|
||||
* -1 DB error,
|
||||
* -2 object is a default Vdc (ID < 100)
|
||||
*/
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg);
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Bootstraps the database table(s) associated to the Vdc pool
|
||||
@ -97,7 +97,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "VDC_POOL", "body", one_db::vdc_table,
|
||||
where, sid, eid, desc);
|
||||
@ -130,7 +130,7 @@ private:
|
||||
* Factory method to produce objects
|
||||
* @return a pointer to the new object
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new Vdc(-1,0);
|
||||
};
|
||||
|
@ -990,7 +990,7 @@ public:
|
||||
* @param message Message string
|
||||
*/
|
||||
void set_template_error_message(const std::string& name,
|
||||
const std::string& message);
|
||||
const std::string& message) override;
|
||||
|
||||
/**
|
||||
* Deletes the error message from the template
|
||||
|
@ -126,15 +126,6 @@ protected:
|
||||
* @return the attribute for which the flag was cleared, 0 if none
|
||||
*/
|
||||
VirtualMachineAttribute * clear_flag(const std::string& flag_name);
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* Attribute map interface */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/**
|
||||
* Abstract method to create the VirtualMachineAttributes for this set
|
||||
*/
|
||||
virtual ExtendedAttribute * attribute_factory(VectorAttribute * va,
|
||||
int id) const = 0;
|
||||
};
|
||||
|
||||
#endif /*VIRTUAL_MACHINE_ATTRIBUTE_H_*/
|
||||
|
@ -347,7 +347,7 @@ private:
|
||||
|
||||
static const int drivers_timeout = 10;
|
||||
|
||||
void finalize_action()
|
||||
void finalize_action() override
|
||||
{
|
||||
DriverManager::stop(drivers_timeout);
|
||||
};
|
||||
|
@ -31,8 +31,8 @@ class VirtualMachinePool : public PoolSQL
|
||||
public:
|
||||
|
||||
VirtualMachinePool(SqlDB * db,
|
||||
std::vector<const SingleAttribute *>& restricted_attrs,
|
||||
std::vector<const SingleAttribute *>& encrypted_attrs,
|
||||
const std::vector<const SingleAttribute *>& restricted_attrs,
|
||||
const std::vector<const SingleAttribute *>& encrypted_attrs,
|
||||
bool on_hold,
|
||||
float default_cpu_cost,
|
||||
float default_mem_cost,
|
||||
@ -252,7 +252,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "VM_POOL", "short_body", one_db::vm_table, where,
|
||||
sid, eid, desc);
|
||||
@ -272,7 +272,7 @@ public:
|
||||
*/
|
||||
int dump_extended(std::string& oss, const std::string& where,
|
||||
int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "VM_POOL", "body", one_db::vm_table, where,
|
||||
sid, eid, desc);
|
||||
@ -415,7 +415,7 @@ private:
|
||||
* Factory method to produce VM objects
|
||||
* @return a pointer to the new VM
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new VirtualMachine(-1,-1,-1,"","",0,0);
|
||||
};
|
||||
|
@ -70,17 +70,17 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// Restricted attributes interface implementation
|
||||
// -------------------------------------------------------------------------
|
||||
virtual bool check_restricted(std::string& rs_attr, const Template* base)
|
||||
bool check_restricted(std::string& rs_attr, const Template* base) override
|
||||
{
|
||||
return Template::check_restricted(rs_attr, base, restricted);
|
||||
}
|
||||
|
||||
virtual bool check_restricted(std::string& rs_attr)
|
||||
bool check_restricted(std::string& rs_attr) override
|
||||
{
|
||||
return Template::check_restricted(rs_attr, restricted);
|
||||
}
|
||||
|
||||
static void parse_restricted(std::vector<const SingleAttribute *>& ra)
|
||||
static void parse_restricted(const std::vector<const SingleAttribute *>& ra)
|
||||
{
|
||||
Template::parse_restricted(ra, restricted);
|
||||
}
|
||||
@ -101,17 +101,17 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// Encrypted attributes interface implementation
|
||||
// -------------------------------------------------------------------------
|
||||
virtual void encrypt(const std::string& one_key)
|
||||
void encrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::encrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
virtual void decrypt(const std::string& one_key)
|
||||
void decrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::decrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
static void parse_encrypted(std::vector<const SingleAttribute *>& ea)
|
||||
static void parse_encrypted(const std::vector<const SingleAttribute *>& ea)
|
||||
{
|
||||
Template::parse_encrypted(ea, encrypted);
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
/**
|
||||
* Drops a Virtual Network and the associated VLAN_ID if needed
|
||||
*/
|
||||
int drop(PoolObjectSQL * vn, std::string& error_msg)
|
||||
int drop(PoolObjectSQL * vn, std::string& error_msg) override
|
||||
{
|
||||
release_vlan_id(static_cast<VirtualNetwork *>(vn));
|
||||
|
||||
@ -169,7 +169,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "VNET_POOL", "body", one_db::vn_table,
|
||||
where, sid, eid, desc);
|
||||
@ -400,7 +400,7 @@ private:
|
||||
* Factory method to produce VN objects
|
||||
* @return a pointer to the new VN
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
std::set <int> empty;
|
||||
return new VirtualNetwork(-1,-1,"","",0,-1,empty,0);
|
||||
|
@ -39,17 +39,17 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// Restricted attributes interface implementation
|
||||
// -------------------------------------------------------------------------
|
||||
virtual bool check_restricted(std::string& rs_attr, const Template* base)
|
||||
bool check_restricted(std::string& rs_attr, const Template* base) override
|
||||
{
|
||||
return Template::check_restricted(rs_attr, base, restricted);
|
||||
}
|
||||
|
||||
virtual bool check_restricted(std::string& rs_attr)
|
||||
bool check_restricted(std::string& rs_attr) override
|
||||
{
|
||||
return Template::check_restricted(rs_attr, restricted);
|
||||
}
|
||||
|
||||
static void parse_restricted(std::vector<const SingleAttribute *>& ra)
|
||||
static void parse_restricted(const std::vector<const SingleAttribute *>& ra)
|
||||
{
|
||||
Template::parse_restricted(ra, restricted);
|
||||
}
|
||||
@ -57,18 +57,18 @@ public:
|
||||
// -------------------------------------------------------------------------
|
||||
// Encrypted attributes interface implementation
|
||||
// -------------------------------------------------------------------------
|
||||
virtual void encrypt(const std::string& one_key)
|
||||
void encrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::encrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
virtual void decrypt(const std::string& one_key)
|
||||
void decrypt(const std::string& one_key) override
|
||||
{
|
||||
Template::decrypt(one_key, encrypted);
|
||||
}
|
||||
|
||||
// One-time execution
|
||||
static void parse_encrypted(std::vector<const SingleAttribute *>& ea)
|
||||
static void parse_encrypted(const std::vector<const SingleAttribute *>& ea)
|
||||
{
|
||||
auto eas = const_cast<std::map<std::string, std::set<std::string>> *>(&encrypted);
|
||||
|
||||
|
@ -214,7 +214,7 @@ private:
|
||||
*
|
||||
* @return 0 on success, -1 otherwise
|
||||
*/
|
||||
int from_xml(const std::string &xml_str);
|
||||
int from_xml(const std::string &xml_str) override;
|
||||
|
||||
// *************************************************************************
|
||||
// Constructor
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "VROUTER_POOL", "body", one_db::vr_table,
|
||||
where, sid, eid, desc);
|
||||
@ -128,7 +128,7 @@ private:
|
||||
* Factory method to produce objects
|
||||
* @return a pointer to the new object
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new VirtualRouter(-1,-1,-1,"","",0,0);
|
||||
};
|
||||
|
@ -74,7 +74,7 @@ public:
|
||||
* @param zone pointer to Zone
|
||||
* @return 0 on success
|
||||
*/
|
||||
int update(PoolObjectSQL * objsql);
|
||||
int update(PoolObjectSQL * objsql) override;
|
||||
|
||||
/**
|
||||
* Drops the Zone from the data base. The object mutex SHOULD be
|
||||
@ -85,7 +85,7 @@ public:
|
||||
* -1 DB error,
|
||||
* -2 object is a default Zone (ID < 100)
|
||||
*/
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg);
|
||||
int drop(PoolObjectSQL * objsql, std::string& error_msg) override;
|
||||
|
||||
/**
|
||||
* Bootstraps the database table(s) associated to the Zone pool
|
||||
@ -108,7 +108,7 @@ public:
|
||||
* @return 0 on success
|
||||
*/
|
||||
int dump(std::string& oss, const std::string& where, int sid, int eid,
|
||||
bool desc)
|
||||
bool desc) override
|
||||
{
|
||||
return PoolSQL::dump(oss, "ZONE_POOL", "body", one_db::zone_table,
|
||||
where, sid, eid, desc);
|
||||
@ -143,7 +143,7 @@ private:
|
||||
* Factory method to produce objects
|
||||
* @return a pointer to the new object
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
PoolObjectSQL * create() override
|
||||
{
|
||||
return new Zone(-1,0);
|
||||
};
|
||||
|
@ -197,7 +197,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
ExtendedAttribute * attribute_factory(VectorAttribute * va, int id) const
|
||||
ExtendedAttribute * attribute_factory(VectorAttribute * va, int id) const override
|
||||
{
|
||||
return new ZoneServer(va, id);
|
||||
};
|
||||
|
@ -20,7 +20,31 @@
|
||||
<id>shadowFunction</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>constParameter</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>constVariable</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>useStlAlgorithm</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<!-- Suppresions specific per file, false positives -->
|
||||
<suppress>
|
||||
<id>knownConditionTrueFalse</id>
|
||||
<fileName>src/monitor/src/data_model/VMRPCPool.cc</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>nullPointer</id>
|
||||
<fileName>src/scheduler/include/Scheduler.h</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>uninitMemberVar</id>
|
||||
<fileName>include/Callbackable.h</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>containerOutOfBounds</id>
|
||||
<fileName>src/hm/HookLog.cc</fileName>
|
||||
@ -54,38 +78,9 @@
|
||||
<id>uninitMemberVar</id>
|
||||
<fileName>include/Callbackable.h</fileName>
|
||||
</suppress>
|
||||
<!-- Temporary suppressions, we may want to solve them in the future -->
|
||||
<suppress>
|
||||
<id>unusedVariable</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>noConstructor</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>constVariable</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>missingOverride</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>shadowVariable</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>unreadVariable</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>constParameter</id>
|
||||
<fileName>*</fileName>
|
||||
</suppress>
|
||||
<suppress>
|
||||
<id>useStlAlgorithm</id>
|
||||
<fileName>*</fileName>
|
||||
<fileName>include/Callbackable.h</fileName>
|
||||
</suppress>
|
||||
</suppressions>
|
||||
|
||||
|
@ -41,7 +41,7 @@ const int ClusterPool::DEFAULT_CLUSTER_ID = 0;
|
||||
|
||||
ClusterPool::ClusterPool(SqlDB * db,
|
||||
const VectorAttribute * _vnc_conf,
|
||||
vector<const SingleAttribute *>& encrypted_attrs):
|
||||
const vector<const SingleAttribute *>& encrypted_attrs):
|
||||
PoolSQL(db, one_db::cluster_table), vnc_conf(_vnc_conf)
|
||||
{
|
||||
ostringstream oss;
|
||||
@ -99,7 +99,6 @@ error_bootstrap:
|
||||
int ClusterPool::allocate(string name, int * oid, string& error_str)
|
||||
{
|
||||
Cluster * cluster;
|
||||
string error;
|
||||
|
||||
ostringstream oss;
|
||||
|
||||
@ -364,7 +363,7 @@ int ClusterPool::del_from_cluster(PoolObjectSQL::ObjectType type, Cluster* clust
|
||||
oss << "DELETE FROM " << table << " WHERE cid = "
|
||||
<< cluster->get_oid() << " AND oid = " << resource_id;
|
||||
|
||||
int rc = db->exec_wr(oss);
|
||||
rc = db->exec_wr(oss);
|
||||
|
||||
if (rc != 0)
|
||||
{
|
||||
|
@ -96,7 +96,6 @@ void Datastore::disk_attribute(
|
||||
{
|
||||
string st, tm_mad;
|
||||
string inherit_val;
|
||||
string current_val;
|
||||
|
||||
disk->replace("DATASTORE", get_name());
|
||||
disk->replace("DATASTORE_ID", oid);
|
||||
@ -382,7 +381,6 @@ int Datastore::set_tm_mad(const string &tm_mad, string &error_str)
|
||||
std::vector<std::string> modes;
|
||||
|
||||
ostringstream oss;
|
||||
std::stringstream ss;
|
||||
|
||||
string orph;
|
||||
|
||||
@ -443,8 +441,6 @@ int Datastore::set_tm_mad(const string &tm_mad, string &error_str)
|
||||
|
||||
modes = one_util::split(st, ',', true);
|
||||
|
||||
string s;
|
||||
|
||||
for (const auto &mode : modes)
|
||||
{
|
||||
string tm = one_util::trim(mode);
|
||||
@ -624,7 +620,6 @@ int Datastore::insert(SqlDB *db, string& error_str)
|
||||
{
|
||||
string s_disk_type;
|
||||
string s_ds_type;
|
||||
string datastore_location;
|
||||
|
||||
string safe_dirs;
|
||||
string restricted_dirs;
|
||||
@ -951,8 +946,6 @@ int Datastore::post_update_template(string& error_str)
|
||||
string new_tm_mad;
|
||||
string s_ds_type;
|
||||
string new_disk_type;
|
||||
string new_base_path;
|
||||
string vcenter_password;
|
||||
|
||||
DatastoreType new_ds_type;
|
||||
|
||||
|
@ -46,7 +46,7 @@ const int DatastorePool::FILE_DS_ID = 2;
|
||||
DatastorePool::DatastorePool(
|
||||
SqlDB * db,
|
||||
const vector<const SingleAttribute *>& _inherit_attrs,
|
||||
vector<const SingleAttribute *>& encrypted_attrs) :
|
||||
const vector<const SingleAttribute *>& encrypted_attrs) :
|
||||
PoolSQL(db, one_db::ds_table)
|
||||
|
||||
{
|
||||
|
@ -109,7 +109,6 @@ error:
|
||||
|
||||
int DispatchManager::import(unique_ptr<VirtualMachine> vm, const RequestAttributes& ra)
|
||||
{
|
||||
ostringstream oss;
|
||||
string import_state;
|
||||
|
||||
int uid;
|
||||
@ -1181,8 +1180,6 @@ int DispatchManager::delete_vm(int vid, const RequestAttributes& ra,
|
||||
int DispatchManager::delete_recreate(unique_ptr<VirtualMachine> vm,
|
||||
const RequestAttributes& ra, string& error)
|
||||
{
|
||||
ostringstream oss;
|
||||
|
||||
int rc = 0;
|
||||
|
||||
Template vm_quotas_snp;
|
||||
@ -1807,7 +1804,6 @@ int DispatchManager::detach_nic(int vid, int nic_id, const RequestAttributes& ra
|
||||
string& error_str)
|
||||
{
|
||||
ostringstream oss;
|
||||
string tmp_error;
|
||||
|
||||
auto vm = vmpool->get(vid);
|
||||
|
||||
|
@ -41,7 +41,7 @@ const int GroupPool::USERS_ID = 1;
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
GroupPool::GroupPool(SqlDB * db, bool is_slave,
|
||||
vector<const SingleAttribute *>& restricted_attrs)
|
||||
const vector<const SingleAttribute *>& restricted_attrs)
|
||||
: PoolSQL(db, one_db::group_table)
|
||||
{
|
||||
ostringstream oss;
|
||||
|
@ -32,7 +32,6 @@
|
||||
ExecuteHook::ExecuteHook(const std::string& _name, const std::string& _cmd,
|
||||
const std::string& _arg, const std::string& rl): name(_name), cmd(_cmd)
|
||||
{
|
||||
std::string s(_arg);
|
||||
std::istringstream iss(_arg);
|
||||
|
||||
if (cmd[0] != '/')
|
||||
|
@ -95,7 +95,7 @@ string& Hook::_to_xml(string& xml, bool log) const
|
||||
int Hook::from_xml(const std::string& xml)
|
||||
{
|
||||
vector<xmlNodePtr> content;
|
||||
std::string type_str, remote_str;
|
||||
std::string type_str;
|
||||
std::string error_msg;
|
||||
|
||||
int rc = 0;
|
||||
@ -139,8 +139,6 @@ int Hook::from_xml(const std::string& xml)
|
||||
|
||||
ObjectXML::free_nodes(content);
|
||||
|
||||
content.clear();
|
||||
|
||||
if (rc != 0)
|
||||
{
|
||||
return -1;
|
||||
@ -197,7 +195,6 @@ int Hook::bootstrap(SqlDB * db)
|
||||
int Hook::insert(SqlDB *db, std::string& error_str)
|
||||
{
|
||||
std::string type_str;
|
||||
std::string remote_str;
|
||||
|
||||
int rc;
|
||||
|
||||
@ -350,7 +347,6 @@ error_common:
|
||||
|
||||
int Hook::set_hook(HookType hook_type, string& error)
|
||||
{
|
||||
std::string type_str;
|
||||
std::string resource;
|
||||
|
||||
if (hook_type == UNDEFINED)
|
||||
|
@ -71,7 +71,8 @@ const string HookAPI::unsupported_calls[] = {"one.vm.info",
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
std::string HookAPI::format_message(const std::string& method, ParamList& paramList,
|
||||
std::string HookAPI::format_message(const std::string& method,
|
||||
const ParamList& paramList,
|
||||
const RequestAttributes& att)
|
||||
{
|
||||
ostringstream oss;
|
||||
|
@ -140,7 +140,7 @@ int HookLog::drop(SqlDB *db, const int hook_id)
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
int HookLog::add(int hkid, int hkrc, std::string &xml_result)
|
||||
int HookLog::add(int hkid, int hkrc, const std::string &xml_result)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
|
||||
|
@ -462,8 +462,6 @@ int Host::from_xml(const string& xml)
|
||||
|
||||
ObjectXML::free_nodes(content);
|
||||
|
||||
content.clear();
|
||||
|
||||
// ------------ Host Template ---------------
|
||||
|
||||
ObjectXML::get_nodes("/HOST/TEMPLATE", content);
|
||||
@ -477,8 +475,6 @@ int Host::from_xml(const string& xml)
|
||||
|
||||
ObjectXML::free_nodes(content);
|
||||
|
||||
content.clear();
|
||||
|
||||
// ------------ VMS collection ---------------
|
||||
rc += vm_collection.from_xml(this, "/HOST/");
|
||||
|
||||
|
@ -107,7 +107,6 @@ int NUMAMonitoring::from_xml(ObjectXML& xml, const std::string& xpath_prefix)
|
||||
}
|
||||
|
||||
xml.free_nodes(content);
|
||||
content.clear();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -291,7 +290,6 @@ int HostMonitoringTemplate::from_xml(const std::string& xml_string)
|
||||
capacity.from_xml_node(content[0]);
|
||||
|
||||
xml.free_nodes(content);
|
||||
content.clear();
|
||||
}
|
||||
|
||||
// ------------ System ---------------
|
||||
@ -302,7 +300,6 @@ int HostMonitoringTemplate::from_xml(const std::string& xml_string)
|
||||
system.from_xml_node(content[0]);
|
||||
|
||||
xml.free_nodes(content);
|
||||
content.clear();
|
||||
}
|
||||
|
||||
// ------------ NUMA ---------------
|
||||
|
@ -35,7 +35,7 @@ using namespace std;
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
HostPool::HostPool(SqlDB * db, vector<const SingleAttribute *>& ea) :
|
||||
HostPool::HostPool(SqlDB * db, const vector<const SingleAttribute *>& ea) :
|
||||
PoolSQL(db, one_db::host_table)
|
||||
{
|
||||
HostTemplate::parse_encrypted(ea);
|
||||
@ -53,7 +53,7 @@ int HostPool::allocate (
|
||||
const string& cluster_name,
|
||||
string& error_str)
|
||||
{
|
||||
Host * host;
|
||||
Host * host_ptr;
|
||||
ostringstream oss;
|
||||
|
||||
int db_oid;
|
||||
@ -82,7 +82,7 @@ int HostPool::allocate (
|
||||
|
||||
// Build a new Host object
|
||||
|
||||
host = new Host(
|
||||
host_ptr = new Host(
|
||||
-1,
|
||||
hostname,
|
||||
im_mad_name,
|
||||
@ -92,7 +92,7 @@ int HostPool::allocate (
|
||||
|
||||
// Insert the Object in the pool
|
||||
|
||||
*oid = PoolSQL::allocate(host, error_str);
|
||||
*oid = PoolSQL::allocate(host_ptr, error_str);
|
||||
|
||||
if (*oid >= 0)
|
||||
{
|
||||
|
@ -114,8 +114,6 @@ int HostShare::from_xml_node(const xmlNodePtr node)
|
||||
|
||||
ObjectXML::free_nodes(content);
|
||||
|
||||
content.clear();
|
||||
|
||||
if (rc != 0)
|
||||
{
|
||||
return -1;
|
||||
@ -134,8 +132,6 @@ int HostShare::from_xml_node(const xmlNodePtr node)
|
||||
|
||||
ObjectXML::free_nodes(content);
|
||||
|
||||
content.clear();
|
||||
|
||||
if (rc != 0)
|
||||
{
|
||||
return -1;
|
||||
@ -151,8 +147,6 @@ int HostShare::from_xml_node(const xmlNodePtr node)
|
||||
|
||||
ObjectXML::free_nodes(content);
|
||||
|
||||
content.clear();
|
||||
|
||||
if (rc != 0)
|
||||
{
|
||||
return -1;
|
||||
|
@ -496,7 +496,6 @@ int HostShareNode::allocate_ht_cpus(int id, unsigned int tcpus, unsigned int tc,
|
||||
void HostShareNode::del_cpu(const std::string &cpu_ids, unsigned int vmid)
|
||||
{
|
||||
std::vector<unsigned int> ids;
|
||||
std::set<unsigned int> core_ids;
|
||||
|
||||
one_util::split(cpu_ids, ',', ids);
|
||||
|
||||
@ -793,8 +792,7 @@ void HostShareNUMA::set_monitorization(Template &ht, unsigned int _vt)
|
||||
|
||||
for (auto it = pages.begin(); it != pages.end(); ++it)
|
||||
{
|
||||
unsigned int pages = 0;
|
||||
|
||||
unsigned int nr = 0;
|
||||
unsigned long size = 0;
|
||||
|
||||
if ( (*it)->vector_value("NODE_ID", node_id) == -1 )
|
||||
@ -803,11 +801,11 @@ void HostShareNUMA::set_monitorization(Template &ht, unsigned int _vt)
|
||||
}
|
||||
|
||||
(*it)->vector_value("SIZE", size);
|
||||
(*it)->vector_value("PAGES",pages);
|
||||
(*it)->vector_value("PAGES",nr);
|
||||
|
||||
HostShareNode& node = get_node(node_id);
|
||||
|
||||
node.set_hugepage(size, pages, 0, true);
|
||||
node.set_hugepage(size, nr, 0, true);
|
||||
}
|
||||
|
||||
std::vector<VectorAttribute *> memory;
|
||||
@ -1027,7 +1025,6 @@ bool HostShareNUMA::schedule_nodes(NUMANodeRequest &nr, unsigned int threads,
|
||||
|
||||
int HostShareNUMA::make_topology(HostShareCapacity &sr, int vm_id, bool do_alloc)
|
||||
{
|
||||
unsigned int t_max; //Max threads per core for this topology
|
||||
std::set<int> t_valid; //Viable threads per core combinations for all nodes
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@ -1088,13 +1085,11 @@ int HostShareNUMA::make_topology(HostShareCapacity &sr, int vm_id, bool do_alloc
|
||||
//--------------------------------------------------------------------------
|
||||
if ( dedicated )
|
||||
{
|
||||
t_max = 1;
|
||||
|
||||
t_valid.insert(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
t_max = v_t;
|
||||
unsigned int t_max = v_t; //Max threads per core for this topology
|
||||
|
||||
if ( t_max > threads_core || t_max == 0 )
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user