On 8/20/19 5:27 AM, lampahome wrote:
> I want to remove snapshots and I found two ways:
> qemu-img commit

Commit takes a chain of images:

[base] <-- [top]

and commits the top image down into the base image:

[base+top]

> qemu-img rebase

Rebase takes a chain of images:

[base] <-- [top]

And moves the top image onto a new base image, copying data as necessary
to preserve the differential relationship:

[different_base] <-- [top]

> 
> I found they both can choose where to rebase(merge) the images.
> commit can truncate or not on specific image.
> rebase won't truncate rebased image.
> 
> I found they have something similarity and I don't know what situation is
> suitable for commit or rebase?
> 

Commit is best when you have a single lineage of snapshots, like
A<--B<--C and you decide you don't actually need all of those snapshots
anymore, and would prefer to go back to a single image.

Rebase is most useful when you have several different chains of images
that are based on some common ancestor, and you would like to reparent
an image on top of a cousin branch.

(There are many more uses, but these ones are the most obvious to me
personally.)

--js

Reply via email to