feature #3782: Deal with snapshot id=0

This commit is contained in:
Ruben S. Montero committed 2015-05-26 12:52:55 +02:00
1 parent a5c04b47e6
commit 4f473093e6
2 files changed
+8 -11

No files matched your search

+1 -1
View File
@@ -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
View File
@@ -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)