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

Feature #1112: Return an error message when DS 0 (system) is added to any cluster

This commit is contained in:
Carlos Martín 2012-03-22 15:56:09 +01:00
parent ef1aa42cf9
commit 7a89275c2b

View File

@ -19,6 +19,7 @@
#include "PoolSQL.h"
#include "ObjectCollection.h"
#include "DatastorePool.h"
using namespace std;
@ -77,6 +78,17 @@ public:
*/
int add_datastore(int id, string& error_msg)
{
if ( id == DatastorePool::SYSTEM_DS_ID )
{
ostringstream oss;
oss << "Datastore '"<< DatastorePool::SYSTEM_DS_NAME
<< "' cannot be added to any cluster.";
error_msg = oss.str();
return -1;
}
int rc = datastores.add_collection_id(id);
if ( rc < 0 )