mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-09 14:03:20 +09:00
feature #3782: Deal with snapshot id=0
This commit is contained in:
1 parent
a5c04b47e6
commit
4f473093e6
2 files changed
+8
-11
No files matched your search
+1
-1
@@ -131,7 +131,7 @@ private:
|
||||
/**
|
||||
* Id of the active (current) snapshot, 0 represents the base image
|
||||
*/
|
||||
unsigned int active;
|
||||
int active;
|
||||
|
||||
/**
|
||||
* Id of the disk associated with this snapshot list
|
||||
|
||||
+7
-10
@@ -145,19 +145,16 @@ int Snapshots::active_snapshot(unsigned int id, string& error)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( id != 0 )
|
||||
snapshot = get_snapshot(id);
|
||||
|
||||
if (snapshot == 0)
|
||||
{
|
||||
snapshot = get_snapshot(id);
|
||||
|
||||
if (snapshot == 0)
|
||||
{
|
||||
error = "Snapshot does not exists";
|
||||
return -1;
|
||||
}
|
||||
|
||||
snapshot->replace("ACTIVE", true);
|
||||
error = "Snapshot does not exists";
|
||||
return -1;
|
||||
}
|
||||
|
||||
snapshot->replace("ACTIVE", true);
|
||||
|
||||
snapshot = get_snapshot(active);
|
||||
|
||||
if (snapshot != 0)
|
||||
|
||||
Reference in new issue
Block a user