qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] Can I only commit from active image to cor


From: Alberto Garcia
Subject: Re: [Qemu-block] [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?
Date: Tue, 25 Sep 2018 16:13:03 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Thu 13 Sep 2018 08:37:05 PM CEST, Max Reitz wrote:
> First, split .003 into the part we want to commit and the part we
> don't want to commit.  This is a bit tricky without qemu-img dd @seek
> (or a corresponding convert parameter), so we'll have to make do with
> backing=null so we don't copy anything into the output from img.003's
> backing chain.
>
> Or, we would have to use backing=null, but for some reason that
> doesn't work.  I'll have to investigate.
>
> So rebase will need to do:
>
> $ qemu-img rebase -u -b '' img.003
>
> $ qemu-img convert -O qcow2 \
>     "json:{'driver':'raw','offset':0,'size':1048576,\
>            'file':{'driver':'qcow2',\
>                    'file':{'driver':'file','filename':'img.003'}}}" \
>     "json:{'driver':'null-co','size':2097152}" \
>     img.003.commit.000

If you only want to copy parts of a backing file I think it's much
simpler if you use copy-on-read:

qemu-io -C -c 'read 0 1M' img.003.commit.000 

> $ qemu-img convert -O qcow2 \
>     "json:{'driver':'null-co','size':1048576}" \
>     "json:{'driver':'raw','offset':1048576,'size':2097152,\
>            'file':{'driver':'qcow2',\
>                    'file':{'driver':'file','filename':'img.003'}}}" \
>     img.003.nocommit

qemu-io -C -c 'read 1M 1M' img.003.nocommit

Berto



reply via email to

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