qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] qemu-img: Implement 'diff' operation.


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v3] qemu-img: Implement 'diff' operation.
Date: Mon, 21 May 2012 17:40:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

Am 21.05.2012 17:30, schrieb Eric Blake:
> On 05/21/2012 07:59 AM, Richard W.M. Jones wrote:
> 
>>>
>>> Hm, I'm wondering... If I have a command line like this:
>>>
>>>   qemu-img diff -b base.img modified.img diff.qcow2
>>>
>>> Would this be equivalent to this sequence?
>>>
>>>   qemu-img create -f qcow2 -b modified.img diff.qcow2
>>>   qemu-img rebase -b base.img diff.qcow2
> 
> So 'qemu-img rebase' is able to rebase to any other image, even if
> base.img is nowhere in the backing chain of modified.img?  That means it
> is more powerful than runtime 'block-stream' monitor command under qemu,
> which can only do a block pull from an earlier point in the backing chain.

Correct. 'qemu-img rebase' compares the old and the new backing file for
each unallocated cluster of the overlay, and if they differ, it copies
the data from the old backing file into the overlay.

Not sure if there would be any real use for a real live rebase, but even
if there was, implementing it probably wouldn't be a priority for most
of us.

>> Yes.  I tried for a while to work out the sequence of commands that
>> could make a diff using 'qemu-img rebase', but it wasn't obvious and I
>> gave up.  It should at least be documented.  How about the attached
>> patch?
> 
> Seems reasonable to me.  A two-command sequence of qemu-img to
> manipulate offline images isn't all that bad; it's different from the
> case of a disk image in active use by qemu.

Even there you use a two-command sequence when you do an external
'qemu-img create' and then use the 'existing' mode of snapshots or
mirroring. :-)

Kevin



reply via email to

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