Skip to contentSkip to conversation

qcow2: Fix snapshot restoration in snapshot_create

PATCH Applied Max Reitz 2 participants 2 messages Oct 9, 2013 Block layer

lore
Share & tools
lore

Max Reitz

author
#0 lore raw

PATCH 1/1 qcow2: Fix snapshot restoration in snapshot_create

If the new snapshot table could not be written in qcow2_snapshot_create, the old snapshot table has to be restored in memory and the new one released. This should include restoration of the old snapshot count as well, which is added by this patch.

---
 block/qcow2-snapshot.c | 1 +
 1 file changed, 1 insertion(+)
block/qcow2-snapshot.c +1 -0
index 812dab2..fe7e14c 100644
@@ -433,6 +433,7 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
     if (ret < 0) {
         g_free(s->snapshots);
         s->snapshots = old_snapshot_list;
+        s->nb_snapshots--;
         goto fail;
     }
 
Signature · 1 line
1.8.3.1
Applied
#1 lore raw

Am 09.10.2013 um 14:42 hat Max Reitz geschrieben:

Quoted 6 lines

If the new snapshot table could not be written in qcow2_snapshot_create, the old snapshot table has to be restored in memory and the new one released. This should include restoration of the old snapshot count as well, which is added by this patch.

Thanks, applied to the block branch.

Kevin