mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
Feature #1224: Accept empty names for new snapshots
This commit is contained in:
1 parent
1f6ed22d49
commit
ddcc7dc655
2 files changed
+12
-3
No files matched your search
@@ -1067,8 +1067,8 @@ void VirtualMachineSnapshotCreate::request_execute(
|
||||
int rc;
|
||||
string error_str;
|
||||
|
||||
int id = xmlrpc_c::value_int(paramList.getInt(1));
|
||||
string str = xmlrpc_c::value_string(paramList.getString(2));
|
||||
int id = xmlrpc_c::value_int(paramList.getInt(1));
|
||||
string name = xmlrpc_c::value_string(paramList.getString(2));
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Authorize the operation
|
||||
@@ -1079,7 +1079,7 @@ void VirtualMachineSnapshotCreate::request_execute(
|
||||
return;
|
||||
}
|
||||
|
||||
rc = dm->snapshot_create(id, str, error_str);
|
||||
rc = dm->snapshot_create(id, name, error_str);
|
||||
|
||||
if ( rc != 0 )
|
||||
{
|
||||
|
||||
@@ -1831,6 +1831,15 @@ int VirtualMachine::new_snapshot(string& name)
|
||||
}
|
||||
}
|
||||
|
||||
if (name.empty())
|
||||
{
|
||||
ostringstream oss;
|
||||
|
||||
oss << "snapshot-" << max_id+1;
|
||||
|
||||
name = oss.str();
|
||||
}
|
||||
|
||||
snap = new VectorAttribute("SNAPSHOT");
|
||||
snap->replace("SNAPSHOT_ID", max_id+1);
|
||||
snap->replace("NAME", name);
|
||||
|
||||
Reference in new issue
Block a user