1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-24 21:34:01 +03:00

feature #3782: Cannot clone images with snapshots

This commit is contained in:
Ruben S. Montero 2015-06-02 23:42:19 +02:00
parent 43be9c663e
commit 023c853b6e
2 changed files with 16 additions and 0 deletions

View File

@ -219,6 +219,14 @@ public:
return size_mb;
}
/**
* Return the number of snapshots
*/
unsigned int get_snapshots_size()
{
return snapshots.size();
}
/**
* Sets the source path of the image
*/

View File

@ -280,6 +280,14 @@ void ImageClone::request_execute(
return;
}
if (img->get_snapshots_size () > 0)
{
failure_response(ACTION,
request_error("Cannot clone images with snapshots",""), att);
img->unlock();
return;
}
tmpl = img->clone_template(name);
img->get_permissions(perms);