qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Difference between commit and rebase


From: Max Reitz
Subject: Re: [Qemu-discuss] Difference between commit and rebase
Date: Tue, 20 Aug 2019 13:02:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 20.08.19 11:41, lampahome wrote:
> I want to remove snapshots and I found two ways:
> qemu-img commit
> qemu-img rebase
> 
> I found they both can choose which img to rebase(merge).
> 
> And I found some little difference like below:
> commit can truncate or not on specific image.
> rebase won't truncate rebased image.
> 
> I found they have something little similarity and I don't know what
> situation is suitable for commit or rebase?
> I don't know what situation is suitable to use commit or rebase.

Generally, rebase is going to be slower because it reads some clusters
and compares the old with the new backing file to see whether they are
the same.  commit will not do that.  (OTOH, if there are many clusters
in the old backing chain that happen to contain the same data as the new
one, this will save space, because it won’t copy those clusters from the
old backing chain.)

That’s because rebase is a more general tool than commit, so it has to
do this comparison cluster by cluster.

Other than that, commit is the same as the commit block job, and rebase
is similar to the stream block job.  One of their main differences is
which image the data ends up in: If the overlay and the backing file lie
on different storage media, you may prefer one of them to hold data over
the other.

Example 1: Say your overlay is on a fast medium and your base image is
on a slow medium (with greater storage capacity, though).  In this case,
you probably want to move data off to the slower medium for long-term
storage, so you probably want to use commit.

Example 2: You have some image with a backing file on a remote server
(e.g. some template image).  You now want to become independent of that
remote server, so you need to move the data to your local storage.  In
this case, you will want to use rebase (with -b '').

HTH,

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]