mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-26 09:57:23 +03:00
B #2913: Do not update vnc bitmaps if not needed
This commit is contained in:
parent
228178f049
commit
3d748610d4
@ -86,10 +86,35 @@ public:
|
||||
get_template_attribute("RESERVED_MEM", mem);
|
||||
}
|
||||
|
||||
// *************************************************************************
|
||||
// DataBase implementation (Public)
|
||||
// *************************************************************************
|
||||
/**
|
||||
* Function to print the Cluster object into a string in XML format
|
||||
* @param xml the resulting XML string
|
||||
* @return a reference to the generated string
|
||||
*/
|
||||
string& to_xml(string& xml) const;
|
||||
|
||||
/**
|
||||
* Rebuilds the object from an xml formatted string
|
||||
* @param xml_str The xml-formatted string
|
||||
*
|
||||
* @return 0 on success, -1 otherwise
|
||||
*/
|
||||
int from_xml(const string &xml_str);
|
||||
|
||||
private:
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Friends
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
friend class ClusterPool;
|
||||
|
||||
// *************************************************************************
|
||||
// VNC Port management function
|
||||
// *************************************************************************
|
||||
|
||||
/**
|
||||
* Returns a free VNC port, it will try first to allocate base_port + vmid.
|
||||
* If this port is not free the first lower port from the VNC_PORT/START
|
||||
@ -116,33 +141,6 @@ public:
|
||||
return vnc_bitmap.set(port);
|
||||
}
|
||||
|
||||
// *************************************************************************
|
||||
// DataBase implementation (Public)
|
||||
// *************************************************************************
|
||||
|
||||
/**
|
||||
* Function to print the Cluster object into a string in XML format
|
||||
* @param xml the resulting XML string
|
||||
* @return a reference to the generated string
|
||||
*/
|
||||
string& to_xml(string& xml) const;
|
||||
|
||||
/**
|
||||
* Rebuilds the object from an xml formatted string
|
||||
* @param xml_str The xml-formatted string
|
||||
*
|
||||
* @return 0 on success, -1 otherwise
|
||||
*/
|
||||
int from_xml(const string &xml_str);
|
||||
|
||||
private:
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Friends
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
friend class ClusterPool;
|
||||
|
||||
// *************************************************************************
|
||||
// Constructor
|
||||
// *************************************************************************
|
||||
@ -234,11 +232,7 @@ private:
|
||||
{
|
||||
string error_str;
|
||||
|
||||
int rc = insert_replace(db, true, error_str);
|
||||
|
||||
rc += vnc_bitmap.update(db);
|
||||
|
||||
return rc;
|
||||
return insert_replace(db, true, error_str);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -271,8 +271,6 @@ int ClusterPool::add_to_cluster(PoolObjectSQL::ObjectType type, Cluster* cluster
|
||||
{
|
||||
string table, names;
|
||||
|
||||
int rc;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case PoolObjectSQL::DATASTORE:
|
||||
@ -290,7 +288,7 @@ int ClusterPool::add_to_cluster(PoolObjectSQL::ObjectType type, Cluster* cluster
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = cluster->add_resource(type, resource_id, error_msg);
|
||||
int rc = cluster->add_resource(type, resource_id, error_msg);
|
||||
|
||||
if (rc != 0)
|
||||
{
|
||||
@ -371,7 +369,6 @@ int ClusterPool::del_from_cluster(PoolObjectSQL::ObjectType type, Cluster* clust
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
update(cluster);
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user