qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Difference between commit and rebase
@ 2019-08-20  9:27 lampahome
  2019-08-20 10:31 ` Philippe Mathieu-Daudé
  2019-08-20 18:22 ` John Snow
  0 siblings, 2 replies; 3+ messages in thread
From: lampahome @ 2019-08-20  9:27 UTC (permalink / raw)
  To: QEMU Developers

I want to remove snapshots and I found two ways:
qemu-img commit
qemu-img rebase

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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Difference between commit and rebase
  2019-08-20  9:27 [Qemu-devel] Difference between commit and rebase lampahome
@ 2019-08-20 10:31 ` Philippe Mathieu-Daudé
  2019-08-20 18:22 ` John Snow
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-08-20 10:31 UTC (permalink / raw)
  To: lampahome, QEMU Developers, qemu-block

Cc'ing qemu-block@

On 8/20/19 11:27 AM, lampahome wrote:
> I want to remove snapshots and I found two ways:
> qemu-img commit
> qemu-img rebase
> 
> 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?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Difference between commit and rebase
  2019-08-20  9:27 [Qemu-devel] Difference between commit and rebase lampahome
  2019-08-20 10:31 ` Philippe Mathieu-Daudé
@ 2019-08-20 18:22 ` John Snow
  1 sibling, 0 replies; 3+ messages in thread
From: John Snow @ 2019-08-20 18:22 UTC (permalink / raw)
  To: lampahome, QEMU Developers, Qemu-block



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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-20 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20  9:27 [Qemu-devel] Difference between commit and rebase lampahome
2019-08-20 10:31 ` Philippe Mathieu-Daudé
2019-08-20 18:22 ` John Snow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).