1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #3782: allow disk-saveas operations on the currently running disk

This commit is contained in:
Jaime Melis 2015-06-11 18:09:41 +02:00
parent e5bcaea18d
commit 996ee89dc1

View File

@ -3229,23 +3229,11 @@ int VirtualMachine::set_saveas_disk(int disk_id, int snap_id, string& err_str)
const Snapshots * snaps = get_disk_snapshots(disk_id, err_str);
if (snaps == 0)
if (snap_id != -1)
{
if (snap_id != -1)
if (snaps == 0 || !snaps->exists(snap_id))
{
err_str = "Snapshot does not exists.";
return -1;
}
}
else
{
if (snap_id == -1)
{
snap_id = snaps->get_active_id();
}
else if (!snaps->exists(snap_id))
{
err_str = "Snapshot does not exists.";
err_str = "Snapshot does not exist.";
return -1;
}
}