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

Bug #298: VM::save_disk now doesn't work for VMs in DONE or FAILED states. Remove duplicated log entry.

This commit is contained in:
Carlos Martín 2011-07-27 12:12:40 +02:00
parent 22574704e4
commit 11214a6758

View File

@ -982,6 +982,10 @@ int VirtualMachine::save_disk(int disk_id, int img_id, string& error_str)
ostringstream oss;
istringstream iss;
if ( state == DONE || state == FAILED )
{
goto error_state;
}
num_disks = obj_template->get("DISK",disks);
@ -1022,6 +1026,10 @@ int VirtualMachine::save_disk(int disk_id, int img_id, string& error_str)
goto error_not_found;
error_state:
oss << "VM cannot be in DONE or FAILED state.";
goto error_common;
error_persistent:
oss << "Source image for DISK " << disk_id << " is persistent.";
goto error_common;
@ -1034,7 +1042,6 @@ error_not_found:
oss << "The DISK " << disk_id << " does not exist for VM " << oid << ".";
error_common:
NebulaLog::log("VM",Log::ERROR, oss);
error_str = oss.str();
return -1;