diff options
Diffstat (limited to 'block/qcow2-snapshot.c')
-rw-r--r-- | block/qcow2-snapshot.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 992a5c865c..0caac9055f 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c @@ -262,7 +262,8 @@ static int qcow2_write_snapshots(BlockDriverState *bs) } /* free the old snapshot table */ - qcow2_free_clusters(bs, s->snapshots_offset, s->snapshots_size); + qcow2_free_clusters(bs, s->snapshots_offset, s->snapshots_size, + QCOW2_DISCARD_SNAPSHOT); s->snapshots_offset = snapshots_offset; s->snapshots_size = snapshots_size; return 0; @@ -569,7 +570,8 @@ int qcow2_snapshot_delete(BlockDriverState *bs, const char *snapshot_id) if (ret < 0) { return ret; } - qcow2_free_clusters(bs, sn.l1_table_offset, sn.l1_size * sizeof(uint64_t)); + qcow2_free_clusters(bs, sn.l1_table_offset, sn.l1_size * sizeof(uint64_t), + QCOW2_DISCARD_SNAPSHOT); /* must update the copied flag on the current cluster offsets */ ret = qcow2_update_snapshot_refcount(bs, s->l1_table_offset, s->l1_size, 0); |